diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java index 8c855cd..e4a3191 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java @@ -15,9 +15,9 @@ import com.casic.dcms.adapter.SwipeViewAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.FragmentNoticeBinding; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; import com.casic.dcms.utils.LocaleConstant; @@ -36,9 +36,9 @@ private static final String TAG = "NoticePageFragment"; private static WeakReferenceHandler weakReferenceHandler; private Context context; - private NoticeBeanDao noticeBeanDao; + private NoticeLocaleBeanDao noticeBeanDao; private SwipeViewAdapter swipeViewAdapter; - private List noticeBeans = new ArrayList<>(); + private List noticeBeans = new ArrayList<>(); @Override protected void setupTopBarLayout() { @@ -49,14 +49,14 @@ protected void initData() { swipeViewAdapter = new SwipeViewAdapter(context); //根据loginName加载历史数据 - String account = StringHelper.getUserAccount(); + String account = StringHelper.getUserBean().getAccount(); if (TextUtils.isEmpty(account)) { return; } - noticeBeanDao = BaseApplication.getDaoSession().getNoticeBeanDao(); + noticeBeanDao = BaseApplication.getDaoSession().getNoticeLocaleBeanDao(); noticeBeans = noticeBeanDao.queryBuilder() - .where(NoticeBeanDao.Properties.UserAccount.eq(account)) - .orderDesc(NoticeBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 + .where(NoticeLocaleBeanDao.Properties.UserAccount.eq(account)) + .orderDesc(NoticeLocaleBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 .list(); swipeViewAdapter.setData(noticeBeans); weakReferenceHandler = new WeakReferenceHandler(this); @@ -108,7 +108,7 @@ MainActivity.sendEmptyMessage(LocaleConstant.MESSAGE_NUMBER); //点击之后之后,未读消息变为已读消息 - NoticeBean noticeBean = noticeBeans.get(position); + NoticeLocaleBean noticeBean = noticeBeans.get(position); noticeBean.setIsRead("0"); noticeBeanDao.update(noticeBean); swipeViewAdapter.notifyDataSetChanged(); @@ -132,9 +132,9 @@ NoticePageFragment noticePageFragment; try { noticePageFragment = reference.get(); - List noticeBeans = noticePageFragment.noticeBeans; + List noticeBeans = noticePageFragment.noticeBeans; if (msg.what == LocaleConstant.PUSH_MESSAGE_DATA) { - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; Log.d(TAG, "收到推送消息,更新列表: " + noticeBean.getCaseId()); noticeBeans.add(0, noticeBean); //新消息永远放到第一个 //更新数据 @@ -147,9 +147,6 @@ } - /** - * 供{@link com.casic.dcms.service.GeTuiIntentService.onReceiveMessageData}调用 - */ public static void sendMessage(Message msg) { if (weakReferenceHandler == null) { return; diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java index 8c855cd..e4a3191 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java @@ -15,9 +15,9 @@ import com.casic.dcms.adapter.SwipeViewAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.FragmentNoticeBinding; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; import com.casic.dcms.utils.LocaleConstant; @@ -36,9 +36,9 @@ private static final String TAG = "NoticePageFragment"; private static WeakReferenceHandler weakReferenceHandler; private Context context; - private NoticeBeanDao noticeBeanDao; + private NoticeLocaleBeanDao noticeBeanDao; private SwipeViewAdapter swipeViewAdapter; - private List noticeBeans = new ArrayList<>(); + private List noticeBeans = new ArrayList<>(); @Override protected void setupTopBarLayout() { @@ -49,14 +49,14 @@ protected void initData() { swipeViewAdapter = new SwipeViewAdapter(context); //根据loginName加载历史数据 - String account = StringHelper.getUserAccount(); + String account = StringHelper.getUserBean().getAccount(); if (TextUtils.isEmpty(account)) { return; } - noticeBeanDao = BaseApplication.getDaoSession().getNoticeBeanDao(); + noticeBeanDao = BaseApplication.getDaoSession().getNoticeLocaleBeanDao(); noticeBeans = noticeBeanDao.queryBuilder() - .where(NoticeBeanDao.Properties.UserAccount.eq(account)) - .orderDesc(NoticeBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 + .where(NoticeLocaleBeanDao.Properties.UserAccount.eq(account)) + .orderDesc(NoticeLocaleBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 .list(); swipeViewAdapter.setData(noticeBeans); weakReferenceHandler = new WeakReferenceHandler(this); @@ -108,7 +108,7 @@ MainActivity.sendEmptyMessage(LocaleConstant.MESSAGE_NUMBER); //点击之后之后,未读消息变为已读消息 - NoticeBean noticeBean = noticeBeans.get(position); + NoticeLocaleBean noticeBean = noticeBeans.get(position); noticeBean.setIsRead("0"); noticeBeanDao.update(noticeBean); swipeViewAdapter.notifyDataSetChanged(); @@ -132,9 +132,9 @@ NoticePageFragment noticePageFragment; try { noticePageFragment = reference.get(); - List noticeBeans = noticePageFragment.noticeBeans; + List noticeBeans = noticePageFragment.noticeBeans; if (msg.what == LocaleConstant.PUSH_MESSAGE_DATA) { - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; Log.d(TAG, "收到推送消息,更新列表: " + noticeBean.getCaseId()); noticeBeans.add(0, noticeBean); //新消息永远放到第一个 //更新数据 @@ -147,9 +147,6 @@ } - /** - * 供{@link com.casic.dcms.service.GeTuiIntentService.onReceiveMessageData}调用 - */ public static void sendMessage(Message msg) { if (weakReferenceHandler == null) { return; diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java index a2034fe..f578afc 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java @@ -2,7 +2,7 @@ import androidx.lifecycle.MutableLiveData; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -19,7 +19,7 @@ public class MapConfigViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData mapConfigModel = new MutableLiveData<>(); + public MutableLiveData mapConfigModel = new MutableLiveData<>(); public void obtainMapConfig() { Observable observable = RetrofitServiceManager.getMapConfig(); @@ -40,7 +40,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - MapConfigBean configBean = gson.fromJson(response, new TypeToken() { + MapConfigModel configBean = gson.fromJson(response, new TypeToken() { }.getType()); mapConfigModel.setValue(configBean); } else { diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java index 8c855cd..e4a3191 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java @@ -15,9 +15,9 @@ import com.casic.dcms.adapter.SwipeViewAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.FragmentNoticeBinding; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; import com.casic.dcms.utils.LocaleConstant; @@ -36,9 +36,9 @@ private static final String TAG = "NoticePageFragment"; private static WeakReferenceHandler weakReferenceHandler; private Context context; - private NoticeBeanDao noticeBeanDao; + private NoticeLocaleBeanDao noticeBeanDao; private SwipeViewAdapter swipeViewAdapter; - private List noticeBeans = new ArrayList<>(); + private List noticeBeans = new ArrayList<>(); @Override protected void setupTopBarLayout() { @@ -49,14 +49,14 @@ protected void initData() { swipeViewAdapter = new SwipeViewAdapter(context); //根据loginName加载历史数据 - String account = StringHelper.getUserAccount(); + String account = StringHelper.getUserBean().getAccount(); if (TextUtils.isEmpty(account)) { return; } - noticeBeanDao = BaseApplication.getDaoSession().getNoticeBeanDao(); + noticeBeanDao = BaseApplication.getDaoSession().getNoticeLocaleBeanDao(); noticeBeans = noticeBeanDao.queryBuilder() - .where(NoticeBeanDao.Properties.UserAccount.eq(account)) - .orderDesc(NoticeBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 + .where(NoticeLocaleBeanDao.Properties.UserAccount.eq(account)) + .orderDesc(NoticeLocaleBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 .list(); swipeViewAdapter.setData(noticeBeans); weakReferenceHandler = new WeakReferenceHandler(this); @@ -108,7 +108,7 @@ MainActivity.sendEmptyMessage(LocaleConstant.MESSAGE_NUMBER); //点击之后之后,未读消息变为已读消息 - NoticeBean noticeBean = noticeBeans.get(position); + NoticeLocaleBean noticeBean = noticeBeans.get(position); noticeBean.setIsRead("0"); noticeBeanDao.update(noticeBean); swipeViewAdapter.notifyDataSetChanged(); @@ -132,9 +132,9 @@ NoticePageFragment noticePageFragment; try { noticePageFragment = reference.get(); - List noticeBeans = noticePageFragment.noticeBeans; + List noticeBeans = noticePageFragment.noticeBeans; if (msg.what == LocaleConstant.PUSH_MESSAGE_DATA) { - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; Log.d(TAG, "收到推送消息,更新列表: " + noticeBean.getCaseId()); noticeBeans.add(0, noticeBean); //新消息永远放到第一个 //更新数据 @@ -147,9 +147,6 @@ } - /** - * 供{@link com.casic.dcms.service.GeTuiIntentService.onReceiveMessageData}调用 - */ public static void sendMessage(Message msg) { if (weakReferenceHandler == null) { return; diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java index a2034fe..f578afc 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java @@ -2,7 +2,7 @@ import androidx.lifecycle.MutableLiveData; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -19,7 +19,7 @@ public class MapConfigViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData mapConfigModel = new MutableLiveData<>(); + public MutableLiveData mapConfigModel = new MutableLiveData<>(); public void obtainMapConfig() { Observable observable = RetrofitServiceManager.getMapConfig(); @@ -40,7 +40,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - MapConfigBean configBean = gson.fromJson(response, new TypeToken() { + MapConfigModel configBean = gson.fromJson(response, new TypeToken() { }.getType()); mapConfigModel.setValue(configBean); } else { diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java index c415b6c..016f52b 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java @@ -4,7 +4,7 @@ import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.CleanRecordBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -21,7 +21,7 @@ public class ToiletViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData toiletListModel = new MutableLiveData<>(); + public MutableLiveData toiletListModel = new MutableLiveData<>(); public MutableLiveData cleanToiletModel = new MutableLiveData<>(); public MutableLiveData cleanRecordModel = new MutableLiveData<>(); @@ -44,7 +44,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - ToiletListBean listBean = gson.fromJson(response, new TypeToken() { + ToiletListModel listBean = gson.fromJson(response, new TypeToken() { }.getType()); toiletListModel.setValue(listBean); } diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java index 8c855cd..e4a3191 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java @@ -15,9 +15,9 @@ import com.casic.dcms.adapter.SwipeViewAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.FragmentNoticeBinding; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; import com.casic.dcms.utils.LocaleConstant; @@ -36,9 +36,9 @@ private static final String TAG = "NoticePageFragment"; private static WeakReferenceHandler weakReferenceHandler; private Context context; - private NoticeBeanDao noticeBeanDao; + private NoticeLocaleBeanDao noticeBeanDao; private SwipeViewAdapter swipeViewAdapter; - private List noticeBeans = new ArrayList<>(); + private List noticeBeans = new ArrayList<>(); @Override protected void setupTopBarLayout() { @@ -49,14 +49,14 @@ protected void initData() { swipeViewAdapter = new SwipeViewAdapter(context); //根据loginName加载历史数据 - String account = StringHelper.getUserAccount(); + String account = StringHelper.getUserBean().getAccount(); if (TextUtils.isEmpty(account)) { return; } - noticeBeanDao = BaseApplication.getDaoSession().getNoticeBeanDao(); + noticeBeanDao = BaseApplication.getDaoSession().getNoticeLocaleBeanDao(); noticeBeans = noticeBeanDao.queryBuilder() - .where(NoticeBeanDao.Properties.UserAccount.eq(account)) - .orderDesc(NoticeBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 + .where(NoticeLocaleBeanDao.Properties.UserAccount.eq(account)) + .orderDesc(NoticeLocaleBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 .list(); swipeViewAdapter.setData(noticeBeans); weakReferenceHandler = new WeakReferenceHandler(this); @@ -108,7 +108,7 @@ MainActivity.sendEmptyMessage(LocaleConstant.MESSAGE_NUMBER); //点击之后之后,未读消息变为已读消息 - NoticeBean noticeBean = noticeBeans.get(position); + NoticeLocaleBean noticeBean = noticeBeans.get(position); noticeBean.setIsRead("0"); noticeBeanDao.update(noticeBean); swipeViewAdapter.notifyDataSetChanged(); @@ -132,9 +132,9 @@ NoticePageFragment noticePageFragment; try { noticePageFragment = reference.get(); - List noticeBeans = noticePageFragment.noticeBeans; + List noticeBeans = noticePageFragment.noticeBeans; if (msg.what == LocaleConstant.PUSH_MESSAGE_DATA) { - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; Log.d(TAG, "收到推送消息,更新列表: " + noticeBean.getCaseId()); noticeBeans.add(0, noticeBean); //新消息永远放到第一个 //更新数据 @@ -147,9 +147,6 @@ } - /** - * 供{@link com.casic.dcms.service.GeTuiIntentService.onReceiveMessageData}调用 - */ public static void sendMessage(Message msg) { if (weakReferenceHandler == null) { return; diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java index a2034fe..f578afc 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java @@ -2,7 +2,7 @@ import androidx.lifecycle.MutableLiveData; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -19,7 +19,7 @@ public class MapConfigViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData mapConfigModel = new MutableLiveData<>(); + public MutableLiveData mapConfigModel = new MutableLiveData<>(); public void obtainMapConfig() { Observable observable = RetrofitServiceManager.getMapConfig(); @@ -40,7 +40,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - MapConfigBean configBean = gson.fromJson(response, new TypeToken() { + MapConfigModel configBean = gson.fromJson(response, new TypeToken() { }.getType()); mapConfigModel.setValue(configBean); } else { diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java index c415b6c..016f52b 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java @@ -4,7 +4,7 @@ import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.CleanRecordBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -21,7 +21,7 @@ public class ToiletViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData toiletListModel = new MutableLiveData<>(); + public MutableLiveData toiletListModel = new MutableLiveData<>(); public MutableLiveData cleanToiletModel = new MutableLiveData<>(); public MutableLiveData cleanRecordModel = new MutableLiveData<>(); @@ -44,7 +44,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - ToiletListBean listBean = gson.fromJson(response, new TypeToken() { + ToiletListModel listBean = gson.fromJson(response, new TypeToken() { }.getType()); toiletListModel.setValue(listBean); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java index ce0c065..f4c85ca 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java @@ -65,7 +65,7 @@ loadState.setValue(LoadState.Loading); //改为上传带水印的图片 Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); - ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserAccount(), + ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserBean().getAccount(), TimeOrDateUtil.timestampToDate(System.currentTimeMillis()), TimeOrDateUtil.timestampToTime(System.currentTimeMillis()), new IWaterMarkAddListener() { diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java index 8c855cd..e4a3191 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java @@ -15,9 +15,9 @@ import com.casic.dcms.adapter.SwipeViewAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.FragmentNoticeBinding; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; import com.casic.dcms.utils.LocaleConstant; @@ -36,9 +36,9 @@ private static final String TAG = "NoticePageFragment"; private static WeakReferenceHandler weakReferenceHandler; private Context context; - private NoticeBeanDao noticeBeanDao; + private NoticeLocaleBeanDao noticeBeanDao; private SwipeViewAdapter swipeViewAdapter; - private List noticeBeans = new ArrayList<>(); + private List noticeBeans = new ArrayList<>(); @Override protected void setupTopBarLayout() { @@ -49,14 +49,14 @@ protected void initData() { swipeViewAdapter = new SwipeViewAdapter(context); //根据loginName加载历史数据 - String account = StringHelper.getUserAccount(); + String account = StringHelper.getUserBean().getAccount(); if (TextUtils.isEmpty(account)) { return; } - noticeBeanDao = BaseApplication.getDaoSession().getNoticeBeanDao(); + noticeBeanDao = BaseApplication.getDaoSession().getNoticeLocaleBeanDao(); noticeBeans = noticeBeanDao.queryBuilder() - .where(NoticeBeanDao.Properties.UserAccount.eq(account)) - .orderDesc(NoticeBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 + .where(NoticeLocaleBeanDao.Properties.UserAccount.eq(account)) + .orderDesc(NoticeLocaleBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 .list(); swipeViewAdapter.setData(noticeBeans); weakReferenceHandler = new WeakReferenceHandler(this); @@ -108,7 +108,7 @@ MainActivity.sendEmptyMessage(LocaleConstant.MESSAGE_NUMBER); //点击之后之后,未读消息变为已读消息 - NoticeBean noticeBean = noticeBeans.get(position); + NoticeLocaleBean noticeBean = noticeBeans.get(position); noticeBean.setIsRead("0"); noticeBeanDao.update(noticeBean); swipeViewAdapter.notifyDataSetChanged(); @@ -132,9 +132,9 @@ NoticePageFragment noticePageFragment; try { noticePageFragment = reference.get(); - List noticeBeans = noticePageFragment.noticeBeans; + List noticeBeans = noticePageFragment.noticeBeans; if (msg.what == LocaleConstant.PUSH_MESSAGE_DATA) { - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; Log.d(TAG, "收到推送消息,更新列表: " + noticeBean.getCaseId()); noticeBeans.add(0, noticeBean); //新消息永远放到第一个 //更新数据 @@ -147,9 +147,6 @@ } - /** - * 供{@link com.casic.dcms.service.GeTuiIntentService.onReceiveMessageData}调用 - */ public static void sendMessage(Message msg) { if (weakReferenceHandler == null) { return; diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java index a2034fe..f578afc 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java @@ -2,7 +2,7 @@ import androidx.lifecycle.MutableLiveData; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -19,7 +19,7 @@ public class MapConfigViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData mapConfigModel = new MutableLiveData<>(); + public MutableLiveData mapConfigModel = new MutableLiveData<>(); public void obtainMapConfig() { Observable observable = RetrofitServiceManager.getMapConfig(); @@ -40,7 +40,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - MapConfigBean configBean = gson.fromJson(response, new TypeToken() { + MapConfigModel configBean = gson.fromJson(response, new TypeToken() { }.getType()); mapConfigModel.setValue(configBean); } else { diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java index c415b6c..016f52b 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java @@ -4,7 +4,7 @@ import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.CleanRecordBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -21,7 +21,7 @@ public class ToiletViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData toiletListModel = new MutableLiveData<>(); + public MutableLiveData toiletListModel = new MutableLiveData<>(); public MutableLiveData cleanToiletModel = new MutableLiveData<>(); public MutableLiveData cleanRecordModel = new MutableLiveData<>(); @@ -44,7 +44,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - ToiletListBean listBean = gson.fromJson(response, new TypeToken() { + ToiletListModel listBean = gson.fromJson(response, new TypeToken() { }.getType()); toiletListModel.setValue(listBean); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java index ce0c065..f4c85ca 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java @@ -65,7 +65,7 @@ loadState.setValue(LoadState.Loading); //改为上传带水印的图片 Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); - ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserAccount(), + ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserBean().getAccount(), TimeOrDateUtil.timestampToDate(System.currentTimeMillis()), TimeOrDateUtil.timestampToTime(System.currentTimeMillis()), new IWaterMarkAddListener() { diff --git a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java index 9b38cdd..18b9cdd 100644 --- a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java +++ b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java @@ -7,7 +7,7 @@ import android.util.Log; import com.casic.dcms.base.BaseApplication; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.mvvm.model.PushResultBean; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; @@ -51,8 +51,8 @@ String messageContent = new String(msg.getPayload()); PushResultBean resultBean = gson.fromJson(messageContent, new TypeToken() { }.getType()); - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setUserAccount(StringHelper.getUserAccount()); + NoticeLocaleBean noticeBean = new NoticeLocaleBean(); + noticeBean.setUserAccount(StringHelper.getUserBean().getAccount()); noticeBean.setCaseId(resultBean.getData().getId()); noticeBean.setTitle(resultBean.getTitle()); noticeBean.setContent(resultBean.getContent()); @@ -61,7 +61,7 @@ noticeBean.setIsRead("1"); //存本地一份 - BaseApplication.getDaoSession().getNoticeBeanDao().insert(noticeBean); + BaseApplication.getDaoSession().getNoticeLocaleBeanDao().insert(noticeBean); //创建通知栏 Message msgNotice = Message.obtain(); diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java index 8c855cd..e4a3191 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java @@ -15,9 +15,9 @@ import com.casic.dcms.adapter.SwipeViewAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.FragmentNoticeBinding; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; import com.casic.dcms.utils.LocaleConstant; @@ -36,9 +36,9 @@ private static final String TAG = "NoticePageFragment"; private static WeakReferenceHandler weakReferenceHandler; private Context context; - private NoticeBeanDao noticeBeanDao; + private NoticeLocaleBeanDao noticeBeanDao; private SwipeViewAdapter swipeViewAdapter; - private List noticeBeans = new ArrayList<>(); + private List noticeBeans = new ArrayList<>(); @Override protected void setupTopBarLayout() { @@ -49,14 +49,14 @@ protected void initData() { swipeViewAdapter = new SwipeViewAdapter(context); //根据loginName加载历史数据 - String account = StringHelper.getUserAccount(); + String account = StringHelper.getUserBean().getAccount(); if (TextUtils.isEmpty(account)) { return; } - noticeBeanDao = BaseApplication.getDaoSession().getNoticeBeanDao(); + noticeBeanDao = BaseApplication.getDaoSession().getNoticeLocaleBeanDao(); noticeBeans = noticeBeanDao.queryBuilder() - .where(NoticeBeanDao.Properties.UserAccount.eq(account)) - .orderDesc(NoticeBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 + .where(NoticeLocaleBeanDao.Properties.UserAccount.eq(account)) + .orderDesc(NoticeLocaleBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 .list(); swipeViewAdapter.setData(noticeBeans); weakReferenceHandler = new WeakReferenceHandler(this); @@ -108,7 +108,7 @@ MainActivity.sendEmptyMessage(LocaleConstant.MESSAGE_NUMBER); //点击之后之后,未读消息变为已读消息 - NoticeBean noticeBean = noticeBeans.get(position); + NoticeLocaleBean noticeBean = noticeBeans.get(position); noticeBean.setIsRead("0"); noticeBeanDao.update(noticeBean); swipeViewAdapter.notifyDataSetChanged(); @@ -132,9 +132,9 @@ NoticePageFragment noticePageFragment; try { noticePageFragment = reference.get(); - List noticeBeans = noticePageFragment.noticeBeans; + List noticeBeans = noticePageFragment.noticeBeans; if (msg.what == LocaleConstant.PUSH_MESSAGE_DATA) { - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; Log.d(TAG, "收到推送消息,更新列表: " + noticeBean.getCaseId()); noticeBeans.add(0, noticeBean); //新消息永远放到第一个 //更新数据 @@ -147,9 +147,6 @@ } - /** - * 供{@link com.casic.dcms.service.GeTuiIntentService.onReceiveMessageData}调用 - */ public static void sendMessage(Message msg) { if (weakReferenceHandler == null) { return; diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java index a2034fe..f578afc 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java @@ -2,7 +2,7 @@ import androidx.lifecycle.MutableLiveData; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -19,7 +19,7 @@ public class MapConfigViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData mapConfigModel = new MutableLiveData<>(); + public MutableLiveData mapConfigModel = new MutableLiveData<>(); public void obtainMapConfig() { Observable observable = RetrofitServiceManager.getMapConfig(); @@ -40,7 +40,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - MapConfigBean configBean = gson.fromJson(response, new TypeToken() { + MapConfigModel configBean = gson.fromJson(response, new TypeToken() { }.getType()); mapConfigModel.setValue(configBean); } else { diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java index c415b6c..016f52b 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java @@ -4,7 +4,7 @@ import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.CleanRecordBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -21,7 +21,7 @@ public class ToiletViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData toiletListModel = new MutableLiveData<>(); + public MutableLiveData toiletListModel = new MutableLiveData<>(); public MutableLiveData cleanToiletModel = new MutableLiveData<>(); public MutableLiveData cleanRecordModel = new MutableLiveData<>(); @@ -44,7 +44,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - ToiletListBean listBean = gson.fromJson(response, new TypeToken() { + ToiletListModel listBean = gson.fromJson(response, new TypeToken() { }.getType()); toiletListModel.setValue(listBean); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java index ce0c065..f4c85ca 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java @@ -65,7 +65,7 @@ loadState.setValue(LoadState.Loading); //改为上传带水印的图片 Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); - ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserAccount(), + ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserBean().getAccount(), TimeOrDateUtil.timestampToDate(System.currentTimeMillis()), TimeOrDateUtil.timestampToTime(System.currentTimeMillis()), new IWaterMarkAddListener() { diff --git a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java index 9b38cdd..18b9cdd 100644 --- a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java +++ b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java @@ -7,7 +7,7 @@ import android.util.Log; import com.casic.dcms.base.BaseApplication; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.mvvm.model.PushResultBean; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; @@ -51,8 +51,8 @@ String messageContent = new String(msg.getPayload()); PushResultBean resultBean = gson.fromJson(messageContent, new TypeToken() { }.getType()); - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setUserAccount(StringHelper.getUserAccount()); + NoticeLocaleBean noticeBean = new NoticeLocaleBean(); + noticeBean.setUserAccount(StringHelper.getUserBean().getAccount()); noticeBean.setCaseId(resultBean.getData().getId()); noticeBean.setTitle(resultBean.getTitle()); noticeBean.setContent(resultBean.getContent()); @@ -61,7 +61,7 @@ noticeBean.setIsRead("1"); //存本地一份 - BaseApplication.getDaoSession().getNoticeBeanDao().insert(noticeBean); + BaseApplication.getDaoSession().getNoticeLocaleBeanDao().insert(noticeBean); //创建通知栏 Message msgNotice = Message.obtain(); diff --git a/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java b/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java index 3613fa8..be79c4e 100644 --- a/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java +++ b/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java @@ -2,7 +2,7 @@ import android.util.Log; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.esri.arcgisruntime.data.ServiceFeatureTable; import com.esri.arcgisruntime.layers.ArcGISTiledLayer; @@ -16,7 +16,7 @@ * 创建带网格的ArcGIS底图 */ public static ArcGISTiledLayer createBaseLayer() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ArcGISTiledLayer("/"); @@ -34,7 +34,7 @@ * 创建不带网格的ArcGIS底图 */ public static ArcGISTiledLayer createNoGridLayer() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ArcGISTiledLayer("/"); @@ -51,7 +51,7 @@ * 创建网格图层或者社区图层ServiceFeatureTable */ public static ServiceFeatureTable createGridFeatureTable() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ServiceFeatureTable("/"); @@ -68,7 +68,7 @@ * 创建其他图层ServiceFeatureTable */ public static ServiceFeatureTable createOtherFeatureTable(String layerName) { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ServiceFeatureTable("/"); @@ -92,8 +92,8 @@ /** * http://111.198.10.15:13002/arcgis/rest/services/crbjfc/FeatureServer/33 * */ - String toiletLayerID = StringHelper.getToiletLayerID(); - featureTable = new ServiceFeatureTable(baseGisUrl + LocaleConstant.TOILET_SERVICE_URL + "/" + toiletLayerID); + String toiletLayerId = StringHelper.getToiletLayerId(); + featureTable = new ServiceFeatureTable(baseGisUrl + LocaleConstant.TOILET_SERVICE_URL + "/" + toiletLayerId); break; default: throw new IllegalStateException("Unexpected value: " + layerName); diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java index 8c855cd..e4a3191 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java @@ -15,9 +15,9 @@ import com.casic.dcms.adapter.SwipeViewAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.FragmentNoticeBinding; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; import com.casic.dcms.utils.LocaleConstant; @@ -36,9 +36,9 @@ private static final String TAG = "NoticePageFragment"; private static WeakReferenceHandler weakReferenceHandler; private Context context; - private NoticeBeanDao noticeBeanDao; + private NoticeLocaleBeanDao noticeBeanDao; private SwipeViewAdapter swipeViewAdapter; - private List noticeBeans = new ArrayList<>(); + private List noticeBeans = new ArrayList<>(); @Override protected void setupTopBarLayout() { @@ -49,14 +49,14 @@ protected void initData() { swipeViewAdapter = new SwipeViewAdapter(context); //根据loginName加载历史数据 - String account = StringHelper.getUserAccount(); + String account = StringHelper.getUserBean().getAccount(); if (TextUtils.isEmpty(account)) { return; } - noticeBeanDao = BaseApplication.getDaoSession().getNoticeBeanDao(); + noticeBeanDao = BaseApplication.getDaoSession().getNoticeLocaleBeanDao(); noticeBeans = noticeBeanDao.queryBuilder() - .where(NoticeBeanDao.Properties.UserAccount.eq(account)) - .orderDesc(NoticeBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 + .where(NoticeLocaleBeanDao.Properties.UserAccount.eq(account)) + .orderDesc(NoticeLocaleBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 .list(); swipeViewAdapter.setData(noticeBeans); weakReferenceHandler = new WeakReferenceHandler(this); @@ -108,7 +108,7 @@ MainActivity.sendEmptyMessage(LocaleConstant.MESSAGE_NUMBER); //点击之后之后,未读消息变为已读消息 - NoticeBean noticeBean = noticeBeans.get(position); + NoticeLocaleBean noticeBean = noticeBeans.get(position); noticeBean.setIsRead("0"); noticeBeanDao.update(noticeBean); swipeViewAdapter.notifyDataSetChanged(); @@ -132,9 +132,9 @@ NoticePageFragment noticePageFragment; try { noticePageFragment = reference.get(); - List noticeBeans = noticePageFragment.noticeBeans; + List noticeBeans = noticePageFragment.noticeBeans; if (msg.what == LocaleConstant.PUSH_MESSAGE_DATA) { - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; Log.d(TAG, "收到推送消息,更新列表: " + noticeBean.getCaseId()); noticeBeans.add(0, noticeBean); //新消息永远放到第一个 //更新数据 @@ -147,9 +147,6 @@ } - /** - * 供{@link com.casic.dcms.service.GeTuiIntentService.onReceiveMessageData}调用 - */ public static void sendMessage(Message msg) { if (weakReferenceHandler == null) { return; diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java index a2034fe..f578afc 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java @@ -2,7 +2,7 @@ import androidx.lifecycle.MutableLiveData; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -19,7 +19,7 @@ public class MapConfigViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData mapConfigModel = new MutableLiveData<>(); + public MutableLiveData mapConfigModel = new MutableLiveData<>(); public void obtainMapConfig() { Observable observable = RetrofitServiceManager.getMapConfig(); @@ -40,7 +40,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - MapConfigBean configBean = gson.fromJson(response, new TypeToken() { + MapConfigModel configBean = gson.fromJson(response, new TypeToken() { }.getType()); mapConfigModel.setValue(configBean); } else { diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java index c415b6c..016f52b 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java @@ -4,7 +4,7 @@ import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.CleanRecordBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -21,7 +21,7 @@ public class ToiletViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData toiletListModel = new MutableLiveData<>(); + public MutableLiveData toiletListModel = new MutableLiveData<>(); public MutableLiveData cleanToiletModel = new MutableLiveData<>(); public MutableLiveData cleanRecordModel = new MutableLiveData<>(); @@ -44,7 +44,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - ToiletListBean listBean = gson.fromJson(response, new TypeToken() { + ToiletListModel listBean = gson.fromJson(response, new TypeToken() { }.getType()); toiletListModel.setValue(listBean); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java index ce0c065..f4c85ca 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java @@ -65,7 +65,7 @@ loadState.setValue(LoadState.Loading); //改为上传带水印的图片 Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); - ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserAccount(), + ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserBean().getAccount(), TimeOrDateUtil.timestampToDate(System.currentTimeMillis()), TimeOrDateUtil.timestampToTime(System.currentTimeMillis()), new IWaterMarkAddListener() { diff --git a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java index 9b38cdd..18b9cdd 100644 --- a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java +++ b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java @@ -7,7 +7,7 @@ import android.util.Log; import com.casic.dcms.base.BaseApplication; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.mvvm.model.PushResultBean; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; @@ -51,8 +51,8 @@ String messageContent = new String(msg.getPayload()); PushResultBean resultBean = gson.fromJson(messageContent, new TypeToken() { }.getType()); - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setUserAccount(StringHelper.getUserAccount()); + NoticeLocaleBean noticeBean = new NoticeLocaleBean(); + noticeBean.setUserAccount(StringHelper.getUserBean().getAccount()); noticeBean.setCaseId(resultBean.getData().getId()); noticeBean.setTitle(resultBean.getTitle()); noticeBean.setContent(resultBean.getContent()); @@ -61,7 +61,7 @@ noticeBean.setIsRead("1"); //存本地一份 - BaseApplication.getDaoSession().getNoticeBeanDao().insert(noticeBean); + BaseApplication.getDaoSession().getNoticeLocaleBeanDao().insert(noticeBean); //创建通知栏 Message msgNotice = Message.obtain(); diff --git a/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java b/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java index 3613fa8..be79c4e 100644 --- a/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java +++ b/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java @@ -2,7 +2,7 @@ import android.util.Log; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.esri.arcgisruntime.data.ServiceFeatureTable; import com.esri.arcgisruntime.layers.ArcGISTiledLayer; @@ -16,7 +16,7 @@ * 创建带网格的ArcGIS底图 */ public static ArcGISTiledLayer createBaseLayer() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ArcGISTiledLayer("/"); @@ -34,7 +34,7 @@ * 创建不带网格的ArcGIS底图 */ public static ArcGISTiledLayer createNoGridLayer() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ArcGISTiledLayer("/"); @@ -51,7 +51,7 @@ * 创建网格图层或者社区图层ServiceFeatureTable */ public static ServiceFeatureTable createGridFeatureTable() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ServiceFeatureTable("/"); @@ -68,7 +68,7 @@ * 创建其他图层ServiceFeatureTable */ public static ServiceFeatureTable createOtherFeatureTable(String layerName) { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ServiceFeatureTable("/"); @@ -92,8 +92,8 @@ /** * http://111.198.10.15:13002/arcgis/rest/services/crbjfc/FeatureServer/33 * */ - String toiletLayerID = StringHelper.getToiletLayerID(); - featureTable = new ServiceFeatureTable(baseGisUrl + LocaleConstant.TOILET_SERVICE_URL + "/" + toiletLayerID); + String toiletLayerId = StringHelper.getToiletLayerId(); + featureTable = new ServiceFeatureTable(baseGisUrl + LocaleConstant.TOILET_SERVICE_URL + "/" + toiletLayerId); break; default: throw new IllegalStateException("Unexpected value: " + layerName); diff --git a/app/src/main/java/com/casic/dcms/utils/DataBaseManager.java b/app/src/main/java/com/casic/dcms/utils/DataBaseManager.java new file mode 100644 index 0000000..98e8df8 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/utils/DataBaseManager.java @@ -0,0 +1,120 @@ +package com.casic.dcms.utils; + +import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.ToiletListBean; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; + +import java.util.ArrayList; +import java.util.List; + +public class DataBaseManager { + private static DataBaseManager instance; + + private DataBaseManager() { + } + + /** + * 双重锁单例 + */ + public static DataBaseManager getInstance() { + if (instance == null) { + synchronized (BaseApplication.class) { + if (instance == null) { + instance = new DataBaseManager(); + } + } + } + return instance; + } + + private final MapConfigBeanDao mapConfigBeanDao = BaseApplication.getDaoSession().getMapConfigBeanDao(); + private final ToiletListBeanDao toiletListBeanDao = BaseApplication.getDaoSession().getToiletListBeanDao(); + + /***路灯本地数据管理************************************************************/ + + /***通知本地数据管理************************************************************/ + + /***地图本地数据管理************************************************************/ + public void deleteAllMapConfig() { + mapConfigBeanDao.deleteAll(); + } + + public void saveMapConfig(MapConfigModel.DataBean.RowsBean rowsBean) { + MapConfigBean mapConfigBean = new MapConfigBean(); + mapConfigBean.setMapId(rowsBean.getId()); + mapConfigBean.setName(rowsBean.getName()); + mapConfigBean.setUrl(rowsBean.getUrl()); + mapConfigBeanDao.save(mapConfigBean); + } + + public List getMapConfigList() { + List result = new ArrayList<>(); + List configBeans = mapConfigBeanDao.loadAll(); + for (MapConfigBean configBean : configBeans) { + MapConfigModel.DataBean.RowsBean rowsBean = new MapConfigModel.DataBean.RowsBean(); + rowsBean.setId(configBean.getMapId()); + rowsBean.setName(configBean.getName()); + rowsBean.setUrl(configBean.getUrl()); + result.add(rowsBean); + } + return result; + } + + /***公厕本地数据管理************************************************************/ + public void deleteAllToiletList() { + toiletListBeanDao.deleteAll(); + } + + public void saveToiletList(ToiletListModel.DataBean dataBean) { + ToiletListBean bean = new ToiletListBean(); + bean.setArea(dataBean.getArea()); + bean.setCode(dataBean.getCode()); + bean.setCreateTime(dataBean.getCreateTime()); + bean.setDelFlag(dataBean.getDelFlag()); + bean.setDeptId(dataBean.getDeptId()); + bean.setToiletId(dataBean.getId()); + bean.setLat(dataBean.getLat()); + bean.setLng(dataBean.getLng()); + bean.setName(dataBean.getName()); + bean.setNotes(dataBean.getNotes()); + bean.setOwner(dataBean.getOwner()); + bean.setPhoto(dataBean.getPhoto()); + bean.setPosition(dataBean.getPosition()); + bean.setResponsiblePerson(dataBean.getResponsiblePerson()); + bean.setResponsiblePersonTel(dataBean.getResponsiblePersonTel()); + bean.setTs(dataBean.getTs()); + bean.setUpdateTime(dataBean.getUpdateTime()); + toiletListBeanDao.save(bean); + } + + public List getToiletList() { + List result = new ArrayList<>(); + List listBeans = toiletListBeanDao.loadAll(); + for (ToiletListBean toiletBean : listBeans) { + ToiletListModel.DataBean dataBean = new ToiletListModel.DataBean(); + dataBean.setArea(toiletBean.getArea()); + dataBean.setCode(toiletBean.getCode()); + dataBean.setCreateTime(toiletBean.getCreateTime()); + dataBean.setDelFlag(toiletBean.getDelFlag()); + dataBean.setDeptId(toiletBean.getDeptId()); + dataBean.setId(toiletBean.getToiletId()); + dataBean.setLat(toiletBean.getLat()); + dataBean.setLng(toiletBean.getLng()); + dataBean.setName(toiletBean.getName()); + dataBean.setNotes(toiletBean.getNotes()); + dataBean.setOwner(toiletBean.getOwner()); + dataBean.setPhoto(toiletBean.getPhoto()); + dataBean.setPosition(toiletBean.getPosition()); + dataBean.setResponsiblePerson(toiletBean.getResponsiblePerson()); + dataBean.setResponsiblePersonTel(toiletBean.getResponsiblePersonTel()); + dataBean.setTs(toiletBean.getTs()); + dataBean.setUpdateTime(toiletBean.getUpdateTime()); + result.add(dataBean); + } + return result; + } +} diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java index 8c855cd..e4a3191 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java @@ -15,9 +15,9 @@ import com.casic.dcms.adapter.SwipeViewAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.FragmentNoticeBinding; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; import com.casic.dcms.utils.LocaleConstant; @@ -36,9 +36,9 @@ private static final String TAG = "NoticePageFragment"; private static WeakReferenceHandler weakReferenceHandler; private Context context; - private NoticeBeanDao noticeBeanDao; + private NoticeLocaleBeanDao noticeBeanDao; private SwipeViewAdapter swipeViewAdapter; - private List noticeBeans = new ArrayList<>(); + private List noticeBeans = new ArrayList<>(); @Override protected void setupTopBarLayout() { @@ -49,14 +49,14 @@ protected void initData() { swipeViewAdapter = new SwipeViewAdapter(context); //根据loginName加载历史数据 - String account = StringHelper.getUserAccount(); + String account = StringHelper.getUserBean().getAccount(); if (TextUtils.isEmpty(account)) { return; } - noticeBeanDao = BaseApplication.getDaoSession().getNoticeBeanDao(); + noticeBeanDao = BaseApplication.getDaoSession().getNoticeLocaleBeanDao(); noticeBeans = noticeBeanDao.queryBuilder() - .where(NoticeBeanDao.Properties.UserAccount.eq(account)) - .orderDesc(NoticeBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 + .where(NoticeLocaleBeanDao.Properties.UserAccount.eq(account)) + .orderDesc(NoticeLocaleBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 .list(); swipeViewAdapter.setData(noticeBeans); weakReferenceHandler = new WeakReferenceHandler(this); @@ -108,7 +108,7 @@ MainActivity.sendEmptyMessage(LocaleConstant.MESSAGE_NUMBER); //点击之后之后,未读消息变为已读消息 - NoticeBean noticeBean = noticeBeans.get(position); + NoticeLocaleBean noticeBean = noticeBeans.get(position); noticeBean.setIsRead("0"); noticeBeanDao.update(noticeBean); swipeViewAdapter.notifyDataSetChanged(); @@ -132,9 +132,9 @@ NoticePageFragment noticePageFragment; try { noticePageFragment = reference.get(); - List noticeBeans = noticePageFragment.noticeBeans; + List noticeBeans = noticePageFragment.noticeBeans; if (msg.what == LocaleConstant.PUSH_MESSAGE_DATA) { - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; Log.d(TAG, "收到推送消息,更新列表: " + noticeBean.getCaseId()); noticeBeans.add(0, noticeBean); //新消息永远放到第一个 //更新数据 @@ -147,9 +147,6 @@ } - /** - * 供{@link com.casic.dcms.service.GeTuiIntentService.onReceiveMessageData}调用 - */ public static void sendMessage(Message msg) { if (weakReferenceHandler == null) { return; diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java index a2034fe..f578afc 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java @@ -2,7 +2,7 @@ import androidx.lifecycle.MutableLiveData; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -19,7 +19,7 @@ public class MapConfigViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData mapConfigModel = new MutableLiveData<>(); + public MutableLiveData mapConfigModel = new MutableLiveData<>(); public void obtainMapConfig() { Observable observable = RetrofitServiceManager.getMapConfig(); @@ -40,7 +40,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - MapConfigBean configBean = gson.fromJson(response, new TypeToken() { + MapConfigModel configBean = gson.fromJson(response, new TypeToken() { }.getType()); mapConfigModel.setValue(configBean); } else { diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java index c415b6c..016f52b 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java @@ -4,7 +4,7 @@ import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.CleanRecordBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -21,7 +21,7 @@ public class ToiletViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData toiletListModel = new MutableLiveData<>(); + public MutableLiveData toiletListModel = new MutableLiveData<>(); public MutableLiveData cleanToiletModel = new MutableLiveData<>(); public MutableLiveData cleanRecordModel = new MutableLiveData<>(); @@ -44,7 +44,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - ToiletListBean listBean = gson.fromJson(response, new TypeToken() { + ToiletListModel listBean = gson.fromJson(response, new TypeToken() { }.getType()); toiletListModel.setValue(listBean); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java index ce0c065..f4c85ca 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java @@ -65,7 +65,7 @@ loadState.setValue(LoadState.Loading); //改为上传带水印的图片 Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); - ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserAccount(), + ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserBean().getAccount(), TimeOrDateUtil.timestampToDate(System.currentTimeMillis()), TimeOrDateUtil.timestampToTime(System.currentTimeMillis()), new IWaterMarkAddListener() { diff --git a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java index 9b38cdd..18b9cdd 100644 --- a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java +++ b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java @@ -7,7 +7,7 @@ import android.util.Log; import com.casic.dcms.base.BaseApplication; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.mvvm.model.PushResultBean; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; @@ -51,8 +51,8 @@ String messageContent = new String(msg.getPayload()); PushResultBean resultBean = gson.fromJson(messageContent, new TypeToken() { }.getType()); - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setUserAccount(StringHelper.getUserAccount()); + NoticeLocaleBean noticeBean = new NoticeLocaleBean(); + noticeBean.setUserAccount(StringHelper.getUserBean().getAccount()); noticeBean.setCaseId(resultBean.getData().getId()); noticeBean.setTitle(resultBean.getTitle()); noticeBean.setContent(resultBean.getContent()); @@ -61,7 +61,7 @@ noticeBean.setIsRead("1"); //存本地一份 - BaseApplication.getDaoSession().getNoticeBeanDao().insert(noticeBean); + BaseApplication.getDaoSession().getNoticeLocaleBeanDao().insert(noticeBean); //创建通知栏 Message msgNotice = Message.obtain(); diff --git a/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java b/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java index 3613fa8..be79c4e 100644 --- a/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java +++ b/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java @@ -2,7 +2,7 @@ import android.util.Log; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.esri.arcgisruntime.data.ServiceFeatureTable; import com.esri.arcgisruntime.layers.ArcGISTiledLayer; @@ -16,7 +16,7 @@ * 创建带网格的ArcGIS底图 */ public static ArcGISTiledLayer createBaseLayer() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ArcGISTiledLayer("/"); @@ -34,7 +34,7 @@ * 创建不带网格的ArcGIS底图 */ public static ArcGISTiledLayer createNoGridLayer() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ArcGISTiledLayer("/"); @@ -51,7 +51,7 @@ * 创建网格图层或者社区图层ServiceFeatureTable */ public static ServiceFeatureTable createGridFeatureTable() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ServiceFeatureTable("/"); @@ -68,7 +68,7 @@ * 创建其他图层ServiceFeatureTable */ public static ServiceFeatureTable createOtherFeatureTable(String layerName) { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ServiceFeatureTable("/"); @@ -92,8 +92,8 @@ /** * http://111.198.10.15:13002/arcgis/rest/services/crbjfc/FeatureServer/33 * */ - String toiletLayerID = StringHelper.getToiletLayerID(); - featureTable = new ServiceFeatureTable(baseGisUrl + LocaleConstant.TOILET_SERVICE_URL + "/" + toiletLayerID); + String toiletLayerId = StringHelper.getToiletLayerId(); + featureTable = new ServiceFeatureTable(baseGisUrl + LocaleConstant.TOILET_SERVICE_URL + "/" + toiletLayerId); break; default: throw new IllegalStateException("Unexpected value: " + layerName); diff --git a/app/src/main/java/com/casic/dcms/utils/DataBaseManager.java b/app/src/main/java/com/casic/dcms/utils/DataBaseManager.java new file mode 100644 index 0000000..98e8df8 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/utils/DataBaseManager.java @@ -0,0 +1,120 @@ +package com.casic.dcms.utils; + +import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.ToiletListBean; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; + +import java.util.ArrayList; +import java.util.List; + +public class DataBaseManager { + private static DataBaseManager instance; + + private DataBaseManager() { + } + + /** + * 双重锁单例 + */ + public static DataBaseManager getInstance() { + if (instance == null) { + synchronized (BaseApplication.class) { + if (instance == null) { + instance = new DataBaseManager(); + } + } + } + return instance; + } + + private final MapConfigBeanDao mapConfigBeanDao = BaseApplication.getDaoSession().getMapConfigBeanDao(); + private final ToiletListBeanDao toiletListBeanDao = BaseApplication.getDaoSession().getToiletListBeanDao(); + + /***路灯本地数据管理************************************************************/ + + /***通知本地数据管理************************************************************/ + + /***地图本地数据管理************************************************************/ + public void deleteAllMapConfig() { + mapConfigBeanDao.deleteAll(); + } + + public void saveMapConfig(MapConfigModel.DataBean.RowsBean rowsBean) { + MapConfigBean mapConfigBean = new MapConfigBean(); + mapConfigBean.setMapId(rowsBean.getId()); + mapConfigBean.setName(rowsBean.getName()); + mapConfigBean.setUrl(rowsBean.getUrl()); + mapConfigBeanDao.save(mapConfigBean); + } + + public List getMapConfigList() { + List result = new ArrayList<>(); + List configBeans = mapConfigBeanDao.loadAll(); + for (MapConfigBean configBean : configBeans) { + MapConfigModel.DataBean.RowsBean rowsBean = new MapConfigModel.DataBean.RowsBean(); + rowsBean.setId(configBean.getMapId()); + rowsBean.setName(configBean.getName()); + rowsBean.setUrl(configBean.getUrl()); + result.add(rowsBean); + } + return result; + } + + /***公厕本地数据管理************************************************************/ + public void deleteAllToiletList() { + toiletListBeanDao.deleteAll(); + } + + public void saveToiletList(ToiletListModel.DataBean dataBean) { + ToiletListBean bean = new ToiletListBean(); + bean.setArea(dataBean.getArea()); + bean.setCode(dataBean.getCode()); + bean.setCreateTime(dataBean.getCreateTime()); + bean.setDelFlag(dataBean.getDelFlag()); + bean.setDeptId(dataBean.getDeptId()); + bean.setToiletId(dataBean.getId()); + bean.setLat(dataBean.getLat()); + bean.setLng(dataBean.getLng()); + bean.setName(dataBean.getName()); + bean.setNotes(dataBean.getNotes()); + bean.setOwner(dataBean.getOwner()); + bean.setPhoto(dataBean.getPhoto()); + bean.setPosition(dataBean.getPosition()); + bean.setResponsiblePerson(dataBean.getResponsiblePerson()); + bean.setResponsiblePersonTel(dataBean.getResponsiblePersonTel()); + bean.setTs(dataBean.getTs()); + bean.setUpdateTime(dataBean.getUpdateTime()); + toiletListBeanDao.save(bean); + } + + public List getToiletList() { + List result = new ArrayList<>(); + List listBeans = toiletListBeanDao.loadAll(); + for (ToiletListBean toiletBean : listBeans) { + ToiletListModel.DataBean dataBean = new ToiletListModel.DataBean(); + dataBean.setArea(toiletBean.getArea()); + dataBean.setCode(toiletBean.getCode()); + dataBean.setCreateTime(toiletBean.getCreateTime()); + dataBean.setDelFlag(toiletBean.getDelFlag()); + dataBean.setDeptId(toiletBean.getDeptId()); + dataBean.setId(toiletBean.getToiletId()); + dataBean.setLat(toiletBean.getLat()); + dataBean.setLng(toiletBean.getLng()); + dataBean.setName(toiletBean.getName()); + dataBean.setNotes(toiletBean.getNotes()); + dataBean.setOwner(toiletBean.getOwner()); + dataBean.setPhoto(toiletBean.getPhoto()); + dataBean.setPosition(toiletBean.getPosition()); + dataBean.setResponsiblePerson(toiletBean.getResponsiblePerson()); + dataBean.setResponsiblePersonTel(toiletBean.getResponsiblePersonTel()); + dataBean.setTs(toiletBean.getTs()); + dataBean.setUpdateTime(toiletBean.getUpdateTime()); + result.add(dataBean); + } + return result; + } +} diff --git a/app/src/main/java/com/casic/dcms/utils/LocaleConstant.java b/app/src/main/java/com/casic/dcms/utils/LocaleConstant.java index e354c07..e7ace6d 100644 --- a/app/src/main/java/com/casic/dcms/utils/LocaleConstant.java +++ b/app/src/main/java/com/casic/dcms/utils/LocaleConstant.java @@ -42,9 +42,9 @@ public static final String USER_DETAIL_MODEL = "userDetailModel"; public static final String LAST_LOGIN = "lastLoginTime"; public static final String IP_KEY = "ip"; + public static final String TOILET_LAYER_ID = "toiletLayerId"; + public static final String BRIDGE_LIST = "projectBridges"; - public static final String MAP_CONFIG = "mapConfigs"; - public static final String TOILET_LIST = "toilets"; public static final long HALF_YEAR = 180 * 60 * 60 * 24 * 1000L; public static final long FIVE_YEARS = 5L * 365 * 60 * 60 * 24 * 1000L; diff --git a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java index bd3cf61..1a6291a 100644 --- a/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java +++ b/app/src/main/java/com/casic/dcms/adapter/SwipeViewAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.casic.dcms.R; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.qmuiteam.qmui.recyclerView.QMUISwipeAction; import com.qmuiteam.qmui.recyclerView.QMUISwipeViewHolder; import com.qmuiteam.qmui.util.QMUIDisplayHelper; @@ -27,7 +27,7 @@ **/ public class SwipeViewAdapter extends RecyclerView.Adapter { - private final List mData = new ArrayList<>(); + private final List mData = new ArrayList<>(); private final QMUISwipeAction mDeleteAction; public SwipeViewAdapter(Context context) { @@ -38,7 +38,7 @@ mDeleteAction = builder.text("删除").backgroundColor(Color.RED).build(); } - public void setData(@Nullable List list) { + public void setData(@Nullable List list) { mData.clear(); if (list != null) { mData.addAll(list); @@ -67,7 +67,7 @@ TextView noticeContentView = holder.itemView.findViewById(R.id.noticeContentView); TextView messageTagView = holder.itemView.findViewById(R.id.messageTagView); - NoticeBean noticeBean = mData.get(position); + NoticeLocaleBean noticeBean = mData.get(position); noticeTitleView.setText(noticeBean.getTitle()); noticeDateView.setText(noticeBean.getPushDate()); noticeContentView.setText(noticeBean.getContent()); diff --git a/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java new file mode 100644 index 0000000..68f360b --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/LightLocalBean.java @@ -0,0 +1,134 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * 路灯数据本地持久化实体类 + */ +@Entity +public class LightLocalBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String controllerCode; + private String lampCode; + private String lampId; + private double latitude; + private String deptId; + private String statusName; + private String lampName; + private String latestTime; + private double longitude; + private String status; + + @Generated(hash = 58218675) + public LightLocalBean(Long id, String controllerCode, String lampCode, + String lampId, double latitude, String deptId, String statusName, + String lampName, String latestTime, double longitude, String status) { + this.id = id; + this.controllerCode = controllerCode; + this.lampCode = lampCode; + this.lampId = lampId; + this.latitude = latitude; + this.deptId = deptId; + this.statusName = statusName; + this.lampName = lampName; + this.latestTime = latestTime; + this.longitude = longitude; + this.status = status; + } + + @Generated(hash = 1396711556) + public LightLocalBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getControllerCode() { + return this.controllerCode; + } + + public void setControllerCode(String controllerCode) { + this.controllerCode = controllerCode; + } + + public String getLampCode() { + return this.lampCode; + } + + public void setLampCode(String lampCode) { + this.lampCode = lampCode; + } + + public String getLampId() { + return this.lampId; + } + + public void setLampId(String lampId) { + this.lampId = lampId; + } + + public double getLatitude() { + return this.latitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getStatusName() { + return this.statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public String getLampName() { + return this.lampName; + } + + public void setLampName(String lampName) { + this.lampName = lampName; + } + + public String getLatestTime() { + return this.latestTime; + } + + public void setLatestTime(String latestTime) { + this.latestTime = latestTime; + } + + public double getLongitude() { + return this.longitude; + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java new file mode 100644 index 0000000..b6cac3e --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/MapConfigBean.java @@ -0,0 +1,59 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class MapConfigBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String mapId; + private String name; + private String url; + + @Generated(hash = 591634130) + public MapConfigBean(Long id, String mapId, String name, String url) { + this.id = id; + this.mapId = mapId; + this.name = name; + this.url = url; + } + + @Generated(hash = 1957808406) + public MapConfigBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMapId() { + return this.mapId; + } + + public void setMapId(String mapId) { + this.mapId = mapId; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java new file mode 100644 index 0000000..b7ef824 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/NoticeLocaleBean.java @@ -0,0 +1,109 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +/** + * @author : Pengxh + * @time : 2021/4/15 10:03 + * @email : 290677893@qq.com + *

+ * 推送消息本地持久化,便于用户查看过往的消息 + **/ + +@Entity +public class NoticeLocaleBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String userAccount;//登录账户 + private String caseId;//案卷id + private String title;//案卷标题 + private String content;//案卷简介 + private String pushDate;//推送时间 + private String type;//推送类型 + private String isRead;//0-已读;1-未读 + + @Generated(hash = 1798907565) + public NoticeLocaleBean(Long id, String userAccount, String caseId, + String title, String content, String pushDate, String type, + String isRead) { + this.id = id; + this.userAccount = userAccount; + this.caseId = caseId; + this.title = title; + this.content = content; + this.pushDate = pushDate; + this.type = type; + this.isRead = isRead; + } + + @Generated(hash = 1054075554) + public NoticeLocaleBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserAccount() { + return this.userAccount; + } + + public void setUserAccount(String userAccount) { + this.userAccount = userAccount; + } + + public String getCaseId() { + return this.caseId; + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return this.content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getPushDate() { + return this.pushDate; + } + + public void setPushDate(String pushDate) { + this.pushDate = pushDate; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getIsRead() { + return this.isRead; + } + + public void setIsRead(String isRead) { + this.isRead = isRead; + } +} diff --git a/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java new file mode 100644 index 0000000..f8fb3e9 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/bean/ToiletListBean.java @@ -0,0 +1,203 @@ +package com.casic.dcms.bean; + +import org.greenrobot.greendao.annotation.Entity; +import org.greenrobot.greendao.annotation.Generated; +import org.greenrobot.greendao.annotation.Id; + +@Entity +public class ToiletListBean { + @Id(autoincrement = true) + private Long id;//主键ID + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String toiletId; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + @Generated(hash = 1727508285) + public ToiletListBean(Long id, String area, String code, String createTime, + String delFlag, String deptId, String toiletId, String lat, String lng, + String name, String notes, String owner, String photo, String position, + String responsiblePerson, String responsiblePersonTel, String ts, + String updateTime) { + this.id = id; + this.area = area; + this.code = code; + this.createTime = createTime; + this.delFlag = delFlag; + this.deptId = deptId; + this.toiletId = toiletId; + this.lat = lat; + this.lng = lng; + this.name = name; + this.notes = notes; + this.owner = owner; + this.photo = photo; + this.position = position; + this.responsiblePerson = responsiblePerson; + this.responsiblePersonTel = responsiblePersonTel; + this.ts = ts; + this.updateTime = updateTime; + } + + @Generated(hash = 2045884825) + public ToiletListBean() { + } + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getArea() { + return this.area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return this.createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return this.delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return this.deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getToiletId() { + return this.toiletId; + } + + public void setToiletId(String toiletId) { + this.toiletId = toiletId; + } + + public String getLat() { + return this.lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return this.lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return this.notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return this.position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return this.responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return this.responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return this.ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } +} diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java index daadd2e..cffd0b7 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoMaster.java @@ -21,14 +21,18 @@ /** Creates underlying database table using DAOs. */ public static void createAllTables(Database db, boolean ifNotExists) { - NoticeBeanDao.createTable(db, ifNotExists); - StreetLightLocalBeanDao.createTable(db, ifNotExists); + LightLocalBeanDao.createTable(db, ifNotExists); + MapConfigBeanDao.createTable(db, ifNotExists); + NoticeLocaleBeanDao.createTable(db, ifNotExists); + ToiletListBeanDao.createTable(db, ifNotExists); } /** Drops underlying database table using DAOs. */ public static void dropAllTables(Database db, boolean ifExists) { - NoticeBeanDao.dropTable(db, ifExists); - StreetLightLocalBeanDao.dropTable(db, ifExists); + LightLocalBeanDao.dropTable(db, ifExists); + MapConfigBeanDao.dropTable(db, ifExists); + NoticeLocaleBeanDao.dropTable(db, ifExists); + ToiletListBeanDao.dropTable(db, ifExists); } /** @@ -47,8 +51,10 @@ public DaoMaster(Database db) { super(db, SCHEMA_VERSION); - registerDaoClass(NoticeBeanDao.class); - registerDaoClass(StreetLightLocalBeanDao.class); + registerDaoClass(LightLocalBeanDao.class); + registerDaoClass(MapConfigBeanDao.class); + registerDaoClass(NoticeLocaleBeanDao.class); + registerDaoClass(ToiletListBeanDao.class); } public DaoSession newSession() { diff --git a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java index 6702d3e..5136f8f 100644 --- a/app/src/main/java/com/casic/dcms/greendao/DaoSession.java +++ b/app/src/main/java/com/casic/dcms/greendao/DaoSession.java @@ -8,11 +8,15 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.NoticeLocaleBean; +import com.casic.dcms.bean.ToiletListBean; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. @@ -23,40 +27,64 @@ */ public class DaoSession extends AbstractDaoSession { - private final DaoConfig noticeBeanDaoConfig; - private final DaoConfig streetLightLocalBeanDaoConfig; + private final DaoConfig lightLocalBeanDaoConfig; + private final DaoConfig mapConfigBeanDaoConfig; + private final DaoConfig noticeLocaleBeanDaoConfig; + private final DaoConfig toiletListBeanDaoConfig; - private final NoticeBeanDao noticeBeanDao; - private final StreetLightLocalBeanDao streetLightLocalBeanDao; + private final LightLocalBeanDao lightLocalBeanDao; + private final MapConfigBeanDao mapConfigBeanDao; + private final NoticeLocaleBeanDao noticeLocaleBeanDao; + private final ToiletListBeanDao toiletListBeanDao; public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> daoConfigMap) { super(db); - noticeBeanDaoConfig = daoConfigMap.get(NoticeBeanDao.class).clone(); - noticeBeanDaoConfig.initIdentityScope(type); + lightLocalBeanDaoConfig = daoConfigMap.get(LightLocalBeanDao.class).clone(); + lightLocalBeanDaoConfig.initIdentityScope(type); - streetLightLocalBeanDaoConfig = daoConfigMap.get(StreetLightLocalBeanDao.class).clone(); - streetLightLocalBeanDaoConfig.initIdentityScope(type); + mapConfigBeanDaoConfig = daoConfigMap.get(MapConfigBeanDao.class).clone(); + mapConfigBeanDaoConfig.initIdentityScope(type); - noticeBeanDao = new NoticeBeanDao(noticeBeanDaoConfig, this); - streetLightLocalBeanDao = new StreetLightLocalBeanDao(streetLightLocalBeanDaoConfig, this); + noticeLocaleBeanDaoConfig = daoConfigMap.get(NoticeLocaleBeanDao.class).clone(); + noticeLocaleBeanDaoConfig.initIdentityScope(type); - registerDao(NoticeBean.class, noticeBeanDao); - registerDao(StreetLightLocalBean.class, streetLightLocalBeanDao); + toiletListBeanDaoConfig = daoConfigMap.get(ToiletListBeanDao.class).clone(); + toiletListBeanDaoConfig.initIdentityScope(type); + + lightLocalBeanDao = new LightLocalBeanDao(lightLocalBeanDaoConfig, this); + mapConfigBeanDao = new MapConfigBeanDao(mapConfigBeanDaoConfig, this); + noticeLocaleBeanDao = new NoticeLocaleBeanDao(noticeLocaleBeanDaoConfig, this); + toiletListBeanDao = new ToiletListBeanDao(toiletListBeanDaoConfig, this); + + registerDao(LightLocalBean.class, lightLocalBeanDao); + registerDao(MapConfigBean.class, mapConfigBeanDao); + registerDao(NoticeLocaleBean.class, noticeLocaleBeanDao); + registerDao(ToiletListBean.class, toiletListBeanDao); } public void clear() { - noticeBeanDaoConfig.clearIdentityScope(); - streetLightLocalBeanDaoConfig.clearIdentityScope(); + lightLocalBeanDaoConfig.clearIdentityScope(); + mapConfigBeanDaoConfig.clearIdentityScope(); + noticeLocaleBeanDaoConfig.clearIdentityScope(); + toiletListBeanDaoConfig.clearIdentityScope(); } - public NoticeBeanDao getNoticeBeanDao() { - return noticeBeanDao; + public LightLocalBeanDao getLightLocalBeanDao() { + return lightLocalBeanDao; } - public StreetLightLocalBeanDao getStreetLightLocalBeanDao() { - return streetLightLocalBeanDao; + public MapConfigBeanDao getMapConfigBeanDao() { + return mapConfigBeanDao; + } + + public NoticeLocaleBeanDao getNoticeLocaleBeanDao() { + return noticeLocaleBeanDao; + } + + public ToiletListBeanDao getToiletListBeanDao() { + return toiletListBeanDao; } } diff --git a/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java new file mode 100644 index 0000000..571ff40 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/LightLocalBeanDao.java @@ -0,0 +1,239 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.LightLocalBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "LIGHT_LOCAL_BEAN". +*/ +public class LightLocalBeanDao extends AbstractDao { + + public static final String TABLENAME = "LIGHT_LOCAL_BEAN"; + + /** + * Properties of entity LightLocalBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); + public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); + public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); + public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); + public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); + public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); + public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); + public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); + } + + + public LightLocalBeanDao(DaoConfig config) { + super(config); + } + + public LightLocalBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"LIGHT_LOCAL_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode + "\"LAMP_CODE\" TEXT," + // 2: lampCode + "\"LAMP_ID\" TEXT," + // 3: lampId + "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"STATUS_NAME\" TEXT," + // 6: statusName + "\"LAMP_NAME\" TEXT," + // 7: lampName + "\"LATEST_TIME\" TEXT," + // 8: latestTime + "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude + "\"STATUS\" TEXT);"); // 10: status + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LIGHT_LOCAL_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, LightLocalBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String controllerCode = entity.getControllerCode(); + if (controllerCode != null) { + stmt.bindString(2, controllerCode); + } + + String lampCode = entity.getLampCode(); + if (lampCode != null) { + stmt.bindString(3, lampCode); + } + + String lampId = entity.getLampId(); + if (lampId != null) { + stmt.bindString(4, lampId); + } + stmt.bindDouble(5, entity.getLatitude()); + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String statusName = entity.getStatusName(); + if (statusName != null) { + stmt.bindString(7, statusName); + } + + String lampName = entity.getLampName(); + if (lampName != null) { + stmt.bindString(8, lampName); + } + + String latestTime = entity.getLatestTime(); + if (latestTime != null) { + stmt.bindString(9, latestTime); + } + stmt.bindDouble(10, entity.getLongitude()); + + String status = entity.getStatus(); + if (status != null) { + stmt.bindString(11, status); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public LightLocalBean readEntity(Cursor cursor, int offset) { + LightLocalBean entity = new LightLocalBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId + cursor.getDouble(offset + 4), // latitude + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime + cursor.getDouble(offset + 9), // longitude + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, LightLocalBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setLatitude(cursor.getDouble(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setLongitude(cursor.getDouble(offset + 9)); + entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + } + + @Override + protected final Long updateKeyAfterInsert(LightLocalBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(LightLocalBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(LightLocalBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java new file mode 100644 index 0000000..4d8a892 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/MapConfigBeanDao.java @@ -0,0 +1,157 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.MapConfigBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "MAP_CONFIG_BEAN". +*/ +public class MapConfigBeanDao extends AbstractDao { + + public static final String TABLENAME = "MAP_CONFIG_BEAN"; + + /** + * Properties of entity MapConfigBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property MapId = new Property(1, String.class, "mapId", false, "MAP_ID"); + public final static Property Name = new Property(2, String.class, "name", false, "NAME"); + public final static Property Url = new Property(3, String.class, "url", false, "URL"); + } + + + public MapConfigBeanDao(DaoConfig config) { + super(config); + } + + public MapConfigBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"MAP_CONFIG_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"MAP_ID\" TEXT," + // 1: mapId + "\"NAME\" TEXT," + // 2: name + "\"URL\" TEXT);"); // 3: url + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MAP_CONFIG_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, MapConfigBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String mapId = entity.getMapId(); + if (mapId != null) { + stmt.bindString(2, mapId); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(3, name); + } + + String url = entity.getUrl(); + if (url != null) { + stmt.bindString(4, url); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public MapConfigBean readEntity(Cursor cursor, int offset) { + MapConfigBean entity = new MapConfigBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // mapId + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // name + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // url + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, MapConfigBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setMapId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setUrl(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + } + + @Override + protected final Long updateKeyAfterInsert(MapConfigBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(MapConfigBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(MapConfigBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java deleted file mode 100644 index 9a31f06..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/NoticeBeanDao.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.NoticeBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "NOTICE_BEAN". -*/ -public class NoticeBeanDao extends AbstractDao { - - public static final String TABLENAME = "NOTICE_BEAN"; - - /** - * Properties of entity NoticeBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); - public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); - public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); - public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); - public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); - public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); - public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); - } - - - public NoticeBeanDao(DaoConfig config) { - super(config); - } - - public NoticeBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"USER_ACCOUNT\" TEXT," + // 1: userAccount - "\"CASE_ID\" TEXT," + // 2: caseId - "\"TITLE\" TEXT," + // 3: title - "\"CONTENT\" TEXT," + // 4: content - "\"PUSH_DATE\" TEXT," + // 5: pushDate - "\"TYPE\" TEXT," + // 6: type - "\"IS_READ\" TEXT);"); // 7: isRead - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, NoticeBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String userAccount = entity.getUserAccount(); - if (userAccount != null) { - stmt.bindString(2, userAccount); - } - - String caseId = entity.getCaseId(); - if (caseId != null) { - stmt.bindString(3, caseId); - } - - String title = entity.getTitle(); - if (title != null) { - stmt.bindString(4, title); - } - - String content = entity.getContent(); - if (content != null) { - stmt.bindString(5, content); - } - - String pushDate = entity.getPushDate(); - if (pushDate != null) { - stmt.bindString(6, pushDate); - } - - String type = entity.getType(); - if (type != null) { - stmt.bindString(7, type); - } - - String isRead = entity.getIsRead(); - if (isRead != null) { - stmt.bindString(8, isRead); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public NoticeBean readEntity(Cursor cursor, int offset) { - NoticeBean entity = new NoticeBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title - cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, NoticeBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); - entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - } - - @Override - protected final Long updateKeyAfterInsert(NoticeBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(NoticeBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(NoticeBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java new file mode 100644 index 0000000..e8079d7 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/NoticeLocaleBeanDao.java @@ -0,0 +1,213 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.NoticeLocaleBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "NOTICE_LOCALE_BEAN". +*/ +public class NoticeLocaleBeanDao extends AbstractDao { + + public static final String TABLENAME = "NOTICE_LOCALE_BEAN"; + + /** + * Properties of entity NoticeLocaleBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property UserAccount = new Property(1, String.class, "userAccount", false, "USER_ACCOUNT"); + public final static Property CaseId = new Property(2, String.class, "caseId", false, "CASE_ID"); + public final static Property Title = new Property(3, String.class, "title", false, "TITLE"); + public final static Property Content = new Property(4, String.class, "content", false, "CONTENT"); + public final static Property PushDate = new Property(5, String.class, "pushDate", false, "PUSH_DATE"); + public final static Property Type = new Property(6, String.class, "type", false, "TYPE"); + public final static Property IsRead = new Property(7, String.class, "isRead", false, "IS_READ"); + } + + + public NoticeLocaleBeanDao(DaoConfig config) { + super(config); + } + + public NoticeLocaleBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"NOTICE_LOCALE_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"USER_ACCOUNT\" TEXT," + // 1: userAccount + "\"CASE_ID\" TEXT," + // 2: caseId + "\"TITLE\" TEXT," + // 3: title + "\"CONTENT\" TEXT," + // 4: content + "\"PUSH_DATE\" TEXT," + // 5: pushDate + "\"TYPE\" TEXT," + // 6: type + "\"IS_READ\" TEXT);"); // 7: isRead + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"NOTICE_LOCALE_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, NoticeLocaleBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String userAccount = entity.getUserAccount(); + if (userAccount != null) { + stmt.bindString(2, userAccount); + } + + String caseId = entity.getCaseId(); + if (caseId != null) { + stmt.bindString(3, caseId); + } + + String title = entity.getTitle(); + if (title != null) { + stmt.bindString(4, title); + } + + String content = entity.getContent(); + if (content != null) { + stmt.bindString(5, content); + } + + String pushDate = entity.getPushDate(); + if (pushDate != null) { + stmt.bindString(6, pushDate); + } + + String type = entity.getType(); + if (type != null) { + stmt.bindString(7, type); + } + + String isRead = entity.getIsRead(); + if (isRead != null) { + stmt.bindString(8, isRead); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public NoticeLocaleBean readEntity(Cursor cursor, int offset) { + NoticeLocaleBean entity = new NoticeLocaleBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userAccount + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // caseId + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // title + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // content + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // pushDate + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // type + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // isRead + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, NoticeLocaleBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setUserAccount(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCaseId(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setTitle(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setContent(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setPushDate(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setType(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setIsRead(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + } + + @Override + protected final Long updateKeyAfterInsert(NoticeLocaleBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(NoticeLocaleBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(NoticeLocaleBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java deleted file mode 100644 index 36cebb3..0000000 --- a/app/src/main/java/com/casic/dcms/greendao/StreetLightLocalBeanDao.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.casic.dcms.greendao; - -import android.database.Cursor; -import android.database.sqlite.SQLiteStatement; - -import org.greenrobot.greendao.AbstractDao; -import org.greenrobot.greendao.Property; -import org.greenrobot.greendao.internal.DaoConfig; -import org.greenrobot.greendao.database.Database; -import org.greenrobot.greendao.database.DatabaseStatement; - -import com.casic.dcms.mvvm.model.StreetLightLocalBean; - -// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. -/** - * DAO for table "STREET_LIGHT_LOCAL_BEAN". -*/ -public class StreetLightLocalBeanDao extends AbstractDao { - - public static final String TABLENAME = "STREET_LIGHT_LOCAL_BEAN"; - - /** - * Properties of entity StreetLightLocalBean.
- * Can be used for QueryBuilder and for referencing column names. - */ - public static class Properties { - public final static Property Id = new Property(0, Long.class, "id", true, "_id"); - public final static Property ControllerCode = new Property(1, String.class, "controllerCode", false, "CONTROLLER_CODE"); - public final static Property LampCode = new Property(2, String.class, "lampCode", false, "LAMP_CODE"); - public final static Property LampId = new Property(3, String.class, "lampId", false, "LAMP_ID"); - public final static Property Latitude = new Property(4, double.class, "latitude", false, "LATITUDE"); - public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); - public final static Property StatusName = new Property(6, String.class, "statusName", false, "STATUS_NAME"); - public final static Property LampName = new Property(7, String.class, "lampName", false, "LAMP_NAME"); - public final static Property LatestTime = new Property(8, String.class, "latestTime", false, "LATEST_TIME"); - public final static Property Longitude = new Property(9, double.class, "longitude", false, "LONGITUDE"); - public final static Property Status = new Property(10, String.class, "status", false, "STATUS"); - } - - - public StreetLightLocalBeanDao(DaoConfig config) { - super(config); - } - - public StreetLightLocalBeanDao(DaoConfig config, DaoSession daoSession) { - super(config, daoSession); - } - - /** Creates the underlying database table. */ - public static void createTable(Database db, boolean ifNotExists) { - String constraint = ifNotExists? "IF NOT EXISTS ": ""; - db.execSQL("CREATE TABLE " + constraint + "\"STREET_LIGHT_LOCAL_BEAN\" (" + // - "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id - "\"CONTROLLER_CODE\" TEXT," + // 1: controllerCode - "\"LAMP_CODE\" TEXT," + // 2: lampCode - "\"LAMP_ID\" TEXT," + // 3: lampId - "\"LATITUDE\" REAL NOT NULL ," + // 4: latitude - "\"DEPT_ID\" TEXT," + // 5: deptId - "\"STATUS_NAME\" TEXT," + // 6: statusName - "\"LAMP_NAME\" TEXT," + // 7: lampName - "\"LATEST_TIME\" TEXT," + // 8: latestTime - "\"LONGITUDE\" REAL NOT NULL ," + // 9: longitude - "\"STATUS\" TEXT);"); // 10: status - } - - /** Drops the underlying database table. */ - public static void dropTable(Database db, boolean ifExists) { - String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"STREET_LIGHT_LOCAL_BEAN\""; - db.execSQL(sql); - } - - @Override - protected final void bindValues(DatabaseStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - protected final void bindValues(SQLiteStatement stmt, StreetLightLocalBean entity) { - stmt.clearBindings(); - - Long id = entity.getId(); - if (id != null) { - stmt.bindLong(1, id); - } - - String controllerCode = entity.getControllerCode(); - if (controllerCode != null) { - stmt.bindString(2, controllerCode); - } - - String lampCode = entity.getLampCode(); - if (lampCode != null) { - stmt.bindString(3, lampCode); - } - - String lampId = entity.getLampId(); - if (lampId != null) { - stmt.bindString(4, lampId); - } - stmt.bindDouble(5, entity.getLatitude()); - - String deptId = entity.getDeptId(); - if (deptId != null) { - stmt.bindString(6, deptId); - } - - String statusName = entity.getStatusName(); - if (statusName != null) { - stmt.bindString(7, statusName); - } - - String lampName = entity.getLampName(); - if (lampName != null) { - stmt.bindString(8, lampName); - } - - String latestTime = entity.getLatestTime(); - if (latestTime != null) { - stmt.bindString(9, latestTime); - } - stmt.bindDouble(10, entity.getLongitude()); - - String status = entity.getStatus(); - if (status != null) { - stmt.bindString(11, status); - } - } - - @Override - public Long readKey(Cursor cursor, int offset) { - return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); - } - - @Override - public StreetLightLocalBean readEntity(Cursor cursor, int offset) { - StreetLightLocalBean entity = new StreetLightLocalBean( // - cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id - cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // controllerCode - cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // lampCode - cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // lampId - cursor.getDouble(offset + 4), // latitude - cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId - cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // statusName - cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lampName - cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // latestTime - cursor.getDouble(offset + 9), // longitude - cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // status - ); - return entity; - } - - @Override - public void readEntity(Cursor cursor, StreetLightLocalBean entity, int offset) { - entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); - entity.setControllerCode(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); - entity.setLampCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); - entity.setLampId(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); - entity.setLatitude(cursor.getDouble(offset + 4)); - entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); - entity.setStatusName(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); - entity.setLampName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); - entity.setLatestTime(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); - entity.setLongitude(cursor.getDouble(offset + 9)); - entity.setStatus(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); - } - - @Override - protected final Long updateKeyAfterInsert(StreetLightLocalBean entity, long rowId) { - entity.setId(rowId); - return rowId; - } - - @Override - public Long getKey(StreetLightLocalBean entity) { - if(entity != null) { - return entity.getId(); - } else { - return null; - } - } - - @Override - public boolean hasKey(StreetLightLocalBean entity) { - return entity.getId() != null; - } - - @Override - protected final boolean isEntityUpdateable() { - return true; - } - -} diff --git a/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java new file mode 100644 index 0000000..c429b45 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/greendao/ToiletListBeanDao.java @@ -0,0 +1,353 @@ +package com.casic.dcms.greendao; + +import android.database.Cursor; +import android.database.sqlite.SQLiteStatement; + +import org.greenrobot.greendao.AbstractDao; +import org.greenrobot.greendao.Property; +import org.greenrobot.greendao.internal.DaoConfig; +import org.greenrobot.greendao.database.Database; +import org.greenrobot.greendao.database.DatabaseStatement; + +import com.casic.dcms.bean.ToiletListBean; + +// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. +/** + * DAO for table "TOILET_LIST_BEAN". +*/ +public class ToiletListBeanDao extends AbstractDao { + + public static final String TABLENAME = "TOILET_LIST_BEAN"; + + /** + * Properties of entity ToiletListBean.
+ * Can be used for QueryBuilder and for referencing column names. + */ + public static class Properties { + public final static Property Id = new Property(0, Long.class, "id", true, "_id"); + public final static Property Area = new Property(1, String.class, "area", false, "AREA"); + public final static Property Code = new Property(2, String.class, "code", false, "CODE"); + public final static Property CreateTime = new Property(3, String.class, "createTime", false, "CREATE_TIME"); + public final static Property DelFlag = new Property(4, String.class, "delFlag", false, "DEL_FLAG"); + public final static Property DeptId = new Property(5, String.class, "deptId", false, "DEPT_ID"); + public final static Property ToiletId = new Property(6, String.class, "toiletId", false, "TOILET_ID"); + public final static Property Lat = new Property(7, String.class, "lat", false, "LAT"); + public final static Property Lng = new Property(8, String.class, "lng", false, "LNG"); + public final static Property Name = new Property(9, String.class, "name", false, "NAME"); + public final static Property Notes = new Property(10, String.class, "notes", false, "NOTES"); + public final static Property Owner = new Property(11, String.class, "owner", false, "OWNER"); + public final static Property Photo = new Property(12, String.class, "photo", false, "PHOTO"); + public final static Property Position = new Property(13, String.class, "position", false, "POSITION"); + public final static Property ResponsiblePerson = new Property(14, String.class, "responsiblePerson", false, "RESPONSIBLE_PERSON"); + public final static Property ResponsiblePersonTel = new Property(15, String.class, "responsiblePersonTel", false, "RESPONSIBLE_PERSON_TEL"); + public final static Property Ts = new Property(16, String.class, "ts", false, "TS"); + public final static Property UpdateTime = new Property(17, String.class, "updateTime", false, "UPDATE_TIME"); + } + + + public ToiletListBeanDao(DaoConfig config) { + super(config); + } + + public ToiletListBeanDao(DaoConfig config, DaoSession daoSession) { + super(config, daoSession); + } + + /** Creates the underlying database table. */ + public static void createTable(Database db, boolean ifNotExists) { + String constraint = ifNotExists? "IF NOT EXISTS ": ""; + db.execSQL("CREATE TABLE " + constraint + "\"TOILET_LIST_BEAN\" (" + // + "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id + "\"AREA\" TEXT," + // 1: area + "\"CODE\" TEXT," + // 2: code + "\"CREATE_TIME\" TEXT," + // 3: createTime + "\"DEL_FLAG\" TEXT," + // 4: delFlag + "\"DEPT_ID\" TEXT," + // 5: deptId + "\"TOILET_ID\" TEXT," + // 6: toiletId + "\"LAT\" TEXT," + // 7: lat + "\"LNG\" TEXT," + // 8: lng + "\"NAME\" TEXT," + // 9: name + "\"NOTES\" TEXT," + // 10: notes + "\"OWNER\" TEXT," + // 11: owner + "\"PHOTO\" TEXT," + // 12: photo + "\"POSITION\" TEXT," + // 13: position + "\"RESPONSIBLE_PERSON\" TEXT," + // 14: responsiblePerson + "\"RESPONSIBLE_PERSON_TEL\" TEXT," + // 15: responsiblePersonTel + "\"TS\" TEXT," + // 16: ts + "\"UPDATE_TIME\" TEXT);"); // 17: updateTime + } + + /** Drops the underlying database table. */ + public static void dropTable(Database db, boolean ifExists) { + String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TOILET_LIST_BEAN\""; + db.execSQL(sql); + } + + @Override + protected final void bindValues(DatabaseStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + protected final void bindValues(SQLiteStatement stmt, ToiletListBean entity) { + stmt.clearBindings(); + + Long id = entity.getId(); + if (id != null) { + stmt.bindLong(1, id); + } + + String area = entity.getArea(); + if (area != null) { + stmt.bindString(2, area); + } + + String code = entity.getCode(); + if (code != null) { + stmt.bindString(3, code); + } + + String createTime = entity.getCreateTime(); + if (createTime != null) { + stmt.bindString(4, createTime); + } + + String delFlag = entity.getDelFlag(); + if (delFlag != null) { + stmt.bindString(5, delFlag); + } + + String deptId = entity.getDeptId(); + if (deptId != null) { + stmt.bindString(6, deptId); + } + + String toiletId = entity.getToiletId(); + if (toiletId != null) { + stmt.bindString(7, toiletId); + } + + String lat = entity.getLat(); + if (lat != null) { + stmt.bindString(8, lat); + } + + String lng = entity.getLng(); + if (lng != null) { + stmt.bindString(9, lng); + } + + String name = entity.getName(); + if (name != null) { + stmt.bindString(10, name); + } + + String notes = entity.getNotes(); + if (notes != null) { + stmt.bindString(11, notes); + } + + String owner = entity.getOwner(); + if (owner != null) { + stmt.bindString(12, owner); + } + + String photo = entity.getPhoto(); + if (photo != null) { + stmt.bindString(13, photo); + } + + String position = entity.getPosition(); + if (position != null) { + stmt.bindString(14, position); + } + + String responsiblePerson = entity.getResponsiblePerson(); + if (responsiblePerson != null) { + stmt.bindString(15, responsiblePerson); + } + + String responsiblePersonTel = entity.getResponsiblePersonTel(); + if (responsiblePersonTel != null) { + stmt.bindString(16, responsiblePersonTel); + } + + String ts = entity.getTs(); + if (ts != null) { + stmt.bindString(17, ts); + } + + String updateTime = entity.getUpdateTime(); + if (updateTime != null) { + stmt.bindString(18, updateTime); + } + } + + @Override + public Long readKey(Cursor cursor, int offset) { + return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); + } + + @Override + public ToiletListBean readEntity(Cursor cursor, int offset) { + ToiletListBean entity = new ToiletListBean( // + cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id + cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // area + cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // code + cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // createTime + cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // delFlag + cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // deptId + cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // toiletId + cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // lat + cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // lng + cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9), // name + cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10), // notes + cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11), // owner + cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12), // photo + cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13), // position + cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14), // responsiblePerson + cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15), // responsiblePersonTel + cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16), // ts + cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17) // updateTime + ); + return entity; + } + + @Override + public void readEntity(Cursor cursor, ToiletListBean entity, int offset) { + entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); + entity.setArea(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); + entity.setCode(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); + entity.setCreateTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); + entity.setDelFlag(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); + entity.setDeptId(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); + entity.setToiletId(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); + entity.setLat(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7)); + entity.setLng(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8)); + entity.setName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); + entity.setNotes(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); + entity.setOwner(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); + entity.setPhoto(cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); + entity.setPosition(cursor.isNull(offset + 13) ? null : cursor.getString(offset + 13)); + entity.setResponsiblePerson(cursor.isNull(offset + 14) ? null : cursor.getString(offset + 14)); + entity.setResponsiblePersonTel(cursor.isNull(offset + 15) ? null : cursor.getString(offset + 15)); + entity.setTs(cursor.isNull(offset + 16) ? null : cursor.getString(offset + 16)); + entity.setUpdateTime(cursor.isNull(offset + 17) ? null : cursor.getString(offset + 17)); + } + + @Override + protected final Long updateKeyAfterInsert(ToiletListBean entity, long rowId) { + entity.setId(rowId); + return rowId; + } + + @Override + public Long getKey(ToiletListBean entity) { + if(entity != null) { + return entity.getId(); + } else { + return null; + } + } + + @Override + public boolean hasKey(ToiletListBean entity) { + return entity.getId() != null; + } + + @Override + protected final boolean isEntityUpdateable() { + return true; + } + +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java deleted file mode 100644 index 4a78de6..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigBean.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class MapConfigBean { - - private int code; - private DataBean data; - private String message; - private boolean success; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public DataBean getData() { - return data; - } - - public void setData(DataBean data) { - this.data = data; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public static class DataBean { - - private int total; - private List rows; - - public int getTotal() { - return total; - } - - public void setTotal(int total) { - this.total = total; - } - - public List getRows() { - return rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public static class RowsBean { - /** - * id : 1 - * name : GIS地图 - * url : http://111.198.10.15:13002 - */ - - private String id; - private String name; - private String url; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java new file mode 100644 index 0000000..49e62d2 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/MapConfigModel.java @@ -0,0 +1,101 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class MapConfigModel { + + private int code; + private DataBean data; + private String message; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataBean getData() { + return data; + } + + public void setData(DataBean data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataBean { + + private int total; + private List rows; + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public static class RowsBean { + /** + * id : 1 + * name : GIS地图 + * url : http://111.198.10.15:13002 + */ + + private String id; + private String name; + private String url; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java deleted file mode 100644 index d96095a..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/NoticeBean.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * @author : Pengxh - * @time : 2021/4/15 10:03 - * @email : 290677893@qq.com - *

- * 推送消息本地持久化,便于用户查看过往的消息 - **/ - -@Entity -public class NoticeBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String userAccount;//登录账户 - private String caseId;//案卷id - private String title;//案卷标题 - private String content;//案卷简介 - private String pushDate;//推送时间 - private String type;//推送类型 - private String isRead;//0-已读;1-未读 - - @Generated(hash = 1022814061) - public NoticeBean(Long id, String userAccount, String caseId, String title, - String content, String pushDate, String type, String isRead) { - this.id = id; - this.userAccount = userAccount; - this.caseId = caseId; - this.title = title; - this.content = content; - this.pushDate = pushDate; - this.type = type; - this.isRead = isRead; - } - - @Generated(hash = 303198189) - public NoticeBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUserAccount() { - return this.userAccount; - } - - public void setUserAccount(String userAccount) { - this.userAccount = userAccount; - } - - public String getCaseId() { - return this.caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId; - } - - public String getTitle() { - return this.title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getPushDate() { - return this.pushDate; - } - - public void setPushDate(String pushDate) { - this.pushDate = pushDate; - } - - public String getType() { - return this.type; - } - - public void setType(String type) { - this.type = type; - } - - public String getIsRead() { - return this.isRead; - } - - public void setIsRead(String isRead) { - this.isRead = isRead; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java deleted file mode 100644 index 6179b8d..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/StreetLightLocalBean.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import org.greenrobot.greendao.annotation.Entity; -import org.greenrobot.greendao.annotation.Generated; -import org.greenrobot.greendao.annotation.Id; - -/** - * 路灯数据本地持久化实体类 - */ -@Entity -public class StreetLightLocalBean { - @Id(autoincrement = true) - private Long id;//主键ID - - private String controllerCode; - private String lampCode; - private String lampId; - private double latitude; - private String deptId; - private String statusName; - private String lampName; - private String latestTime; - private double longitude; - private String status; - - @Generated(hash = 1610766011) - public StreetLightLocalBean(Long id, String controllerCode, String lampCode, - String lampId, double latitude, String deptId, String statusName, - String lampName, String latestTime, double longitude, String status) { - this.id = id; - this.controllerCode = controllerCode; - this.lampCode = lampCode; - this.lampId = lampId; - this.latitude = latitude; - this.deptId = deptId; - this.statusName = statusName; - this.lampName = lampName; - this.latestTime = latestTime; - this.longitude = longitude; - this.status = status; - } - - @Generated(hash = 6875869) - public StreetLightLocalBean() { - } - - public Long getId() { - return this.id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getControllerCode() { - return this.controllerCode; - } - - public void setControllerCode(String controllerCode) { - this.controllerCode = controllerCode; - } - - public String getLampCode() { - return this.lampCode; - } - - public void setLampCode(String lampCode) { - this.lampCode = lampCode; - } - - public String getLampId() { - return this.lampId; - } - - public void setLampId(String lampId) { - this.lampId = lampId; - } - - public double getLatitude() { - return this.latitude; - } - - public void setLatitude(double latitude) { - this.latitude = latitude; - } - - public String getDeptId() { - return this.deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getStatusName() { - return this.statusName; - } - - public void setStatusName(String statusName) { - this.statusName = statusName; - } - - public String getLampName() { - return this.lampName; - } - - public void setLampName(String lampName) { - this.lampName = lampName; - } - - public String getLatestTime() { - return this.latestTime; - } - - public void setLatestTime(String latestTime) { - this.latestTime = latestTime; - } - - public double getLongitude() { - return this.longitude; - } - - public void setLongitude(double longitude) { - this.longitude = longitude; - } - - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java deleted file mode 100644 index 4bfa0ef..0000000 --- a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListBean.java +++ /dev/null @@ -1,219 +0,0 @@ -package com.casic.dcms.mvvm.model; - -import java.util.List; - -public class ToiletListBean { - - private int code; - private String message; - private boolean success; - private List data; - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public boolean isSuccess() { - return success; - } - - public void setSuccess(boolean success) { - this.success = success; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public static class DataBean { - /** - * area : 20.00 - * code : 3625250008 - * createTime : 2021-07-07 - * delFlag : 0 - * deptId : - * id : 1412675026622865410 - * lat : 27.77740600 - * lng : 116.05673800 - * name : 王泥岭公厕 - * notes : 无 - * owner : 环卫所 - * photo : - * position : 王泥岭 - * responsiblePerson : 张三 - * responsiblePersonTel : 13214521544 - * ts : 2021-01-12 - * updateTime : - */ - - private String area; - private String code; - private String createTime; - private String delFlag; - private String deptId; - private String id; - private String lat; - private String lng; - private String name; - private String notes; - private String owner; - private String photo; - private String position; - private String responsiblePerson; - private String responsiblePersonTel; - private String ts; - private String updateTime; - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area = area; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getCreateTime() { - return createTime; - } - - public void setCreateTime(String createTime) { - this.createTime = createTime; - } - - public String getDelFlag() { - return delFlag; - } - - public void setDelFlag(String delFlag) { - this.delFlag = delFlag; - } - - public String getDeptId() { - return deptId; - } - - public void setDeptId(String deptId) { - this.deptId = deptId; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getLat() { - return lat; - } - - public void setLat(String lat) { - this.lat = lat; - } - - public String getLng() { - return lng; - } - - public void setLng(String lng) { - this.lng = lng; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getPhoto() { - return photo; - } - - public void setPhoto(String photo) { - this.photo = photo; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public String getResponsiblePerson() { - return responsiblePerson; - } - - public void setResponsiblePerson(String responsiblePerson) { - this.responsiblePerson = responsiblePerson; - } - - public String getResponsiblePersonTel() { - return responsiblePersonTel; - } - - public void setResponsiblePersonTel(String responsiblePersonTel) { - this.responsiblePersonTel = responsiblePersonTel; - } - - public String getTs() { - return ts; - } - - public void setTs(String ts) { - this.ts = ts; - } - - public String getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(String updateTime) { - this.updateTime = updateTime; - } - } -} diff --git a/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java new file mode 100644 index 0000000..51e022a --- /dev/null +++ b/app/src/main/java/com/casic/dcms/mvvm/model/ToiletListModel.java @@ -0,0 +1,219 @@ +package com.casic.dcms.mvvm.model; + +import java.util.List; + +public class ToiletListModel { + + private int code; + private String message; + private boolean success; + private List data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * area : 20.00 + * code : 3625250008 + * createTime : 2021-07-07 + * delFlag : 0 + * deptId : + * id : 1412675026622865410 + * lat : 27.77740600 + * lng : 116.05673800 + * name : 王泥岭公厕 + * notes : 无 + * owner : 环卫所 + * photo : + * position : 王泥岭 + * responsiblePerson : 张三 + * responsiblePersonTel : 13214521544 + * ts : 2021-01-12 + * updateTime : + */ + + private String area; + private String code; + private String createTime; + private String delFlag; + private String deptId; + private String id; + private String lat; + private String lng; + private String name; + private String notes; + private String owner; + private String photo; + private String position; + private String responsiblePerson; + private String responsiblePersonTel; + private String ts; + private String updateTime; + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getDelFlag() { + return delFlag; + } + + public void setDelFlag(String delFlag) { + this.delFlag = delFlag; + } + + public String getDeptId() { + return deptId; + } + + public void setDeptId(String deptId) { + this.deptId = deptId; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLat() { + return lat; + } + + public void setLat(String lat) { + this.lat = lat; + } + + public String getLng() { + return lng; + } + + public void setLng(String lng) { + this.lng = lng; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNotes() { + return notes; + } + + public void setNotes(String notes) { + this.notes = notes; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getResponsiblePerson() { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) { + this.responsiblePerson = responsiblePerson; + } + + public String getResponsiblePersonTel() { + return responsiblePersonTel; + } + + public void setResponsiblePersonTel(String responsiblePersonTel) { + this.responsiblePersonTel = responsiblePersonTel; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } +} diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java index 0beda43..178f649 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/BridgeMaintainActivity.java @@ -107,7 +107,7 @@ String systemDate = TimeOrDateUtil.timestampToDate(System.currentTimeMillis()); viewBinding.maintainDateView.setText(systemDate); - viewBinding.liablePersonView.setText(StringHelper.getUserAccount()); + viewBinding.liablePersonView.setText(StringHelper.getUserBean().getAccount()); viewBinding.submitButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java index 39bb6fe..1834a99 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/MainActivity.java @@ -20,13 +20,13 @@ import com.casic.dcms.R; import com.casic.dcms.adapter.MainPageAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.ActivityMainBinding; -import com.casic.dcms.greendao.NoticeBeanDao; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.model.BridgeConfigBean; import com.casic.dcms.mvvm.model.LayerConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.NoticeBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.view.fragment.HomePageFragment; import com.casic.dcms.mvvm.view.fragment.MinePageFragment; import com.casic.dcms.mvvm.view.fragment.NoticePageFragment; @@ -36,6 +36,7 @@ import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.service.UploadLocationService; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.HttpRequestHelper; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; @@ -58,11 +59,11 @@ import okhttp3.ResponseBody; -//TODO 各个配置项需要后期调整,暂时先不修改 public class MainActivity extends AndroidxBaseActivity { private static final String TAG = "MainActivity"; private static WeakReferenceHandler weakReferenceHandler; + private DataBaseManager dataBaseManager; private final Gson gson = new Gson(); private final List pageViews = new ArrayList<>(); private MenuItem menuItem; @@ -92,6 +93,7 @@ //个推初始化 PushManager.getInstance().initialize(this); weakReferenceHandler = new WeakReferenceHandler(callback); + dataBaseManager = DataBaseManager.getInstance(); positionViewModel = new ViewModelProvider(this).get(UploadViewModel.class); pushViewModel = new ViewModelProvider(this).get(PushViewModel.class); @@ -113,16 +115,53 @@ private void obtainProjectConfig() { //地图配置项 mapConfigViewModel.obtainMapConfig(); - mapConfigViewModel.mapConfigModel.observe(this, new Observer() { + mapConfigViewModel.mapConfigModel.observe(this, new Observer() { @Override - public void onChanged(MapConfigBean resultBean) { + public void onChanged(MapConfigModel resultBean) { if (resultBean.getCode() == 200) { - StringHelper.saveMapConfigList(gson.toJson(resultBean.getData().getRows())); + dataBaseManager.deleteAllMapConfig(); + for (MapConfigModel.DataBean.RowsBean rowsBean : resultBean.getData().getRows()) { + dataBaseManager.saveMapConfig(rowsBean); + } } } }); - //桥梁数据 + //公厕数据 + toiletViewModel.obtainToiletList(); + toiletViewModel.toiletListModel.observe(this, new Observer() { + @Override + public void onChanged(ToiletListModel resultBean) { + if (resultBean.getCode() == 200) { + dataBaseManager.deleteAllToiletList(); + for (ToiletListModel.DataBean dataBean : resultBean.getData()) { + dataBaseManager.saveToiletList(dataBean); + } + } + } + }); + + //公厕图层ID + HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { + @Override + public void onSuccess(ResponseBody resultBean) { + try { + String resultStr = resultBean.string(); + List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); + List childrenBeans = partsLayer.get(2).getChildren(); + StringHelper.saveToiletLayerId(String.valueOf(childrenBeans.get(0).getLayer())); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Override + public void onFailure(Throwable throwable) { + + } + }); + + //桥梁数据 TODO-待调试 HttpRequestHelper.doRequest(LocaleConstant.PROJECT_CONFIG, new IHttpRequestListener() { @Override public void onSuccess(ResponseBody resultBean) { @@ -140,42 +179,12 @@ } }); - //公厕数据 - toiletViewModel.obtainToiletList(); - toiletViewModel.toiletListModel.observe(this, new Observer() { - @Override - public void onChanged(ToiletListBean resultBean) { - if (resultBean.getCode() == 200) { - StringHelper.saveToiletList(gson.toJson(resultBean.getData())); - } - } - }); - - //公厕图层ID - HttpRequestHelper.doRequest(LocaleConstant.LAYER_CONFIG, new IHttpRequestListener() { - @Override - public void onSuccess(ResponseBody resultBean) { - try { - String resultStr = resultBean.string(); - List partsLayer = gson.fromJson(resultStr, LayerConfigBean.class).getPartsLayer(); - List childrenBeans = partsLayer.get(2).getChildren(); - StringHelper.saveToiletLayerID(String.valueOf(childrenBeans.get(0).getLayer())); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Override - public void onFailure(Throwable throwable) { - - } - }); } @Override protected void initEvent() { MainPageAdapter mainPageAdapter = new MainPageAdapter(getSupportFragmentManager(), pageViews); - viewBinding.mainViewPager.setOffscreenPageLimit(4); + viewBinding.mainViewPager.setOffscreenPageLimit(pageViews.size()); viewBinding.mainViewPager.setAdapter(mainPageAdapter); viewBinding.bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() { @Override @@ -232,7 +241,7 @@ } catch (NullPointerException e) { e.printStackTrace(); } - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; NotificationHelper notificationHelper = NotificationHelper.getInstance(this); Notification notification = notificationHelper.createDefault( noticeBean.getTitle(), @@ -256,10 +265,10 @@ }; private void updateMessageNumber() { - List list = BaseApplication.getDaoSession() - .getNoticeBeanDao() + List list = BaseApplication.getDaoSession() + .getNoticeLocaleBeanDao() .queryBuilder() - .where(NoticeBeanDao.Properties.IsRead.eq("1")) + .where(NoticeLocaleBeanDao.Properties.IsRead.eq("1")) .list(); int size = list.size(); if (size <= 0) { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java index 8cf2530..f016ef4 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/PublicToiletActivity.java @@ -21,10 +21,11 @@ import com.casic.dcms.R; import com.casic.dcms.databinding.ActivityToiletBinding; import com.casic.dcms.mvvm.model.ActionResultBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.mvvm.vm.ToiletViewModel; import com.casic.dcms.mvvm.vm.UploadViewModel; import com.casic.dcms.utils.ArcGisMapCreator; +import com.casic.dcms.utils.DataBaseManager; import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.LocationHelper; import com.casic.dcms.utils.OtherUtils; @@ -149,14 +150,14 @@ viewBinding.obtainToiletIdLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - List toiletBeanList = StringHelper.getToiletBeanList(); + List toiletBeanList = DataBaseManager.getInstance().getToiletList(); if (toiletBeanList.size() == 0) { EasyToast.show(context, "获取公厕数据失败,请联系管理员"); return; } QMUIBottomSheet.BottomListSheetBuilder sheetBuilder = new QMUIBottomSheet.BottomListSheetBuilder(context); sheetBuilder.setTitle("请选择您要打卡的公厕"); - for (ToiletListBean.DataBean it : toiletBeanList) { + for (ToiletListModel.DataBean it : toiletBeanList) { sheetBuilder.addItem(it.getName()); } sheetBuilder.setGravityCenter(true).setOnSheetItemClickListener(new QMUIBottomSheet.BottomListSheetBuilder.OnSheetItemClickListener() { diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java index 16ee10d..8dcee84 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/HomePageFragment.java @@ -32,9 +32,8 @@ import com.casic.dcms.mvvm.view.VerifyCaseActivity; import com.casic.dcms.mvvm.vm.HomePageViewModel; import com.casic.dcms.utils.LocaleConstant; +import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.TimeOrDateUtil; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.utils.SaveKeyValues; @@ -67,27 +66,21 @@ } viewBinding.lastTimeView.setText(timeValue); //用户信息 - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - UserBean.DataBean userData = new Gson().fromJson(userDetailJson, - new TypeToken() { - }.getType() - ); - //获取用户信息之后保存登录时间 - SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); + UserBean.DataBean userBean = StringHelper.getUserBean(); + //获取用户信息之后保存登录时间 + SaveKeyValues.putValue(LocaleConstant.LAST_LOGIN, TimeOrDateUtil.timestampToCompleteDate(System.currentTimeMillis())); - GregorianCalendar calendar = new GregorianCalendar(); - int x = calendar.get(GregorianCalendar.AM_PM); - String timezone; - if (x == 0) { - timezone = "上午"; - } else { - timezone = "下午"; - } - Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); - viewBinding.userNameView.setText(timezone + "好!" + userData.getName()); - viewBinding.userDeptView.setText(userData.getDeptName() + userData.getRoleNames()); + GregorianCalendar calendar = new GregorianCalendar(); + int x = calendar.get(GregorianCalendar.AM_PM); + String timezone; + if (x == 0) { + timezone = "上午"; + } else { + timezone = "下午"; } + Glide.with(this).load(R.mipmap.app_logo).into(viewBinding.userIconView); + viewBinding.userNameView.setText(timezone + "好!" + userBean.getName()); + viewBinding.userDeptView.setText(userBean.getDeptName() + userBean.getRoleNames()); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java index 6ed58cd..197fef1 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/LightOnMapFragment.java @@ -19,10 +19,10 @@ import com.casic.dcms.R; import com.casic.dcms.base.BaseApplication; import com.casic.dcms.databinding.FragmentLightMapBinding; -import com.casic.dcms.greendao.StreetLightLocalBeanDao; +import com.casic.dcms.greendao.LightLocalBeanDao; import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.LightMapBean; -import com.casic.dcms.mvvm.model.StreetLightLocalBean; +import com.casic.dcms.bean.LightLocalBean; import com.casic.dcms.mvvm.vm.LightViewModel; import com.casic.dcms.utils.ArcGisMapCreator; import com.casic.dcms.utils.HttpRequestHelper; @@ -68,7 +68,7 @@ private ListenableList graphicsOverlays; private ListenableList graphics; private double DELTA_L = LocaleConstant.DELTA_LNG_75; - private StreetLightLocalBeanDao lightLocalBeanDao; + private LightLocalBeanDao lightLocalBeanDao; private WeakReferenceHandler weakReferenceHandler; @Override @@ -79,7 +79,7 @@ @Override protected void initData() { weakReferenceHandler = new WeakReferenceHandler(callback); - lightLocalBeanDao = BaseApplication.getDaoSession().getStreetLightLocalBeanDao(); + lightLocalBeanDao = BaseApplication.getDaoSession().getLightLocalBeanDao(); lightViewModel = new ViewModelProvider(this).get(LightViewModel.class); lightViewModel.obtainLightOnMap(); @@ -88,7 +88,7 @@ public void onChanged(LightMapBean resultBean) { if (resultBean.getCode() == 200) { for (LightMapBean.DataBean dataBean : resultBean.getData()) { - StreetLightLocalBean bean = new StreetLightLocalBean(); + LightLocalBean bean = new LightLocalBean(); bean.setControllerCode(dataBean.getControllerCode()); bean.setLampCode(dataBean.getLampCode()); String lampId = dataBean.getLampId(); @@ -101,8 +101,8 @@ bean.setLongitude(dataBean.getLongitude()); bean.setStatus(dataBean.getStatus()); - StreetLightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() - .where(StreetLightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); + LightLocalBean uniqueBean = lightLocalBeanDao.queryBuilder() + .where(LightLocalBeanDao.Properties.LampId.eq(lampId)).unique(); if (uniqueBean == null) { lightLocalBeanDao.insert(bean); } else { @@ -155,9 +155,9 @@ Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); viewBinding.mapView.setViewpointCenterAsync(point, 2800); - List streetLightBeans = lightLocalBeanDao.loadAll(); + List streetLightBeans = lightLocalBeanDao.loadAll(); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : streetLightBeans) { + for (LightLocalBean bean : streetLightBeans) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -207,7 +207,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List minusList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -251,7 +251,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List expandList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= DELTA_L && @@ -279,7 +279,7 @@ double[] gcjToWgs = LocationHelper.gcjToWgs(aMapLocation.getLongitude(), aMapLocation.getLatitude()); Point point = new Point(gcjToWgs[0], gcjToWgs[1], SpatialReference.create(4326)); List pointList = new ArrayList<>(); - for (StreetLightLocalBean bean : lightLocalBeanDao.loadAll()) { + for (LightLocalBean bean : lightLocalBeanDao.loadAll()) { double longitude = bean.getLongitude(); double latitude = bean.getLatitude(); if (Math.abs(longitude - gcjToWgs[0]) <= LocaleConstant.DELTA_LNG_75 && @@ -299,7 +299,7 @@ viewBinding.mapView.setOnTouchListener(new DefaultMapViewOnTouchListener(requireContext(), viewBinding.mapView) { @Override public boolean onSingleTapConfirmed(MotionEvent e) { - List lightBeans = lightLocalBeanDao.loadAll(); + List lightBeans = lightLocalBeanDao.loadAll(); android.graphics.Point screenPoint = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY())); final ListenableFuture> overlaysAsync = mMapView.identifyGraphicsOverlaysAsync(screenPoint, 10.0, false, 1); overlaysAsync.addDoneListener(new Runnable() { @@ -310,7 +310,7 @@ if (!overlayResultList.isEmpty()) { IdentifyGraphicsOverlayResult identifyResult = overlayResultList.get(0); Point point = identifyResult.getGraphicsOverlay().getExtent().getCenter(); - for (StreetLightLocalBean dataBean : lightBeans) { + for (LightLocalBean dataBean : lightBeans) { if (Math.abs(dataBean.getLongitude() - point.getX()) <= LocaleConstant.DELTA_LNG_10 && Math.abs(dataBean.getLatitude() - point.getY()) <= LocaleConstant.DELTA_LAT_10) { Message message = weakReferenceHandler.obtainMessage(); diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java index b0b44b5..38f9068 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/MinePageFragment.java @@ -27,17 +27,13 @@ import com.casic.dcms.mvvm.vm.UserViewModel; import com.casic.dcms.mvvm.vm.VersionViewModel; import com.casic.dcms.utils.AuthenticationHelper; -import com.casic.dcms.utils.LocaleConstant; import com.casic.dcms.utils.OtherUtils; import com.casic.dcms.utils.StringHelper; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import com.pengxh.androidx.lite.base.AndroidxBaseFragment; import com.pengxh.androidx.lite.callback.OnDownloadListener; import com.pengxh.androidx.lite.utils.ContextUtil; import com.pengxh.androidx.lite.utils.FileUtil; import com.pengxh.androidx.lite.utils.PageNavigationManager; -import com.pengxh.androidx.lite.utils.SaveKeyValues; import com.pengxh.androidx.lite.utils.StringUtil; import com.pengxh.androidx.lite.vm.LoadState; import com.pengxh.androidx.lite.widget.EasyToast; @@ -193,12 +189,8 @@ @Override public void onResume() { - String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); - if (!userDetailJson.isEmpty()) { - userData = new Gson().fromJson(userDetailJson, new TypeToken() { - }.getType()); - updateUserInfo(); - } + userData = StringHelper.getUserBean(); + updateUserInfo(); super.onResume(); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java index 8c855cd..e4a3191 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java +++ b/app/src/main/java/com/casic/dcms/mvvm/view/fragment/NoticePageFragment.java @@ -15,9 +15,9 @@ import com.casic.dcms.adapter.SwipeViewAdapter; import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.databinding.FragmentNoticeBinding; -import com.casic.dcms.greendao.NoticeBeanDao; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.greendao.NoticeLocaleBeanDao; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; import com.casic.dcms.utils.LocaleConstant; @@ -36,9 +36,9 @@ private static final String TAG = "NoticePageFragment"; private static WeakReferenceHandler weakReferenceHandler; private Context context; - private NoticeBeanDao noticeBeanDao; + private NoticeLocaleBeanDao noticeBeanDao; private SwipeViewAdapter swipeViewAdapter; - private List noticeBeans = new ArrayList<>(); + private List noticeBeans = new ArrayList<>(); @Override protected void setupTopBarLayout() { @@ -49,14 +49,14 @@ protected void initData() { swipeViewAdapter = new SwipeViewAdapter(context); //根据loginName加载历史数据 - String account = StringHelper.getUserAccount(); + String account = StringHelper.getUserBean().getAccount(); if (TextUtils.isEmpty(account)) { return; } - noticeBeanDao = BaseApplication.getDaoSession().getNoticeBeanDao(); + noticeBeanDao = BaseApplication.getDaoSession().getNoticeLocaleBeanDao(); noticeBeans = noticeBeanDao.queryBuilder() - .where(NoticeBeanDao.Properties.UserAccount.eq(account)) - .orderDesc(NoticeBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 + .where(NoticeLocaleBeanDao.Properties.UserAccount.eq(account)) + .orderDesc(NoticeLocaleBeanDao.Properties.PushDate) //按时间顺序最新顺序排序 .list(); swipeViewAdapter.setData(noticeBeans); weakReferenceHandler = new WeakReferenceHandler(this); @@ -108,7 +108,7 @@ MainActivity.sendEmptyMessage(LocaleConstant.MESSAGE_NUMBER); //点击之后之后,未读消息变为已读消息 - NoticeBean noticeBean = noticeBeans.get(position); + NoticeLocaleBean noticeBean = noticeBeans.get(position); noticeBean.setIsRead("0"); noticeBeanDao.update(noticeBean); swipeViewAdapter.notifyDataSetChanged(); @@ -132,9 +132,9 @@ NoticePageFragment noticePageFragment; try { noticePageFragment = reference.get(); - List noticeBeans = noticePageFragment.noticeBeans; + List noticeBeans = noticePageFragment.noticeBeans; if (msg.what == LocaleConstant.PUSH_MESSAGE_DATA) { - NoticeBean noticeBean = (NoticeBean) msg.obj; + NoticeLocaleBean noticeBean = (NoticeLocaleBean) msg.obj; Log.d(TAG, "收到推送消息,更新列表: " + noticeBean.getCaseId()); noticeBeans.add(0, noticeBean); //新消息永远放到第一个 //更新数据 @@ -147,9 +147,6 @@ } - /** - * 供{@link com.casic.dcms.service.GeTuiIntentService.onReceiveMessageData}调用 - */ public static void sendMessage(Message msg) { if (weakReferenceHandler == null) { return; diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java index a2034fe..f578afc 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/MapConfigViewModel.java @@ -2,7 +2,7 @@ import androidx.lifecycle.MutableLiveData; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -19,7 +19,7 @@ public class MapConfigViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData mapConfigModel = new MutableLiveData<>(); + public MutableLiveData mapConfigModel = new MutableLiveData<>(); public void obtainMapConfig() { Observable observable = RetrofitServiceManager.getMapConfig(); @@ -40,7 +40,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - MapConfigBean configBean = gson.fromJson(response, new TypeToken() { + MapConfigModel configBean = gson.fromJson(response, new TypeToken() { }.getType()); mapConfigModel.setValue(configBean); } else { diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java index c415b6c..016f52b 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/ToiletViewModel.java @@ -4,7 +4,7 @@ import com.casic.dcms.mvvm.model.ActionResultBean; import com.casic.dcms.mvvm.model.CleanRecordBean; -import com.casic.dcms.mvvm.model.ToiletListBean; +import com.casic.dcms.mvvm.model.ToiletListModel; import com.casic.dcms.utils.StringHelper; import com.casic.dcms.utils.retrofit.RetrofitServiceManager; import com.google.gson.Gson; @@ -21,7 +21,7 @@ public class ToiletViewModel extends BaseViewModel { private final Gson gson = new Gson(); - public MutableLiveData toiletListModel = new MutableLiveData<>(); + public MutableLiveData toiletListModel = new MutableLiveData<>(); public MutableLiveData cleanToiletModel = new MutableLiveData<>(); public MutableLiveData cleanRecordModel = new MutableLiveData<>(); @@ -44,7 +44,7 @@ String response = responseBody.string(); int responseCode = StringHelper.separateResponseCode(response); if (responseCode == 200) { - ToiletListBean listBean = gson.fromJson(response, new TypeToken() { + ToiletListModel listBean = gson.fromJson(response, new TypeToken() { }.getType()); toiletListModel.setValue(listBean); } diff --git a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java index ce0c065..f4c85ca 100644 --- a/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java +++ b/app/src/main/java/com/casic/dcms/mvvm/vm/UploadViewModel.java @@ -65,7 +65,7 @@ loadState.setValue(LoadState.Loading); //改为上传带水印的图片 Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); - ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserAccount(), + ImageHelper.drawTextToRightBottom(bitmap, StringHelper.getUserBean().getAccount(), TimeOrDateUtil.timestampToDate(System.currentTimeMillis()), TimeOrDateUtil.timestampToTime(System.currentTimeMillis()), new IWaterMarkAddListener() { diff --git a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java index 9b38cdd..18b9cdd 100644 --- a/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java +++ b/app/src/main/java/com/casic/dcms/service/GeTuiIntentService.java @@ -7,7 +7,7 @@ import android.util.Log; import com.casic.dcms.base.BaseApplication; -import com.casic.dcms.mvvm.model.NoticeBean; +import com.casic.dcms.bean.NoticeLocaleBean; import com.casic.dcms.mvvm.model.PushResultBean; import com.casic.dcms.mvvm.view.CaseDetailActivity; import com.casic.dcms.mvvm.view.MainActivity; @@ -51,8 +51,8 @@ String messageContent = new String(msg.getPayload()); PushResultBean resultBean = gson.fromJson(messageContent, new TypeToken() { }.getType()); - NoticeBean noticeBean = new NoticeBean(); - noticeBean.setUserAccount(StringHelper.getUserAccount()); + NoticeLocaleBean noticeBean = new NoticeLocaleBean(); + noticeBean.setUserAccount(StringHelper.getUserBean().getAccount()); noticeBean.setCaseId(resultBean.getData().getId()); noticeBean.setTitle(resultBean.getTitle()); noticeBean.setContent(resultBean.getContent()); @@ -61,7 +61,7 @@ noticeBean.setIsRead("1"); //存本地一份 - BaseApplication.getDaoSession().getNoticeBeanDao().insert(noticeBean); + BaseApplication.getDaoSession().getNoticeLocaleBeanDao().insert(noticeBean); //创建通知栏 Message msgNotice = Message.obtain(); diff --git a/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java b/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java index 3613fa8..be79c4e 100644 --- a/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java +++ b/app/src/main/java/com/casic/dcms/utils/ArcGisMapCreator.java @@ -2,7 +2,7 @@ import android.util.Log; -import com.casic.dcms.mvvm.model.MapConfigBean; +import com.casic.dcms.mvvm.model.MapConfigModel; import com.esri.arcgisruntime.data.ServiceFeatureTable; import com.esri.arcgisruntime.layers.ArcGISTiledLayer; @@ -16,7 +16,7 @@ * 创建带网格的ArcGIS底图 */ public static ArcGISTiledLayer createBaseLayer() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ArcGISTiledLayer("/"); @@ -34,7 +34,7 @@ * 创建不带网格的ArcGIS底图 */ public static ArcGISTiledLayer createNoGridLayer() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ArcGISTiledLayer("/"); @@ -51,7 +51,7 @@ * 创建网格图层或者社区图层ServiceFeatureTable */ public static ServiceFeatureTable createGridFeatureTable() { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ServiceFeatureTable("/"); @@ -68,7 +68,7 @@ * 创建其他图层ServiceFeatureTable */ public static ServiceFeatureTable createOtherFeatureTable(String layerName) { - List mapConfigList = StringHelper.getMapConfigList(); + List mapConfigList = DataBaseManager.getInstance().getMapConfigList(); if (mapConfigList.size() == 0) { Log.d(TAG, "create: mapConfigList.size() == 0"); return new ServiceFeatureTable("/"); @@ -92,8 +92,8 @@ /** * http://111.198.10.15:13002/arcgis/rest/services/crbjfc/FeatureServer/33 * */ - String toiletLayerID = StringHelper.getToiletLayerID(); - featureTable = new ServiceFeatureTable(baseGisUrl + LocaleConstant.TOILET_SERVICE_URL + "/" + toiletLayerID); + String toiletLayerId = StringHelper.getToiletLayerId(); + featureTable = new ServiceFeatureTable(baseGisUrl + LocaleConstant.TOILET_SERVICE_URL + "/" + toiletLayerId); break; default: throw new IllegalStateException("Unexpected value: " + layerName); diff --git a/app/src/main/java/com/casic/dcms/utils/DataBaseManager.java b/app/src/main/java/com/casic/dcms/utils/DataBaseManager.java new file mode 100644 index 0000000..98e8df8 --- /dev/null +++ b/app/src/main/java/com/casic/dcms/utils/DataBaseManager.java @@ -0,0 +1,120 @@ +package com.casic.dcms.utils; + +import com.casic.dcms.base.BaseApplication; +import com.casic.dcms.bean.MapConfigBean; +import com.casic.dcms.bean.ToiletListBean; +import com.casic.dcms.greendao.MapConfigBeanDao; +import com.casic.dcms.greendao.ToiletListBeanDao; +import com.casic.dcms.mvvm.model.MapConfigModel; +import com.casic.dcms.mvvm.model.ToiletListModel; + +import java.util.ArrayList; +import java.util.List; + +public class DataBaseManager { + private static DataBaseManager instance; + + private DataBaseManager() { + } + + /** + * 双重锁单例 + */ + public static DataBaseManager getInstance() { + if (instance == null) { + synchronized (BaseApplication.class) { + if (instance == null) { + instance = new DataBaseManager(); + } + } + } + return instance; + } + + private final MapConfigBeanDao mapConfigBeanDao = BaseApplication.getDaoSession().getMapConfigBeanDao(); + private final ToiletListBeanDao toiletListBeanDao = BaseApplication.getDaoSession().getToiletListBeanDao(); + + /***路灯本地数据管理************************************************************/ + + /***通知本地数据管理************************************************************/ + + /***地图本地数据管理************************************************************/ + public void deleteAllMapConfig() { + mapConfigBeanDao.deleteAll(); + } + + public void saveMapConfig(MapConfigModel.DataBean.RowsBean rowsBean) { + MapConfigBean mapConfigBean = new MapConfigBean(); + mapConfigBean.setMapId(rowsBean.getId()); + mapConfigBean.setName(rowsBean.getName()); + mapConfigBean.setUrl(rowsBean.getUrl()); + mapConfigBeanDao.save(mapConfigBean); + } + + public List getMapConfigList() { + List result = new ArrayList<>(); + List configBeans = mapConfigBeanDao.loadAll(); + for (MapConfigBean configBean : configBeans) { + MapConfigModel.DataBean.RowsBean rowsBean = new MapConfigModel.DataBean.RowsBean(); + rowsBean.setId(configBean.getMapId()); + rowsBean.setName(configBean.getName()); + rowsBean.setUrl(configBean.getUrl()); + result.add(rowsBean); + } + return result; + } + + /***公厕本地数据管理************************************************************/ + public void deleteAllToiletList() { + toiletListBeanDao.deleteAll(); + } + + public void saveToiletList(ToiletListModel.DataBean dataBean) { + ToiletListBean bean = new ToiletListBean(); + bean.setArea(dataBean.getArea()); + bean.setCode(dataBean.getCode()); + bean.setCreateTime(dataBean.getCreateTime()); + bean.setDelFlag(dataBean.getDelFlag()); + bean.setDeptId(dataBean.getDeptId()); + bean.setToiletId(dataBean.getId()); + bean.setLat(dataBean.getLat()); + bean.setLng(dataBean.getLng()); + bean.setName(dataBean.getName()); + bean.setNotes(dataBean.getNotes()); + bean.setOwner(dataBean.getOwner()); + bean.setPhoto(dataBean.getPhoto()); + bean.setPosition(dataBean.getPosition()); + bean.setResponsiblePerson(dataBean.getResponsiblePerson()); + bean.setResponsiblePersonTel(dataBean.getResponsiblePersonTel()); + bean.setTs(dataBean.getTs()); + bean.setUpdateTime(dataBean.getUpdateTime()); + toiletListBeanDao.save(bean); + } + + public List getToiletList() { + List result = new ArrayList<>(); + List listBeans = toiletListBeanDao.loadAll(); + for (ToiletListBean toiletBean : listBeans) { + ToiletListModel.DataBean dataBean = new ToiletListModel.DataBean(); + dataBean.setArea(toiletBean.getArea()); + dataBean.setCode(toiletBean.getCode()); + dataBean.setCreateTime(toiletBean.getCreateTime()); + dataBean.setDelFlag(toiletBean.getDelFlag()); + dataBean.setDeptId(toiletBean.getDeptId()); + dataBean.setId(toiletBean.getToiletId()); + dataBean.setLat(toiletBean.getLat()); + dataBean.setLng(toiletBean.getLng()); + dataBean.setName(toiletBean.getName()); + dataBean.setNotes(toiletBean.getNotes()); + dataBean.setOwner(toiletBean.getOwner()); + dataBean.setPhoto(toiletBean.getPhoto()); + dataBean.setPosition(toiletBean.getPosition()); + dataBean.setResponsiblePerson(toiletBean.getResponsiblePerson()); + dataBean.setResponsiblePersonTel(toiletBean.getResponsiblePersonTel()); + dataBean.setTs(toiletBean.getTs()); + dataBean.setUpdateTime(toiletBean.getUpdateTime()); + result.add(dataBean); + } + return result; + } +} diff --git a/app/src/main/java/com/casic/dcms/utils/LocaleConstant.java b/app/src/main/java/com/casic/dcms/utils/LocaleConstant.java index e354c07..e7ace6d 100644 --- a/app/src/main/java/com/casic/dcms/utils/LocaleConstant.java +++ b/app/src/main/java/com/casic/dcms/utils/LocaleConstant.java @@ -42,9 +42,9 @@ public static final String USER_DETAIL_MODEL = "userDetailModel"; public static final String LAST_LOGIN = "lastLoginTime"; public static final String IP_KEY = "ip"; + public static final String TOILET_LAYER_ID = "toiletLayerId"; + public static final String BRIDGE_LIST = "projectBridges"; - public static final String MAP_CONFIG = "mapConfigs"; - public static final String TOILET_LIST = "toilets"; public static final long HALF_YEAR = 180 * 60 * 60 * 24 * 1000L; public static final long FIVE_YEARS = 5L * 365 * 60 * 60 * 24 * 1000L; diff --git a/app/src/main/java/com/casic/dcms/utils/StringHelper.java b/app/src/main/java/com/casic/dcms/utils/StringHelper.java index a0a7258..79cc5e3 100644 --- a/app/src/main/java/com/casic/dcms/utils/StringHelper.java +++ b/app/src/main/java/com/casic/dcms/utils/StringHelper.java @@ -5,8 +5,6 @@ import com.casic.dcms.R; import com.casic.dcms.mvvm.model.BridgeConfigBean; -import com.casic.dcms.mvvm.model.MapConfigBean; -import com.casic.dcms.mvvm.model.ToiletListBean; import com.casic.dcms.mvvm.model.UserBean; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -21,41 +19,23 @@ import java.util.regex.Pattern; public class StringHelper { - private static final String TAG = "StringHelper"; - // TODO 后续去掉 - public static void saveUserAccount(String account) { - - } - - // TODO 后续去掉 - public static String getUserAccount() { - return ""; - } - - // TODO 后续去掉 - public static void saveUserBean(String userBeanJson) { - - } - - // TODO 后续去掉 public static UserBean.DataBean getUserBean() { + String userDetailJson = (String) SaveKeyValues.getValue(LocaleConstant.USER_DETAIL_MODEL, ""); + if (!userDetailJson.isEmpty()) { + return new Gson().fromJson(userDetailJson, new TypeToken() { + }.getType()); + } return new UserBean.DataBean(); } - public static void saveMapConfigList(String mapConfigJson) { - SaveKeyValues.putValue(LocaleConstant.MAP_CONFIG, mapConfigJson); + public static void saveToiletLayerId(String toiletLayerId) { + SaveKeyValues.putValue(LocaleConstant.TOILET_LAYER_ID, toiletLayerId); } - static List getMapConfigList() { - String mapConfigJson = (String) SaveKeyValues.getValue(LocaleConstant.MAP_CONFIG, ""); - List configs = new ArrayList<>(); - if (mapConfigJson.equals("")) { - return configs; - } - return new Gson().fromJson(mapConfigJson, new TypeToken>() { - }.getType()); + static String getToiletLayerId() { + return (String) SaveKeyValues.getValue(LocaleConstant.TOILET_LAYER_ID, ""); } public static void saveBridgeList(String bridgesJson) { @@ -72,28 +52,6 @@ }.getType()); } - public static void saveToiletList(String toiletsJson) { - SaveKeyValues.putValue(LocaleConstant.TOILET_LIST, toiletsJson); - } - - public static List getToiletBeanList() { - String toiletsJson = (String) SaveKeyValues.getValue(LocaleConstant.TOILET_LIST, ""); - List toilets = new ArrayList<>(); - if (toiletsJson.equals("")) { - return toilets; - } - return new Gson().fromJson(toiletsJson, new TypeToken>() { - }.getType()); - } - - public static void saveToiletLayerID(String toiletLayerID) { - SaveKeyValues.putValue("toiletLayerID", toiletLayerID); - } - - static String getToiletLayerID() { - return (String) SaveKeyValues.getValue("toiletLayerID", ""); - } - public static boolean isLetterAndDigit(String str) { boolean isDigit = false; boolean isLetter = false;