|
|
@@ -99,7 +99,7 @@ public class CustomerListActivity extends BaseActivity implements View.OnClickLi
|
|
|
mAdapter = new BussinessDetailAdapter(ct, jsonArray);
|
|
|
mlist.setAdapter(mAdapter);
|
|
|
|
|
|
- mEmptyLayout = new EmptyLayout(this,mlist.getRefreshableView());
|
|
|
+ mEmptyLayout = new EmptyLayout(this, mlist.getRefreshableView());
|
|
|
mEmptyLayout.setShowLoadingButton(false);
|
|
|
mEmptyLayout.setShowEmptyButton(false);
|
|
|
mEmptyLayout.setShowErrorButton(false);
|
|
|
@@ -145,19 +145,19 @@ public class CustomerListActivity extends BaseActivity implements View.OnClickLi
|
|
|
private void initData() {
|
|
|
em_code = CommonUtil.getSharedPreferences(ct, "erp_username");
|
|
|
sendHttpResquest(Constants.HTTP_SUCCESS_INIT, kind, page, 0, "");
|
|
|
- DBManager dbManager=new DBManager(ct);
|
|
|
- List<EmployeesEntity> db= dbManager.select_getEmployee(
|
|
|
+ DBManager dbManager = new DBManager(ct);
|
|
|
+ List<EmployeesEntity> db = dbManager.select_getEmployee(
|
|
|
new String[]{CommonUtil.getSharedPreferences(ct, "erp_master"),
|
|
|
- CommonUtil.getSharedPreferences(ct, "erp_username")}
|
|
|
+ CommonUtil.getSharedPreferences(ct, "erp_username")}
|
|
|
, "whichsys=? and em_code=? ");
|
|
|
- if (!ListUtils.isEmpty(db)){
|
|
|
- for (EmployeesEntity model:db) {
|
|
|
+ if (!ListUtils.isEmpty(db)) {
|
|
|
+ for (EmployeesEntity model : db) {
|
|
|
Log.i(TAG, "initData:" + model.getEM_DEPART());
|
|
|
Log.i(TAG, "initData:" + model.getEM_POSITION());
|
|
|
Log.i(TAG, "initData:" + model.getCOMPANY());
|
|
|
}
|
|
|
tv_position.setText(db.get(0).getEM_POSITION());
|
|
|
- tv_department.setText(db.get(0).getEM_DEFAULTORNAME()+"—>");
|
|
|
+ tv_department.setText(db.get(0).getEM_DEFAULTORNAME() + "—>");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -385,23 +385,19 @@ public class CustomerListActivity extends BaseActivity implements View.OnClickLi
|
|
|
JSONArray json0 = JSON.parseObject(msg.getData().getString("result")).getJSONArray("customers0");
|
|
|
JSONArray json1 = JSON.parseObject(msg.getData().getString("result")).getJSONArray("customers1");
|
|
|
if (json0 != null && json1 != null) {
|
|
|
- if (page == 1) {
|
|
|
- unEndSize = json0.size();
|
|
|
- endSize = json1.size();
|
|
|
- totalSize = json.size();
|
|
|
+ if (page == 1){
|
|
|
+ unEndSize = json0.getJSONObject(0).getIntValue("count");
|
|
|
+ endSize = json1.getJSONObject(0).getIntValue("count");
|
|
|
+ totalSize = json.getJSONObject(0).getIntValue("count");
|
|
|
+
|
|
|
+ CommonUtil.textSpanForStyle(tv_count_unend, unEndSize + "\n未成交", String.valueOf(unEndSize),
|
|
|
+ ct.getResources().getColor(R.color.yellow_home));
|
|
|
+ CommonUtil.textSpanForStyle(tv_count_end, endSize + "\n已成交", String.valueOf(endSize),
|
|
|
+ ct.getResources().getColor(R.color.yellow_home));
|
|
|
+ CommonUtil.textSpanForStyle(tv_count_total, totalSize + "\n全部客户", String.valueOf(totalSize),
|
|
|
+ ct.getResources().getColor(R.color.yellow_home));
|
|
|
}
|
|
|
- /* else {
|
|
|
- unEndSize += json0.size();
|
|
|
- endSize += json1.size();
|
|
|
- totalSize += json.size();
|
|
|
- }*/
|
|
|
-
|
|
|
- CommonUtil.textSpanForStyle(tv_count_unend, unEndSize + "\n未成交", String.valueOf(unEndSize),
|
|
|
- ct.getResources().getColor(R.color.yellow_home));
|
|
|
- CommonUtil.textSpanForStyle(tv_count_end, endSize + "\n已成交", String.valueOf(endSize),
|
|
|
- ct.getResources().getColor(R.color.yellow_home));
|
|
|
- CommonUtil.textSpanForStyle(tv_count_total, totalSize + "\n全部客户", String.valueOf(totalSize),
|
|
|
- ct.getResources().getColor(R.color.yellow_home));
|
|
|
+
|
|
|
}
|
|
|
switch (type) {
|
|
|
case 0:
|
|
|
@@ -418,7 +414,7 @@ public class CustomerListActivity extends BaseActivity implements View.OnClickLi
|
|
|
if (page == 1) jsonArray.clear();
|
|
|
jsonArray.addAll(json);
|
|
|
mAdapter.notifyDataSetChanged();
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
mEmptyLayout.showEmpty();
|
|
|
}
|
|
|
mlist.onRefreshComplete();
|