Commit 6e4e56a1 by yu

2017-10-25

parent 117ce882
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
package com.dayu.bigfish;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
/**
* Created by Administrator on 2017/10/15.
* 大鱼通知
*/
@Entity
public class MessageBigFish {
@Id
private Long id;
private String ids; //用户id
private String id1; //id
private String flag;
@Generated(hash = 1828839047)
public MessageBigFish(Long id, String ids, String id1, String flag) {
this.id = id;
this.ids = ids;
this.id1 = id1;
this.flag = flag;
}
@Generated(hash = 1245723608)
public MessageBigFish() {
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getIds() {
return this.ids;
}
public void setIds(String ids) {
this.ids = ids;
}
public String getId1() {
return this.id1;
}
public void setId1(String id1) {
this.id1 = id1;
}
public String getFlag() {
return this.flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
}
package com.dayu.bigfish;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
/**
* Created by Administrator on 2017/10/15.
* 系统消息
*/
@Entity
public class MessageSys {
@Id
private Long id;
private String ids; //消息唯一标识
private String id1; //登陆人
private String flag;
@Generated(hash = 1217263000)
public MessageSys(Long id, String ids, String id1, String flag) {
this.id = id;
this.ids = ids;
this.id1 = id1;
this.flag = flag;
}
@Generated(hash = 1396459834)
public MessageSys() {
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getIds() {
return this.ids;
}
public void setIds(String ids) {
this.ids = ids;
}
public String getId1() {
return this.id1;
}
public void setId1(String id1) {
this.id1 = id1;
}
public String getFlag() {
return this.flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
}
package com.dayu.bigfish.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.cjj.MaterialRefreshLayout;
import com.cjj.MaterialRefreshListener;
import com.dayu.bigfish.R;
import com.dayu.bigfish.adapter.WorksheetAdapter;
import com.dayu.bigfish.application.MyApplication;
import com.dayu.bigfish.base.BaseActivity;
import com.dayu.bigfish.bean.WorksheetBean;
import com.dayu.bigfish.moudle.worksheetRecord.WorksheetRecordPresenter;
import com.dayu.bigfish.moudle.worksheetRecord.WorksheetRecordView;
import com.dayu.bigfish.tip.TipsHelper;
import com.dayu.bigfish.utils.GetUserInfo;
import com.dayu.bigfish.utils.ToastUtils;
import com.dayu.bigfish.views.CustomProgressDialog;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 工单记录,展示已完成的订单
* on 2017/9/29.
*/
public class WorksheetRecordActivity extends BaseActivity<WorksheetRecordView, WorksheetRecordPresenter> implements WorksheetRecordView, WorksheetAdapter.OnItemLongClickListener {
@BindView(R.id.refresh)
com.cjj.MaterialRefreshLayout refresh;
@BindView(R.id.title_text)
TextView titleText;
@BindView(R.id.receiving_back)
ImageView receivingBack;
@BindView(R.id.iv_saecher)
ImageView ivSaecher;
@BindView(R.id.time_title)
RelativeLayout timeTitle;
@BindView(R.id.et_seacher)
EditText etSeacher;
@BindView(R.id.iv)
ImageView iv;
@BindView(R.id.quit)
TextView quit;
@BindView(R.id.time_seacher)
RelativeLayout timeSeacher;
@BindView(R.id.rv)
RecyclerView recyclerView;
private String seacher;
public ArrayList<WorksheetBean.DataBeanX.DataBean> list = new ArrayList<>();
private CustomProgressDialog dialog;
private int siteId = GetUserInfo.getSITE_ID(MyApplication.getContext());
private int userId = GetUserInfo.getACCOUNT_ID(MyApplication.getContext());
private TipsHelper mTipsHelper;
private WorksheetAdapter worksheetAdapter;
private int id;
private String token;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_worksheet_record);
ButterKnife.bind(this);
token = GetUserInfo.getToken(this);
dialog = new CustomProgressDialog(this, R.style.CustomDialog);
mTipsHelper = createTipsHelper(recyclerView);
dialog.show();
initView();
initRefresh();
list.clear();
presenter.getDate("5", userId, siteId, "1", token);
}
@Override
public void initView() {
titleText.setText("工单记录");
worksheetAdapter = new WorksheetAdapter(this, list);
etSeacher.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
seacher = s.toString();
list.clear();
presenter.getDate("5", userId, siteId, "1", token);
worksheetAdapter.notifyDataSetChanged();
}
});
}
@Override
public void initData() {
}
@Override
public WorksheetRecordPresenter initPresenter() {
return new WorksheetRecordPresenter(this);
}
@OnClick({R.id.receiving_back, R.id.iv_saecher, R.id.quit})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.receiving_back:
finish();
break;
case R.id.iv_saecher:
timeTitle.setVisibility(View.GONE);
timeSeacher.setVisibility(View.VISIBLE);
break;
case R.id.quit:
timeSeacher.setVisibility(View.GONE);
timeTitle.setVisibility(View.VISIBLE);
worksheetAdapter.notifyDataSetChanged();
break;
}
}
@Override
public void getSuccess(WorksheetBean worksheetBean) {
dialog.dismiss();
list.clear();
list.addAll(worksheetBean.getData().getData());
if (list.size() == 0 || list.equals(" ")) {
mTipsHelper.showEmpty();
} else {
mTipsHelper.hideEmpty();
recyclerView.setLayoutManager(new LinearLayoutManager(this));
worksheetAdapter.setOnItemLongClickListener(this);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(worksheetAdapter);
}
}
@Override
public void getError(String msg) {
dialog.dismiss();
dialog.dismiss();
mTipsHelper.showError(true, msg, v -> {
presenter.getDate("5", userId, siteId, "1", token);
dialog.show();
});
ToastUtils.showShortToast(msg);
}
@Override
public void initListener() {
}
@Override
public void OnItemLongClick(View view, int position) {
//跳转工单详情
Intent intent = new Intent(WorksheetRecordActivity.this, OrderDetailsActivity.class);
id = list.get(position).getId();
intent.putExtra("orderId", id + "");
startActivity(intent);
}
private void initRefresh() {
refresh.setWaveColor(0xffffffff);
refresh.setIsOverLay(false);
refresh.setWaveShow(true);
refresh.setLoadMore(true);
refresh.setMaterialRefreshListener(new MaterialRefreshListener() {
//下拉刷新
@Override
public void onRefresh(MaterialRefreshLayout materialRefreshLayout) {
presenter.getDate("5", userId, siteId, "1", token);
refresh.finishRefresh();
}
@Override
public void onRefreshLoadMore(MaterialRefreshLayout materialRefreshLayout) {
/* if (hasNextPage == true) {
page++;
presenter.getData(2, page, userId, 10, siteId);
} else {
Toast.makeText(getActivity(), "已经到底了", Toast.LENGTH_SHORT).show();
}*/
refresh.finishRefreshLoadMore();
}
});
}
}
package com.dayu.bigfish.adapter;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.WorksheetBean;
import com.dayu.bigfish.utils.DateUtils;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 已完成工单的适配器
* on 2017/9/29.
*/
public class WorksheetAdapter extends RecyclerView.Adapter<WorksheetAdapter.WorksheetHolder> {
private Context mContext;
private ArrayList<WorksheetBean.DataBeanX.DataBean> list1;
private String dateMD = null;
private String dateTime = null;
private DateUtils dateUtils = new DateUtils();
private OnItemLongClickListener mOnItemLongClickListener;
private int myOrderStatu;
public WorksheetAdapter(Context context, ArrayList<WorksheetBean.DataBeanX.DataBean> list) {
this.mContext = context;
this.list1 = list;
}
public void setOnItemLongClickListener(OnItemLongClickListener onItemLongClickListener) {
this.mOnItemLongClickListener = onItemLongClickListener;
}
@Override
public WorksheetHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new WorksheetHolder(LayoutInflater.from(mContext).inflate(R.layout.activity_list, parent, false));
}
@Override
public void onBindViewHolder(WorksheetHolder holder, int position) {
try {
dateMD = dateUtils.stringDateToDate(list1.get(position).getCreateTime());
} catch (Exception e) {
e.printStackTrace();
}
holder.itemTody.setText(dateMD);
try {
dateTime = dateUtils.stringTimeToDate(list1.get(position).getCreateTime());
} catch (Exception e) {
e.printStackTrace();
}
holder.itemTime.setText(dateTime);
//服务类型
holder.itemTextWeixiu.setText(list1.get(position).getProviderName());
// 维修类型
holder.itemTextWeixiuLeixing.setText(list1.get(position).getCategoryName());
//拼接省市区街道地址
holder.itemTextDizhi.setText(
//省一级城市名称
(String) list1.get(position).getProvinceName()
//市一级城市名称
+ list1.get(position).getCityName() +
//区/地区一级城市名称
list1.get(position).getDistrictName() +
//详细到街道
list1.get(position).getAddress());
myOrderStatu = list1.get(position).getStatus();
if (myOrderStatu == 1) {
holder.orderTv.setText("未接单");
} else if (myOrderStatu == 2) {
holder.orderTv.setText("未预约");
} else if (myOrderStatu == 3) {
holder.orderTv.setText("已预约");
} else if (myOrderStatu == 4) {
holder.orderTv.setText("进行中");
} else if (myOrderStatu == 5) {
holder.orderTv.setText("已完成");
} else if (myOrderStatu == 6) {
holder.orderTv.setText("已取消");
} else if (myOrderStatu == 7) {
holder.orderTv.setText("订单关闭");
}
//用户名
holder.itemTextUserName.setText((String) list1.get(position).getCustomerName());
//用户手机号
holder.itemTextUserPhone.setText((String) list1.get(position).getCustomerMobile());
//
if (mOnItemLongClickListener != null) {
holder.itemView.setOnClickListener(v -> mOnItemLongClickListener.OnItemLongClick(v, holder.getAdapterPosition()));
}
}
@Override
public int getItemCount() {
return list1.size();
}
public class WorksheetHolder extends RecyclerView.ViewHolder {
@BindView(R.id.item_line)
ImageView itemLine;
@BindView(R.id.item_tody)
TextView itemTody;
@BindView(R.id.item_time)
TextView itemTime;
@BindView(R.id.item_text_user_name)
TextView itemTextUserName;
@BindView(R.id.item_text_user_phone)
TextView itemTextUserPhone;
@BindView(R.id.item_text_weixiu)
TextView itemTextWeixiu;
@BindView(R.id.item_text_weixiu_leixing)
TextView itemTextWeixiuLeixing;
@BindView(R.id.item_text_dizhi)
TextView itemTextDizhi;
@BindView(R.id.order_tv)
TextView orderTv;
@BindView(R.id.item)
RelativeLayout item;
public WorksheetHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
AssetManager mgr = mContext.getAssets();//得到AssetManager
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");//根据路径得到Typeface
itemTime.setTypeface(tf);//设置字体
}
}
public interface OnItemLongClickListener {
void OnItemLongClick(View view, int position);
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
import java.util.List;
/**
* Created by Administrator on 2017/9/29.
* 工单记录bean
*/
public class WorksheetBean implements Serializable {
/**
* code : 0
* data : {"data":[{"address":"string","categoryName":"string","cityName":"string","confirmDoorTime":"2017-09-29T11:02:55.594Z","createTime":"2017-09-29T11:02:55.594Z","customerCompany":"string","customerMobile":"string","customerName":"string","customerTelphome":"string","customerType":0,"districtName":"string","excptionCode":0,"id":0,"orderNum":"string","providerName":"string","provinceName":"string","status":0}],"nextPageNo":0,"pageNo":0,"pageSize":0,"previousPageNo":0,"totalPages":0,"totalRows":0}
* msg : string
*/
private int code;
private DataBeanX data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBeanX getData() {
return data;
}
public void setData(DataBeanX data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBeanX {
/**
* data : [{"address":"string","categoryName":"string","cityName":"string","confirmDoorTime":"2017-09-29T11:02:55.594Z","createTime":"2017-09-29T11:02:55.594Z","customerCompany":"string","customerMobile":"string","customerName":"string","customerTelphome":"string","customerType":0,"districtName":"string","excptionCode":0,"id":0,"orderNum":"string","providerName":"string","provinceName":"string","status":0}]
* nextPageNo : 0
* pageNo : 0
* pageSize : 0
* previousPageNo : 0
* totalPages : 0
* totalRows : 0
*/
private int nextPageNo;
private int pageNo;
private int pageSize;
private int previousPageNo;
private int totalPages;
private int totalRows;
private List<DataBean> data;
public int getNextPageNo() {
return nextPageNo;
}
public void setNextPageNo(int nextPageNo) {
this.nextPageNo = nextPageNo;
}
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPreviousPageNo() {
return previousPageNo;
}
public void setPreviousPageNo(int previousPageNo) {
this.previousPageNo = previousPageNo;
}
public int getTotalPages() {
return totalPages;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
public int getTotalRows() {
return totalRows;
}
public void setTotalRows(int totalRows) {
this.totalRows = totalRows;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean {
/**
* address : string
* categoryName : string
* cityName : string
* confirmDoorTime : 2017-09-29T11:02:55.594Z
* createTime : 2017-09-29T11:02:55.594Z
* customerCompany : string
* customerMobile : string
* customerName : string
* customerTelphome : string
* customerType : 0
* districtName : string
* excptionCode : 0
* id : 0
* orderNum : string
* providerName : string
* provinceName : string
* status : 0
*/
private String address;
private String categoryName;
private String cityName;
private String confirmDoorTime;
private String createTime;
private String customerCompany;
private String customerMobile;
private String customerName;
private String customerTelphome;
private int customerType;
private String districtName;
private int excptionCode;
private int id;
private String orderNum;
private String providerName;
private String provinceName;
private int status;
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public String getConfirmDoorTime() {
return confirmDoorTime;
}
public void setConfirmDoorTime(String confirmDoorTime) {
this.confirmDoorTime = confirmDoorTime;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getCustomerCompany() {
return customerCompany;
}
public void setCustomerCompany(String customerCompany) {
this.customerCompany = customerCompany;
}
public String getCustomerMobile() {
return customerMobile;
}
public void setCustomerMobile(String customerMobile) {
this.customerMobile = customerMobile;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerTelphome() {
return customerTelphome;
}
public void setCustomerTelphome(String customerTelphome) {
this.customerTelphome = customerTelphome;
}
public int getCustomerType() {
return customerType;
}
public void setCustomerType(int customerType) {
this.customerType = customerType;
}
public String getDistrictName() {
return districtName;
}
public void setDistrictName(String districtName) {
this.districtName = districtName;
}
public int getExcptionCode() {
return excptionCode;
}
public void setExcptionCode(int excptionCode) {
this.excptionCode = excptionCode;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum;
}
public String getProviderName() {
return providerName;
}
public void setProviderName(String providerName) {
this.providerName = providerName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
}
}
package com.dayu.bigfish.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.dayu.bigfish.MessageBigFish;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "MESSAGE_BIG_FISH".
*/
public class MessageBigFishDao extends AbstractDao<MessageBigFish, Long> {
public static final String TABLENAME = "MESSAGE_BIG_FISH";
/**
* Properties of entity MessageBigFish.<br/>
* 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 Ids = new Property(1, String.class, "ids", false, "IDS");
public final static Property Id1 = new Property(2, String.class, "id1", false, "ID1");
public final static Property Flag = new Property(3, String.class, "flag", false, "FLAG");
}
public MessageBigFishDao(DaoConfig config) {
super(config);
}
public MessageBigFishDao(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 + "\"MESSAGE_BIG_FISH\" (" + //
"\"_id\" INTEGER PRIMARY KEY ," + // 0: id
"\"IDS\" TEXT," + // 1: ids
"\"ID1\" TEXT," + // 2: id1
"\"FLAG\" TEXT);"); // 3: flag
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MESSAGE_BIG_FISH\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, MessageBigFish entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String ids = entity.getIds();
if (ids != null) {
stmt.bindString(2, ids);
}
String id1 = entity.getId1();
if (id1 != null) {
stmt.bindString(3, id1);
}
String flag = entity.getFlag();
if (flag != null) {
stmt.bindString(4, flag);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, MessageBigFish entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String ids = entity.getIds();
if (ids != null) {
stmt.bindString(2, ids);
}
String id1 = entity.getId1();
if (id1 != null) {
stmt.bindString(3, id1);
}
String flag = entity.getFlag();
if (flag != null) {
stmt.bindString(4, flag);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public MessageBigFish readEntity(Cursor cursor, int offset) {
MessageBigFish entity = new MessageBigFish( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // ids
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // id1
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // flag
);
return entity;
}
@Override
public void readEntity(Cursor cursor, MessageBigFish entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setIds(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setId1(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setFlag(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
}
@Override
protected final Long updateKeyAfterInsert(MessageBigFish entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(MessageBigFish entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(MessageBigFish entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.dayu.bigfish.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.dayu.bigfish.MessageSys;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "MESSAGE_SYS".
*/
public class MessageSysDao extends AbstractDao<MessageSys, Long> {
public static final String TABLENAME = "MESSAGE_SYS";
/**
* Properties of entity MessageSys.<br/>
* 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 Ids = new Property(1, String.class, "ids", false, "IDS");
public final static Property Id1 = new Property(2, String.class, "id1", false, "ID1");
public final static Property Flag = new Property(3, String.class, "flag", false, "FLAG");
}
public MessageSysDao(DaoConfig config) {
super(config);
}
public MessageSysDao(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 + "\"MESSAGE_SYS\" (" + //
"\"_id\" INTEGER PRIMARY KEY ," + // 0: id
"\"IDS\" TEXT," + // 1: ids
"\"ID1\" TEXT," + // 2: id1
"\"FLAG\" TEXT);"); // 3: flag
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MESSAGE_SYS\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, MessageSys entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String ids = entity.getIds();
if (ids != null) {
stmt.bindString(2, ids);
}
String id1 = entity.getId1();
if (id1 != null) {
stmt.bindString(3, id1);
}
String flag = entity.getFlag();
if (flag != null) {
stmt.bindString(4, flag);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, MessageSys entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String ids = entity.getIds();
if (ids != null) {
stmt.bindString(2, ids);
}
String id1 = entity.getId1();
if (id1 != null) {
stmt.bindString(3, id1);
}
String flag = entity.getFlag();
if (flag != null) {
stmt.bindString(4, flag);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public MessageSys readEntity(Cursor cursor, int offset) {
MessageSys entity = new MessageSys( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // ids
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // id1
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3) // flag
);
return entity;
}
@Override
public void readEntity(Cursor cursor, MessageSys entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setIds(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setId1(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setFlag(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
}
@Override
protected final Long updateKeyAfterInsert(MessageSys entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(MessageSys entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(MessageSys entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/item"
android:layout_width="@dimen/dp_333"
android:layout_height="@dimen/dp_133"
android:layout_centerHorizontal="true"
android:layout_marginTop="13dp"
android:background="@drawable/item_shape"
>
<ImageView
android:id="@+id/item_line"
android:layout_width="@dimen/size_order_item_line_width"
android:layout_height="@dimen/size_order_item_line_height"
android:layout_marginLeft="220dp"
android:background="@color/cl_order_item_line_bg"/>
<TextView
android:id="@+id/item_tody"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/item_line"
android:layout_marginLeft="@dimen/size_order_item_time_mr"
android:layout_marginTop="@dimen/size_order_item_time_mt"
android:text="@string/tv_order_item_time"
android:textSize="@dimen/size_order_item_time_text"
/>
<TextView
android:id="@+id/item_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/item_tody"
android:text="@string/tv_order_item_date"
android:textSize="@dimen/size_order_item_data_text"
android:layout_alignLeft="@+id/item_tody"
android:layout_alignStart="@+id/item_tody" />
<TextView
android:id="@+id/item_text_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_18"
android:text="@string/tv_order_item_user_name"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/sp_16"
android:textStyle="bold"
/>
<TextView
android:id="@+id/item_text_user_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_9"
android:layout_marginTop="@dimen/dp_23"
android:layout_toRightOf="@id/item_text_user_name"
android:text="@string/tv_order_item_user_phone"
android:textColor="@color/cl_tab_init"
android:textSize="@dimen/sp_12"
android:textStyle="bold"
/>
<TextView
android:id="@+id/item_text_weixiu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="43dp"
android:layout_marginLeft="3dp"
android:text="@string/tv_order_item_tool_text"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/size_login_hint_text"
android:layout_toRightOf="@+id/item_text_user_name" />
<TextView
android:drawableLeft="@mipmap/shouye_liebiao_weixiu_icon"
android:id="@+id/item_text_weixiu_leixing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="43dp"
android:layout_marginLeft="@dimen/dp_18"
android:drawablePadding="5dp"
android:text="@string/tv_order_item_tool_text_leixing"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/size_login_hint_text"
/>
<TextView
android:id="@+id/item_text_dizhi"
android:drawablePadding="5dp"
android:drawableLeft="@mipmap/shouye_liebiao_dizhi_icon"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginTop="67dp"
android:text="@string/tv_order_item_gps_text"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/size_login_hint_text"
/>
<TextView
android:id="@+id/order_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_marginTop="@dimen/dp_15"
android:layout_alignBottom="@+id/item_text_dizhi"
android:layout_alignRight="@+id/item_time"
android:layout_alignEnd="@+id/item_time"
android:layout_alignLeft="@+id/item_time"
android:layout_alignStart="@+id/item_time" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/time_title"
style="@style/title">
<TextView
android:id="@+id/title_text"
style="@style/text_title"
android:text="工单记录" />
<ImageView
android:id="@+id/receiving_back"
style="@style/title_image_back" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_6"
android:layout_alignParentBottom="true"
android:src="@drawable/line_shape" />
<ImageView
android:id="@+id/iv_saecher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:src="@mipmap/seacher" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/time_seacher"
style="@style/title"
android:visibility="gone">
<EditText
android:id="@+id/et_seacher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/iv"
android:background="@null"
android:hint="搜索客户手机号码" />
<ImageView
android:id="@+id/iv"
style="@style/title_image_back"
android:src="@mipmap/seacher" />
<TextView
android:id="@+id/quit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:gravity="center"
android:text="取消"
android:textColor="@color/cl_black"
android:textSize="@dimen/dp_18"
android:textStyle="bold" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_6"
android:layout_alignParentBottom="true"
android:src="@drawable/line_shape" />
</RelativeLayout>
</RelativeLayout>
<com.cjj.MaterialRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/refresh"
app:overlay="true"
app:wave_show="true"
app:wave_color="#90ffffff"
app:progress_colors="@array/material_colors"
app:wave_height_type="higher"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.cjj.MaterialRefreshLayout>
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment