请假审批页面、用餐申请审批页面 按钮调整到底部

master
wenfei 4 months ago
parent f40a242e27
commit baabaea583

@ -44,8 +44,7 @@ android {
checkReleaseBuilds false
abortOnError false
}
minifyEnabled true //
shrinkResources true
minifyEnabled false //
debuggable false // debug
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
//apk

@ -124,6 +124,8 @@ public class ConferenceBean {
return "会议内容未填写";
} else if (TextUtils.isEmpty(getConferenceHysmc())) {
return "会议室名称未填写";
} else if (TextUtils.isEmpty(getConferenceHyrs())) {
return "会议人数未填写";
} else {
return "";
}

@ -2,17 +2,32 @@ package com.rehome.zhdcoa.ui.activity;
import android.content.Intent;
import android.view.View;
import android.widget.AbsListView;
import android.widget.ListView;
import android.widget.ProgressBar;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.rehome.zhdcoa.Contans;
import com.rehome.zhdcoa.R;
import com.rehome.zhdcoa.base.BaseActivity;
import com.rehome.zhdcoa.bean.ApplyListConferenceBean;
import com.rehome.zhdcoa.utils.ApplyListUtils;
import com.rehome.zhdcoa.weiget.LoadListView;
public class ApplyConferenceActivity extends BaseActivity implements ApplyListUtils.OnItemClickListener {
ListView lv;
LoadListView lv;
SwipeRefreshLayout swipe_refresh_layout;
private int mColor;
// private int page = 1; // 当前页码
// private int pageSize = 20; // 每页展示条数
private boolean isLoading = false;
private ApplyListUtils applyListUtils;
@Override
public int getLayoutId() {
return R.layout.activity_apply_conference;
@ -30,7 +45,25 @@ public class ApplyConferenceActivity extends BaseActivity implements ApplyListUt
}
});
applyListUtils = ApplyListUtils.newBuilder()
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYCONFERENCE, userInfo.getManid())
.setListener(this)
.builder(this);
applyListUtils.setOnLoadMoreDataFinishListener(new ApplyListUtils.OnLoadMoreDataFinishListener() {
@Override
public void onFinish() {
lv.loadComplete();
}
});
lv.setInterface(new LoadListView.ILoadListener() {
@Override
public void onLoad() {
applyListUtils.loadMoreData();
}
});
}
private void findView() {
@ -46,12 +79,6 @@ public class ApplyConferenceActivity extends BaseActivity implements ApplyListUt
@Override
public void initData() {
ApplyListUtils.newBuilder()
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYCONFERENCE, userInfo.getManid())
.setListener(this)
.builder(this);
}
@Override
@ -59,7 +86,7 @@ public class ApplyConferenceActivity extends BaseActivity implements ApplyListUt
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_CODE_ADD) {
ApplyListUtils.newBuilder()
applyListUtils = ApplyListUtils.newBuilder()
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYCONFERENCE, userInfo.getManid())
.setListener(this)

@ -46,7 +46,7 @@ import java.util.List;
import retrofit2.Call;
import retrofit2.Response;
public class ApplyConferenceAuditActivity extends BaseActivity implements View.OnClickListener, GetAuditPermissionUtils.GetAuditPermissionUtilsListener, SaveApplyUtils.SaveApplyUtilsListener {
public class ApplyConferenceAuditActivity extends BaseActivity implements GetAuditPermissionUtils.GetAuditPermissionUtilsListener, SaveApplyUtils.SaveApplyUtilsListener {
private static final int REQUEST_MEETROOM = 1;
private int status = 0;
@ -63,6 +63,7 @@ public class ApplyConferenceAuditActivity extends BaseActivity implements View.O
Button btnCommit;
Button btnSave;
Button btn_shlc;
Button btn_sh;
InputLayout ilConferenceHynr;
InputLayout ilConferenceSm;
CbRbLayout cbIdea;
@ -87,6 +88,11 @@ public class ApplyConferenceAuditActivity extends BaseActivity implements View.O
ilIdea = findViewById(R.id.il_idea);
llAudit = findViewById(R.id.ll_audit);
btn_shlc = findViewById(R.id.btn_shlc);
btn_sh = findViewById(R.id.btn_sh);
btn_sh.setVisibility(View.GONE);
btn_shlc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -94,31 +100,10 @@ public class ApplyConferenceAuditActivity extends BaseActivity implements View.O
dialog.show();
}
});
}
private ApplyListConferenceBean.RowsBean applyList;
private Intent intent;
private String ListId, listcode, Suplistid, DepartmentNameId;
private String itemid, rangeID;
private boolean isAudit = true;
private DropDownBean.RowsBean bean = null;
private ConferenceBean conferenceBean;
private List<GetAuditBean.RowsBean.StepSHListBean> datas;
@Override
public int getLayoutId() {
return R.layout.activity_apply_conference_audit;
}
@Override
public void initView() {
findView();
initToolbar("会议室审核", "审核", this);
}
btn_sh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// 2017/7/15 会议室修改,待测试
if (status != STUTUS_UPDATE) {
if (isAudit) {
if (!cbIdea.getRb1Check()) {
@ -139,11 +124,8 @@ public class ApplyConferenceAuditActivity extends BaseActivity implements View.O
}
}).show();
} else {
// showToast("没有审核权限");
toastviewbymyself.makeText(context, "没有审核权限", Toast.LENGTH_LONG).show();
}
} else {
@ -161,10 +143,42 @@ public class ApplyConferenceAuditActivity extends BaseActivity implements View.O
}
}).show();
}
}
});
}
private ApplyListConferenceBean.RowsBean applyList;
private Intent intent;
private String ListId, listcode, Suplistid, DepartmentNameId;
private String itemid, rangeID;
private boolean isAudit = true;
private DropDownBean.RowsBean bean = null;
private ConferenceBean conferenceBean;
private List<GetAuditBean.RowsBean.StepSHListBean> datas;
@Override
public int getLayoutId() {
return R.layout.activity_apply_conference_audit;
}
@Override
public void initView() {
findView();
initToolbar("会议室审核", "", new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
}
// @Override
// public void onClick(View v) {
// // 2017/7/15 会议室修改,待测试
//
// }
private void setAudit() {
String idea = "";
@ -350,13 +364,28 @@ public class ApplyConferenceAuditActivity extends BaseActivity implements View.O
setToolbarTitle(bean.getRows().get(0).getAuditName());
if (rowsBean.getAuditState().equals("1")) {
initToolbar(rowsBean.getAuditName(), "", this);
} else if (rowsBean.getAuditState().equals("0")) {
// if (rowsBean.getAuditState().equals("1")) {
//
// initToolbar(rowsBean.getAuditName(), "", this);
//
// } else if (rowsBean.getAuditState().equals("0")) {
//
// initToolbar(rowsBean.getAuditName(), "", this);
// }
initToolbar(rowsBean.getAuditName(), "", this);
String auditStatus=rowsBean.getAuditState();
showLog("---------auditStatus-------");
showLog(auditStatus);
if(auditStatus!=null){
//0无权限1己审核2有权限
//有审核权限 2
if (!auditStatus.equals("2")) {
//无审核权限
btn_sh.setVisibility(View.GONE);
}else{
//有审核权限
btn_sh.setVisibility(View.VISIBLE);
}
}
rangeID = bean.getRows().get(0).getRange();

@ -257,9 +257,8 @@ public class ApplyConferenceDetailActivity extends BaseActivity implements Confe
private String createJson(String istj) {
String json = "";
if (isEdit) {
if(conferenceBean!=null&&conferenceBean.getDataRows()!=null&&conferenceBean.getDataRows().size()>0){
conferenceLayout.getInputData(conferenceBean.getDataRows().get(0));
String str = "";
String strleader = "";
@ -289,17 +288,14 @@ public class ApplyConferenceDetailActivity extends BaseActivity implements Confe
conferenceBean.getRows().get(0).setIstj(istj);
conferenceBean.getRows().get(0).setModifiedby(userInfo.getManid());
if (!TextUtils.isEmpty(conferenceBean.getDataRows().get(0).checkData())) {
toastviewbymyself.makeText(context, conferenceBean.getDataRows().get(0).checkData(), Toast.LENGTH_LONG).show();
return null;
}
json = GsonUtils.GsonString(conferenceBean);
return json;
}
return null;
} else {
ConferenceBean conferenceBean = new ConferenceBean();

@ -2,7 +2,11 @@ package com.rehome.zhdcoa.ui.activity;
import android.content.Intent;
import android.view.View;
import android.widget.AbsListView;
import android.widget.ListView;
import android.widget.ProgressBar;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.rehome.zhdcoa.Contans;
import com.rehome.zhdcoa.R;
@ -10,10 +14,15 @@ import com.rehome.zhdcoa.base.BaseActivity;
import com.rehome.zhdcoa.bean.ApplyListBean;
import com.rehome.zhdcoa.utils.ApplyListUtils;
import com.rehome.zhdcoa.utils.GsonUtils;
import com.rehome.zhdcoa.weiget.LoadListView;
public class ApplyDinnerActivity extends BaseActivity implements ApplyListUtils.OnItemClickListener {
ListView lv;
LoadListView lv;
private boolean isLoading = false;
private ApplyListUtils applyListUtils;
private void findView() {
lv = findViewById(R.id.lv);
@ -36,18 +45,49 @@ public class ApplyDinnerActivity extends BaseActivity implements ApplyListUtils.
startActivityForResult(intent, REQUEST_CODE_ADD);
}
});
}
@Override
public void initData() {
// userInfo = App.getInstance().getUserInfo();
ApplyListUtils.newBuilder()
applyListUtils = ApplyListUtils.newBuilder()
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYDINNER, userInfo.getManid())
.setListener(this)
.builder(this);
applyListUtils.setOnLoadMoreDataFinishListener(new ApplyListUtils.OnLoadMoreDataFinishListener() {
@Override
public void onFinish() {
lv.loadComplete();
}
});
lv.setInterface(new LoadListView.ILoadListener() {
@Override
public void onLoad() {
applyListUtils.loadMoreData();
}
});
// lv.setOnScrollListener(new AbsListView.OnScrollListener() {
// @Override
// public void onScrollStateChanged(AbsListView view, int scrollState) {}
//
// @Override
// public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
// if (firstVisibleItem + visibleItemCount >= totalItemCount && !isLoading) {
// if(applyListUtils!=null){
// isLoading = true; // 设置加载状态为true
// progress_bar.setVisibility(View.VISIBLE);
// applyListUtils.loadMoreData();
// //loadMoreData(); // 加载更多数据
// }
// }
// }
// });
}
@Override
public void initData() {
}
@Override
@ -55,7 +95,7 @@ public class ApplyDinnerActivity extends BaseActivity implements ApplyListUtils.
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_CODE_ADD) {
ApplyListUtils.newBuilder()
applyListUtils = ApplyListUtils.newBuilder()
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYDINNER, userInfo.getManid())
.setListener(this)

@ -79,4 +79,5 @@ public class ApplyOfficeAddActivity extends BaseActivity implements ApplyListUti
}
}
}
}

@ -1,8 +1,14 @@
package com.rehome.zhdcoa.ui.activity;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.widget.AbsListView;
import android.widget.ListView;
import android.widget.ProgressBar;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.rehome.zhdcoa.Contans;
import com.rehome.zhdcoa.R;
@ -12,14 +18,21 @@ import com.rehome.zhdcoa.bean.ApplyListVehicleBean;
import com.rehome.zhdcoa.bean.JsycBean;
import com.rehome.zhdcoa.utils.ApplyListUtils;
import com.rehome.zhdcoa.utils.HttpUtils;
import com.rehome.zhdcoa.weiget.LoadListView;
import retrofit2.Call;
import retrofit2.Response;
public class ApplyVehicleActivity extends BaseActivity implements ApplyListUtils.OnItemClickListener {
ListView lv;
LoadListView lv;
SwipeRefreshLayout swipe_refresh_layout;
private String vehiclech, listid;
private boolean isLoading = false;
private ApplyListUtils applyListUtils;
@Override
public int getLayoutId() {
return R.layout.activity_apply_vehicle;
@ -37,15 +50,66 @@ public class ApplyVehicleActivity extends BaseActivity implements ApplyListUtil
startActivityForResult(intent, REQUEST_CODE_ADD);
}
});
}
@Override
public void initData() {
ApplyListUtils.newBuilder()
applyListUtils = ApplyListUtils.newBuilder()
.setListener(this)
.setParams(Contans.LISTCODE.APPLYVEHICLE, userInfo.getManid())
.setListView(lv)
.builder(this);
applyListUtils.setOnLoadMoreDataFinishListener(new ApplyListUtils.OnLoadMoreDataFinishListener() {
@Override
public void onFinish() {
lv.loadComplete();
}
});
lv.setInterface(new LoadListView.ILoadListener() {
@Override
public void onLoad() {
applyListUtils.loadMoreData();
}
});
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// isLoading = false; // 恢复加载状态
// // 隐藏进度条
// progress_bar.setVisibility(View.GONE);
// }
// }, 20000); // 模拟2秒钟的数据加载
}
@Override
public void initData() {
// applyListUtils = ApplyListUtils.newBuilder()
// .setListener(this)
// .setParams(Contans.LISTCODE.APPLYVEHICLE, userInfo.getManid())
// .setListView(lv)
// .builder(this);
// applyListUtils.setOnLoadDataFinishByInitListener(new ApplyListUtils.OnLoadDataFinishByInitListener() {
// @Override
// public void onFinish() {
// lv.setOnScrollListener(new AbsListView.OnScrollListener() {
// @Override
// public void onScrollStateChanged(AbsListView view, int scrollState) {}
//
// @Override
// public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
// if (firstVisibleItem + visibleItemCount >= totalItemCount && !isLoading) {
// if(applyListUtils!=null){
// isLoading = true; // 设置加载状态为true
// progress_bar.setVisibility(View.VISIBLE);
// applyListUtils.loadMoreData();
// //loadMoreData(); // 加载更多数据
// }
// }
// }
// });
// }
// });
}
@Override
@ -96,11 +160,20 @@ public class ApplyVehicleActivity extends BaseActivity implements ApplyListUtil
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_CODE_ADD) {
ApplyListUtils.newBuilder()
applyListUtils = ApplyListUtils.newBuilder()
.setListener(this)
.setParams(Contans.LISTCODE.APPLYVEHICLE, userInfo.getManid())
.setListView(lv)
.builder(ApplyVehicleActivity.this);
// applyListUtils.setOnLoadDataFinishByInitListener(new ApplyListUtils.OnLoadDataFinishByInitListener() {
// @Override
// public void onFinish() {
// isLoading = false; // 恢复加载状态
// // 隐藏进度条
// progress_bar.setVisibility(View.GONE);
// applyListUtils.setPage(1);
// }
// });
}
}
}

@ -50,7 +50,7 @@ import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.Response;
public class ApplyVehicleAuditActivity extends BaseActivity implements View.OnClickListener, GetAuditPermissionUtils.GetAuditPermissionUtilsListener {
public class ApplyVehicleAuditActivity extends BaseActivity implements GetAuditPermissionUtils.GetAuditPermissionUtilsListener {
InputLayout ilName;
InputLayout ilVehicleCfsj;
@ -72,6 +72,7 @@ public class ApplyVehicleAuditActivity extends BaseActivity implements View.OnCl
InputLayout ilTEL;
InputLayout ilSm;
Button btnDx;
Button btn_sh;
InputLayout ilDriverID;
private void findView() {
@ -94,8 +95,11 @@ public class ApplyVehicleAuditActivity extends BaseActivity implements View.OnCl
ilTEL = findViewById(R.id.il_TEL);
ilSm = findViewById(R.id.il_sm);
btnDx = findViewById(R.id.btn_dx);
btn_sh = findViewById(R.id.btn_sh);
ilDriverID = findViewById(R.id.il_driverID);
btnShlc = findViewById(R.id.btn_shlc);
btn_sh.setVisibility(View.GONE);
btnShlc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -103,6 +107,43 @@ public class ApplyVehicleAuditActivity extends BaseActivity implements View.OnCl
dialog.show();
}
});
btn_sh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (isAudit) {
AuditDialog dialog = new AuditDialog(context, "是否审核", new AuditDialog.AuditDialogListener() {
@Override
public void confirm() {
saveData();
}
@Override
public void cancel() {
}
});
dialog.show();
} else {
if (isFinish) {
AuditDialog dialog = new AuditDialog(context, "你确定修改吗?", new AuditDialog.AuditDialogListener() {
@Override
public void confirm() {
saveData();
}
@Override
public void cancel() {
}
});
dialog.show();
} else {
toastviewbymyself.makeText(context, "没有审核权限", Toast.LENGTH_LONG).show();
}
}
}
});
}
private ApplyListVehicleBean.RowsBean applyList;
@ -132,7 +173,13 @@ public class ApplyVehicleAuditActivity extends BaseActivity implements View.OnCl
@Override
public void initView() {
findView();
initToolbar("预定车辆审核", "审核", this);
initToolbar("预定车辆审核", "", new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
btnDx.setVisibility(View.GONE);
if (userInfo.getManid().equals("310261")) {
btnDx.setVisibility(View.VISIBLE);
} else {
@ -152,32 +199,10 @@ public class ApplyVehicleAuditActivity extends BaseActivity implements View.OnCl
btnDx.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Api api = HttpUtils.getApi(context);
api.DX(ListId, "李耿").enqueue(new BaseCallBack<ResultBean>(context) {
@Override
public void onSuccess(Call<ResultBean> call, Response<ResultBean> response) {
ResultBean bean = response.body();
if (bean != null) {
showToast(bean.getRows().get(0).getMsg());
}
}
@Override
public void onError(Call<ResultBean> call, Throwable t) {
}
});
}
});
}
@Override
public void onClick(View v) {
if (isAudit) {
AuditDialog dialog = new AuditDialog(context, "是否审核", new AuditDialog.AuditDialogListener() {
AuditDialog dialog = new AuditDialog(context, "您确定要发送短信吗?", new AuditDialog.AuditDialogListener() {
@Override
public void confirm() {
saveData();
sendSms();
}
@Override
@ -186,30 +211,15 @@ public class ApplyVehicleAuditActivity extends BaseActivity implements View.OnCl
}
});
dialog.show();
} else {
if (isFinish) {
AuditDialog dialog = new AuditDialog(context, "你确定修改吗?", new AuditDialog.AuditDialogListener() {
@Override
public void confirm() {
saveData();
}
@Override
public void cancel() {
}
});
dialog.show();
} else {
// showToast("没有审核权限");
toastviewbymyself.makeText(context, "没有审核权限", Toast.LENGTH_LONG).show();
}
}
}
// @Override
// public void onClick(View v) {
//
// }
private void saveData() {
SaveApplyUtils.newBuilder().setjson(createJson()).setListener(new SaveApplyUtils.SaveApplyUtilsListener() {
@ -228,6 +238,25 @@ public class ApplyVehicleAuditActivity extends BaseActivity implements View.OnCl
.builder(ApplyVehicleAuditActivity.this);
}
private void sendSms() {
showLog("sendSms");
Api api = HttpUtils.getApi(context);
api.DX(ListId, "李耿").enqueue(new BaseCallBack<ResultBean>(context) {
@Override
public void onSuccess(Call<ResultBean> call, Response<ResultBean> response) {
ResultBean bean = response.body();
if (bean != null) {
showToast(bean.getRows().get(0).getMsg());
}
}
@Override
public void onError(Call<ResultBean> call, Throwable t) {
}
});
}
private void setAudit() {
String idea = "";
if (cbIdea.getRb1Check()) {
@ -416,11 +445,27 @@ public class ApplyVehicleAuditActivity extends BaseActivity implements View.OnCl
isAudit = false;
llAudit.setVisibility(View.GONE);
}
if (rowsBean.getAuditState().equals("1")) {
initToolbar("预定车辆" + rowsBean.getAuditName(), "", this);
} else if (rowsBean.getAuditState().equals("0")) {
initToolbar("预定车辆" + rowsBean.getAuditName(), "", this);
// if (rowsBean.getAuditState().equals("1")) {
// initToolbar("预定车辆" + rowsBean.getAuditName(), "", this);
// } else if (rowsBean.getAuditState().equals("0")) {
// initToolbar("预定车辆" + rowsBean.getAuditName(), "", this);
// }
String auditStatus=rowsBean.getAuditState();
showLog("---------auditStatus-------");
showLog(auditStatus);
if(auditStatus!=null){
//0无权限1己审核2有权限
//有审核权限 2
if (!auditStatus.equals("2")) {
//无审核权限
btn_sh.setVisibility(View.GONE);
}else{
//有审核权限
btn_sh.setVisibility(View.VISIBLE);
}
}
showView(vehicleBean);
if (TextUtils.isEmpty(rowsBean.getItemid())) {
//没有审核权限,不可编辑

@ -235,8 +235,9 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
// binding.etPassword.setText("@Ojr310285")
// binding.etUsername.setText("310561")
// binding.etPassword.setText("Yangjing!0561")
//李耿
binding.etUsername.setText("310261")
binding.etPassword.setText("!LLg770731")
// binding.etUsername.setText("310534")
// binding.etPassword.setText("abCd*1234")

@ -89,8 +89,14 @@ public class ApplyListUtils {
private GetRadioListAdapter getRadioListAdapter;
private MyadviceAdapter myadviceAdapter;
OnLoadMoreDataFinishListener onLoadMoreDataFinishListener;
private Activity context;
private int page = 1; // 当前页码
private int pageSize = 20; // 每页展示条数
private ApplyListUtils(Activity context) {
//api = HttpUtils.getApi(context);
@ -114,7 +120,622 @@ public class ApplyListUtils {
return builder;
}
private void init() {
public static Builder getBuilder() {
return builder;
}
public static void setBuilder(Builder builder) {
ApplyListUtils.builder = builder;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
private void init() {
userInfo = App.getInstance().getUserInfo();
String listcode = builder.params.get("listcode");
String proposerid = builder.params.get("proposerid");
String times = builder.params.get("times");
String timee = builder.params.get("timee");
String manid = userInfo.getManid();
String departmentnameid = userInfo.getBzbh();
String url = Contans.BASE_URL + Contans.GET_ORDER_LIST_RSA_URL;
Request<String> request = NoHttp.createStringRequest(url, RequestMethod.GET);
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
request.add("departmentnameid",departmentnameid);
if(page<1){
page=1;
}
request.add("page",String.valueOf(page));
request.add("pageSize",String.valueOf(pageSize));
showLog("---------listcode--------");
showLog(listcode);
if (listcode.equals(Contans.LISTCODE.RECEIVEVISIT)) {
//获取接待来访详情列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYCONFERENCE)) {
//获取会议室详情列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.ORDINARYVISIT)) {
//获取订餐列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYTRAVEL)) {
//获取出差申请列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYVEHICLE)) {
//获取用车申请详情列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.OTHERTASK)) {
//获取他人任务详情列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYORDER)) {
//获取送餐详情列表
request.add("platform","0");
request.add("login_userid","");
request.add("istj","");
} else if (listcode.equals(Contans.LISTCODE.APPLYDINNER)) {
//订餐申请
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)) {
//获取申请列表
url = Contans.BASE_URL + Contans.GETAPPLYLIST2_RSA_URL;
request = NoHttp.createStringRequest(url, RequestMethod.GET);
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
request.add("times",times);
request.add("timee",timee);
} else if (listcode.equals(Contans.LISTCODE.APPLYFACILITIES)) {
//获取申请列表
url = Contans.BASE_URL + Contans.GETAPPLYLIST2_RSA_URL;
request = NoHttp.createStringRequest(url, RequestMethod.GET);
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
request.add("times",times);
request.add("timee",timee);
} else if (listcode.equals(Contans.LISTCODE.APPLYSUGGESTION)) {
//建议汇总和我的建议
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
} else {
//没有就是else里面
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
request.add("times",times);
request.add("timee",timee);
}
NohttpUtils.getInstance().add(context, 0, request, new HttpListener<String>() {
@Override
public void onSucceed(int what, com.yolanda.nohttp.rest.Response<String> response) {
showLog("----------------");
String result = response.get();
if(listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)||listcode.equals(Contans.LISTCODE.APPLYFACILITIES)){
if (listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(result,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
datas.clear();
}
}
}
if (listcode.equals(Contans.LISTCODE.APPLYFACILITIES)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(result,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
datas.clear();
}
}
}
}else{
String jsonDecode = RSAUtils.decryptBASE64StrClient(result);
showLog(result);
showLog(jsonDecode);
if (TextUtils.isEmpty(jsonDecode)) {
showToast(UiUtlis.getString(context, R.string.data_error));
} else {
if (listcode.equals(Contans.LISTCODE.RECEIVEVISIT)) {
ApplyListReceiveBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListReceiveBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
receiveDatas.clear();
receiveDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
receiveDatas.clear();
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYCONFERENCE)) {
ApplyListConferenceBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListConferenceBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog("--------->>>-------");
showLog(String.valueOf(baseResult.getRows().size()));
conferenceDatas.clear();
conferenceDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
conferenceDatas.clear();
}
}
} else if (listcode.equals(Contans.LISTCODE.ORDINARYVISIT)) {
ApplyOrdinaryVisitBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyOrdinaryVisitBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
ordinaryVisiDatas.clear();
ordinaryVisiDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
conferenceDatas.clear();
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYTRAVEL)) {
ApplyTravelListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyTravelListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
travelListDatas.clear();
travelListDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
travelListDatas.clear();
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYVEHICLE)) {
ApplyListVehicleBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListVehicleBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
vehicleDatas.clear();
vehicleDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
vehicleDatas.clear();
}
}
} else if (listcode.equals(Contans.LISTCODE.OTHERTASK)) {
ApplyListOtherTaskBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListOtherTaskBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
otherTaskDatas.clear();
otherTaskDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
otherTaskDatas.clear();
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYORDER)) {
ApplyListTakeOutBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListTakeOutBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
takeOutDatas.clear();
takeOutDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
takeOutDatas.clear();
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYDINNER)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
datas.clear();
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
datas.clear();
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYSUGGESTION)) {
MyadviceBean myadviceBean = GsonUtils.GsonToBean(jsonDecode,MyadviceBean.class);
if (myadviceBean != null) {
if (!myadviceBean.getTotal().equals("0")) {
showLog(String.valueOf(myadviceBean.getRows().size()));
myadviceDatas.clear();
myadviceDatas.addAll(myadviceBean.getRows());
setListAdapter(listcode);
} else {
myadviceDatas.clear();
}
}
} else {
//没有就是else里面
ApplyListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
datas.clear();
}
}
}
}
}
}
@Override
public void onFailed(int what, com.yolanda.nohttp.rest.Response<String> response) {
}
});
// if (listcode == Contans.LISTCODE.RECEIVEVISIT) {
//
// api.getReceiveList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListReceiveBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListReceiveBean> call, Response<ApplyListReceiveBean> response) {
// ApplyListReceiveBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// receiveDatas.clear();
// receiveDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// receiveDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListReceiveBean> call, Throwable t) {
//
// }
// });
//
// } else if (listcode == Contans.LISTCODE.APPLYCONFERENCE) {
//
// api.getConferenceList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListConferenceBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListConferenceBean> call, Response<ApplyListConferenceBean> response) {
// ApplyListConferenceBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// conferenceDatas.clear();
// conferenceDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// conferenceDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListConferenceBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.ORDINARYVISIT) {
//
// api.getOrdinaryVisitList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyOrdinaryVisitBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyOrdinaryVisitBean> call, Response<ApplyOrdinaryVisitBean> response) {
//
// ApplyOrdinaryVisitBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// ordinaryVisiDatas.clear();
// ordinaryVisiDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// conferenceDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyOrdinaryVisitBean> call, Throwable t) {
//
// }
// });
// } else if (listcode == Contans.LISTCODE.APPLYTRAVEL) {
//
// api.getApplyTraveList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyTravelListBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyTravelListBean> call, Response<ApplyTravelListBean> response) {
// ApplyTravelListBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// travelListDatas.clear();
// travelListDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// travelListDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyTravelListBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.APPLYVEHICLE) {
//
// api.getVehicleList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListVehicleBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListVehicleBean> call, Response<ApplyListVehicleBean> response) {
//
// ApplyListVehicleBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// vehicleDatas.clear();
// vehicleDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// vehicleDatas.clear();
// }
// }
//
// }
//
// @Override
// public void onError(Call<ApplyListVehicleBean> call, Throwable t) {
//
// }
// });
//
// } else if (listcode == Contans.LISTCODE.OTHERTASK) {
// api.getOtherTaskList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListOtherTaskBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListOtherTaskBean> call, Response<ApplyListOtherTaskBean> response) {
// ApplyListOtherTaskBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// otherTaskDatas.clear();
// otherTaskDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// otherTaskDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListOtherTaskBean> call, Throwable t) {
//
// }
// });
//
// } else if (listcode == Contans.LISTCODE.APPLYORDER) {
//
// api.getTakeOutList2(listcode, "0", manid,"", departmentnameid,"").enqueue(new BaseCallBack<ApplyListTakeOutBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListTakeOutBean> call, Response<ApplyListTakeOutBean> response) {
// ApplyListTakeOutBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// takeOutDatas.clear();
// takeOutDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// takeOutDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListTakeOutBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.APPLYDINNER) {
//
// api.getApplyList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
//
// @Override
// public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
// ApplyListBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// datas.clear();
// datas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// datas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.APPLYSUPPLIES) {
//
// api.getApplyList2(listcode, proposerid, times, timee).enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
//
// @Override
// public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
// ApplyListBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// datas.clear();
// datas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// datas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.APPLYSUGGESTION) {
//
//// api.getMyAdvice(listcode,manid, proposerid).enqueue(new BaseCallBack<MyadviceBean>(builder.context) {
//// @Override
//// public void onSuccess(Call<MyadviceBean> call, Response<MyadviceBean> response) {
////
//// MyadviceBean myadviceBean = response.body();
//// if (myadviceBean != null) {
//// myadviceBean.getTotal();
//// if (!myadviceBean.getTotal().equals("0")) {
//// myadviceDatas.clear();
//// myadviceDatas.addAll(myadviceBean.getRows());
//// setListAdapter(listcode);
//// } else {
//// myadviceDatas.clear();
//// }
////
//// }
////
////
//// }
////
//// @Override
//// public void onError(Call<MyadviceBean> call, Throwable t) {
////
//// }
//// });
//
// api.getMyAdviceRsa(listcode,manid, proposerid).enqueue(new BaseCallBack<String>(builder.context) {
// @Override
// public void onSuccess(Call<String> call, Response<String> response) {
//
// String result = response.body();
// showLog("-----getMyAdviceRsa----");
// showLog(result);
//
// String jsonDecode = RSAUtils.decryptBASE64StrClient(result);
// showLog(jsonDecode);
// if (TextUtils.isEmpty(jsonDecode)) {
// showToast(UiUtlis.getString(context, R.string.data_error));
// } else {
// showToast(jsonDecode);
// MyadviceBean myadviceBean = GsonUtils.GsonToBean(jsonDecode,MyadviceBean.class);
// if (myadviceBean != null) {
// myadviceBean.getTotal();
// if (!myadviceBean.getTotal().equals("0")) {
// myadviceDatas.clear();
// myadviceDatas.addAll(myadviceBean.getRows());
// setListAdapter(listcode);
// } else {
// myadviceDatas.clear();
// }
// }
// }
// }
//
// @Override
// public void onError(Call<String> call, Throwable t) {
//
// }
// });
//
//
// } else {
// //没有就是else里面
// api.getApplyList(listcode, proposerid,manid, times, timee).enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
//
// @Override
// public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
// ApplyListBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// datas.clear();
// datas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// datas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListBean> call, Throwable t) {
//
// }
// });
// }
}
public void loadMoreData() {
userInfo = App.getInstance().getUserInfo();
String listcode = builder.params.get("listcode");
@ -132,6 +753,8 @@ public class ApplyListUtils {
request.add("departmentnameid",departmentnameid);
request.add("page",String.valueOf(page));
request.add("pageSize",String.valueOf(pageSize));
showLog("---------listcode--------");
showLog(listcode);
@ -204,17 +827,22 @@ public class ApplyListUtils {
showLog("----------------");
String result = response.get();
if(onLoadMoreDataFinishListener!=null){
onLoadMoreDataFinishListener.onFinish();
}
if(listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)||listcode.equals(Contans.LISTCODE.APPLYFACILITIES)){
if (listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(result,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
adapter.notifyDataSetChanged();
} else {
datas.clear();
showToast("没有更多数据啦");
}
}
}
@ -222,12 +850,12 @@ public class ApplyListUtils {
ApplyListBean baseResult = GsonUtils.GsonToBean(result,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
adapter.notifyDataSetChanged();
} else {
datas.clear();
showToast("没有更多数据啦");
}
}
}
@ -242,121 +870,125 @@ public class ApplyListUtils {
ApplyListReceiveBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListReceiveBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
receiveDatas.clear();
receiveDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
receiveAdapter.notifyDataSetChanged();
} else {
receiveDatas.clear();
showToast("没有更多数据啦");
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYCONFERENCE)) {
ApplyListConferenceBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListConferenceBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog("--------->>>-------");
showLog(String.valueOf(baseResult.getRows().size()));
conferenceDatas.clear();
conferenceDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
conferenceAdapter.notifyDataSetChanged();
} else {
conferenceDatas.clear();
showToast("没有更多数据啦");
}
}
} else if (listcode.equals(Contans.LISTCODE.ORDINARYVISIT)) {
ApplyOrdinaryVisitBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyOrdinaryVisitBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
ordinaryVisiDatas.clear();
ordinaryVisiDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
ordinaryVisitAdapter.notifyDataSetChanged();
} else {
conferenceDatas.clear();
showToast("没有更多数据啦");
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYTRAVEL)) {
ApplyTravelListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyTravelListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
travelListDatas.clear();
travelListDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
travelAdapter.notifyDataSetChanged();
} else {
travelListDatas.clear();
showToast("没有更多数据啦");
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYVEHICLE)) {
ApplyListVehicleBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListVehicleBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
vehicleDatas.clear();
vehicleDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
vehicleAdapter.notifyDataSetChanged();
} else {
vehicleDatas.clear();
showToast("没有更多数据啦");
}
}
} else if (listcode.equals(Contans.LISTCODE.OTHERTASK)) {
ApplyListOtherTaskBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListOtherTaskBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
otherTaskDatas.clear();
otherTaskDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
vehicleAdapter.notifyDataSetChanged();
} else {
otherTaskDatas.clear();
showToast("没有更多数据啦");
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYORDER)) {
ApplyListTakeOutBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListTakeOutBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
takeOutDatas.clear();
//takeOutDatas.clear();
takeOutDatas.addAll(baseResult.getRows());
setListAdapter(listcode);
adapter.notifyDataSetChanged();
} else {
takeOutDatas.clear();
showToast("没有更多数据啦");
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYDINNER)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
//datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
applyDinnerListAdapter.notifyDataSetChanged();
} else {
datas.clear();
showToast("没有更多数据啦");
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
//datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
adapter.notifyDataSetChanged();
} else {
datas.clear();
showToast("没有更多数据啦");
}
}
} else if (listcode.equals(Contans.LISTCODE.APPLYSUGGESTION)) {
MyadviceBean myadviceBean = GsonUtils.GsonToBean(jsonDecode,MyadviceBean.class);
if (myadviceBean != null) {
if (!myadviceBean.getTotal().equals("0")) {
page++;
showLog(String.valueOf(myadviceBean.getRows().size()));
myadviceDatas.clear();
//myadviceDatas.clear();
myadviceDatas.addAll(myadviceBean.getRows());
setListAdapter(listcode);
myadviceAdapter.notifyDataSetChanged();
} else {
myadviceDatas.clear();
showToast("没有更多数据啦");
}
}
} else {
@ -364,12 +996,13 @@ public class ApplyListUtils {
ApplyListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
page++;
showLog(String.valueOf(baseResult.getRows().size()));
datas.clear();
//datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
adapter.notifyDataSetChanged();
} else {
datas.clear();
showToast("没有更多数据啦");
}
}
}
@ -698,14 +1331,12 @@ public class ApplyListUtils {
// });
// }
}
/**
* listView Adapter
*/
private void setListAdapter(String listCode) {
if(listCode.equals(Contans.LISTCODE.RECEIVEVISIT)) {
if (receiveAdapter == null) {
receiveAdapter = new ApplyReceiveAdapter(builder.context, receiveDatas);
builder.listView.setAdapter(receiveAdapter);
@ -919,6 +1550,8 @@ public class ApplyListUtils {
private Map<String, String> params;
private OnItemClickListener listener;
public Builder setListView(ListView listView) {
@ -931,7 +1564,6 @@ public class ApplyListUtils {
return builder;
}
public Builder setParams(String listcode, String proposerid) {
params = new HashMap<>();
params.put("listcode", listcode);
@ -974,6 +1606,18 @@ public class ApplyListUtils {
void onItemClick(Object object);
}
public interface OnLoadMoreDataFinishListener {
void onFinish();
}
public OnLoadMoreDataFinishListener getOnLoadMoreDataFinishListener() {
return onLoadMoreDataFinishListener;
}
public void setOnLoadMoreDataFinishListener(OnLoadMoreDataFinishListener onLoadMoreDataFinishListener) {
this.onLoadMoreDataFinishListener = onLoadMoreDataFinishListener;
}
public void showLog(String logText) {
if (isApkInDebug(context)) {
if(TextUtils.isEmpty(logText)){
@ -1003,4 +1647,6 @@ public class ApplyListUtils {
public void showToast(int strId) {
Toast.makeText(context, strId, Toast.LENGTH_SHORT).show();
}
}

@ -0,0 +1,106 @@
package com.rehome.zhdcoa.weiget;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.RotateAnimation;
import android.widget.AbsListView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.rehome.zhdcoa.R;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* listview
*/
public class LoadListView extends ListView implements AbsListView.OnScrollListener {
View footer;// 底部布局;
int totalItemCount;// 总数量;
int lastVisibleItem;// 最后一个可见的item
boolean isLoading;// 正在加载数据;
ILoadListener iLoadListener;
public LoadListView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
initView(context);
}
/**
* listview
*
* @param context
*/
private void initView(Context context) {
LayoutInflater inflater = LayoutInflater.from(context);
footer = inflater.inflate(R.layout.footer_layout, null);
footer.findViewById(R.id.load_layout).setVisibility(View.GONE);
this.addFooterView(footer);
this.setOnScrollListener(this);
}
/**
*
* @param view
* @param firstVisibleItem
* @param visibleItemCount
* @param totalItemCount
*/
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
// TODO Auto-generated method stub
this.lastVisibleItem = firstVisibleItem + visibleItemCount;
this.totalItemCount = totalItemCount;
}
/**
*
* @param view
* @param scrollState
*/
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
// totalItemCount == lastVisibleItem相等时说明滑到了底部
if (totalItemCount == lastVisibleItem && scrollState == SCROLL_STATE_IDLE) {
if (!isLoading) {
isLoading = true;
footer.findViewById(R.id.load_layout).setVisibility(
View.VISIBLE);
if(iLoadListener!=null) {
// 加载更多
iLoadListener.onLoad();
}
}
}
}
/**
*
*/
public void loadComplete(){
isLoading = false;
footer.findViewById(R.id.load_layout).setVisibility(
View.GONE);
}
/**
*
*/
public void setInterface(ILoadListener iLoadListener){
this.iLoadListener = iLoadListener;
}
//加载更多数据的回调接口
public interface ILoadListener{
public void onLoad();
}
}

@ -7,11 +7,11 @@
<include layout="@layout/layout_base"/>
<ListView
<com.rehome.zhdcoa.weiget.LoadListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="@color/gray"
android:dividerHeight="1px"/>
</LinearLayout>

@ -93,16 +93,43 @@
<include layout="@layout/layout_audit"/>
<!-- <Button-->
<!-- android:id="@+id/btn_shlc"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="70px"-->
<!-- android:layout_margin="10dp"-->
<!-- android:layout_weight="1"-->
<!-- android:background="@drawable/btn_blue"-->
<!-- android:text="查看审批流程"-->
<!-- android:textColor="@color/white"/>-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:visibility="visible">
<Button
android:id="@+id/btn_shlc"
android:layout_width="match_parent"
android:layout_height="70px"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/btn_blue"
android:text="查看审批流程"
android:textColor="@color/white"/>
<Button
android:id="@+id/btn_sh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/btn_blue"
android:text="审核"
android:textColor="@color/white"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="120px"

@ -6,11 +6,11 @@
<include layout="@layout/layout_base" />
<ListView
<com.rehome.zhdcoa.weiget.LoadListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="@color/gray"
android:dividerHeight="1px" />
</LinearLayout>

@ -6,11 +6,11 @@
<include layout="@layout/layout_base" />
<ListView
<com.rehome.zhdcoa.weiget.LoadListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:divider="@color/gray"
android:dividerHeight="1px" />
</LinearLayout>

@ -167,11 +167,22 @@
android:layout_height="70px"
android:layout_margin="10dp"
android:layout_weight="1"
android:visibility="gone"
android:visibility="visible"
android:background="@drawable/btn_blue"
android:text="发送短信"
android:textColor="@color/white" />
<Button
android:id="@+id/btn_sh"
android:layout_width="match_parent"
android:layout_height="70px"
android:layout_margin="10dp"
android:layout_weight="1"
android:visibility="visible"
android:background="@drawable/btn_blue"
android:text="审核"
android:textColor="@color/white" />
</LinearLayout>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/load_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="10dip"
android:paddingTop="10dip" >
<ProgressBar
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="正在加载..." />
</LinearLayout>
</LinearLayout>
Loading…
Cancel
Save