|
|
@@ -33,10 +33,6 @@ import com.github.mikephil.charting.components.YAxis;
|
|
|
import com.github.mikephil.charting.data.BarData;
|
|
|
import com.github.mikephil.charting.data.BarDataSet;
|
|
|
import com.github.mikephil.charting.data.BarEntry;
|
|
|
-import com.github.mikephil.charting.data.Entry;
|
|
|
-import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
|
|
|
-import com.github.mikephil.charting.utils.ColorTemplate;
|
|
|
-import com.github.mikephil.charting.utils.Highlight;
|
|
|
import com.github.mikephil.charting.utils.LargeValueFormatter;
|
|
|
import com.github.mikephil.charting.utils.ValueFormatter;
|
|
|
import com.lidroid.xutils.ViewUtils;
|
|
|
@@ -120,12 +116,12 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
@ViewInject(R.id.tv_em_c)
|
|
|
private TextView tv_em_c;
|
|
|
|
|
|
- @ViewInject(R.id. tv_em_plana)
|
|
|
- private TextView tv_em_plana;
|
|
|
- @ViewInject(R.id. tv_em_planb)
|
|
|
- private TextView tv_em_planb;
|
|
|
- @ViewInject(R.id. tv_em_planc)
|
|
|
- private TextView tv_em_planc;
|
|
|
+ @ViewInject(R.id.tv_em_plana)
|
|
|
+ private TextView tv_em_plana;
|
|
|
+ @ViewInject(R.id.tv_em_planb)
|
|
|
+ private TextView tv_em_planb;
|
|
|
+ @ViewInject(R.id.tv_em_planc)
|
|
|
+ private TextView tv_em_planc;
|
|
|
|
|
|
@ViewInject(R.id.tv_em_salea)
|
|
|
private TextView tv_em_salea;
|
|
|
@@ -133,38 +129,38 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
private TextView tv_em_saleb;
|
|
|
@ViewInject(R.id.tv_em_salec)
|
|
|
private TextView tv_em_salec;
|
|
|
-
|
|
|
+
|
|
|
@ViewInject(R.id.tv_cu_count)
|
|
|
private TextView tv_cu_count;
|
|
|
-
|
|
|
+
|
|
|
@ViewInject(R.id.ib_ranking_condition)
|
|
|
- private TextView ib_ranking_condition;
|
|
|
-
|
|
|
+ private TextView ib_ranking_condition;
|
|
|
+
|
|
|
@ViewInject(R.id.ib_index_condition)
|
|
|
private TextView ib_index_condition;
|
|
|
|
|
|
@ViewInject(R.id.ll_subordinate)
|
|
|
private LinearLayout ll_subordinate;
|
|
|
-
|
|
|
+
|
|
|
@ViewInject(R.id.crm_chart_bar)
|
|
|
private BarChart mChart;
|
|
|
@ViewInject(R.id.crm_chart_sale)
|
|
|
private BarChart sChart;
|
|
|
-
|
|
|
+
|
|
|
@ViewInject(R.id.ll_data_empty)
|
|
|
private LinearLayout ll_data_empty;
|
|
|
@ViewInject(R.id.ll_data_empty1)
|
|
|
private LinearLayout ll_data_empty1;
|
|
|
-
|
|
|
+
|
|
|
@ViewInject(R.id.ll_data_one)
|
|
|
- private LinearLayout ll_data_one;
|
|
|
+ private LinearLayout ll_data_one;
|
|
|
@ViewInject(R.id.ll_data_two)
|
|
|
private LinearLayout ll_data_two;
|
|
|
@ViewInject(R.id.ll_data_three)
|
|
|
private LinearLayout ll_data_three;
|
|
|
|
|
|
@ViewInject(R.id.ll_customer_lost)
|
|
|
- private LinearLayout ll_customer_lost;
|
|
|
+ private LinearLayout ll_customer_lost;
|
|
|
private BarData data;
|
|
|
private BarData data1;
|
|
|
private ArrayList<BarDataSet> dataSets;
|
|
|
@@ -176,7 +172,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
private TextView tv_huikuan;
|
|
|
@ViewInject(R.id.tv_chuhuo)
|
|
|
private TextView tv_chuhuo;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
@@ -198,12 +194,9 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
ib_business.setOnClickListener(this);
|
|
|
ib_customer.setOnClickListener(this);
|
|
|
ib_waller.setOnClickListener(this);
|
|
|
-
|
|
|
ib_customer_vistor.setOnClickListener(this);
|
|
|
-
|
|
|
ib_ranking_condition.setOnClickListener(this);
|
|
|
ib_index_condition.setOnClickListener(this);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void initData() {
|
|
|
@@ -219,10 +212,8 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
ViewUtil.httpSendRequest(ct, url, param, mHandler, headers, 100, null, null, "get");
|
|
|
}*/
|
|
|
-
|
|
|
+
|
|
|
private void initBarChart() {
|
|
|
- mv = new MyMarkerView(this, R.layout.custom_marker_view);
|
|
|
- // mChart.setMarkerView(mv);
|
|
|
mChart.setDescription("");
|
|
|
mChart.setMaxVisibleValueCount(60);
|
|
|
mChart.setPinchZoom(false);
|
|
|
@@ -231,14 +222,13 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
|
|
|
XAxis xAxis = mChart.getXAxis();
|
|
|
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
|
|
|
- // xAxis.setSpaceBetweenLabels(30);
|
|
|
xAxis.setLabelsToSkip(0);
|
|
|
- xAxis.setAxisLineColor(getResources().getColor(R.color.red));
|
|
|
- xAxis.setSpaceBetweenLabels(8);
|
|
|
+ xAxis.setAxisLineColor(getResources().getColor(R.color.light_gray));
|
|
|
+ xAxis.setSpaceBetweenLabels(30);
|
|
|
xAxis.setAxisLineWidth(0f);
|
|
|
xAxis.setDrawGridLines(false);
|
|
|
mChart.getAxisLeft().setDrawGridLines(false);
|
|
|
-
|
|
|
+
|
|
|
mChart.animateY(2500);
|
|
|
tf = Typeface.createFromAsset(getAssets(),
|
|
|
"OpenSans-Regular.ttf");
|
|
|
@@ -247,28 +237,29 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
l.setTypeface(tf);
|
|
|
|
|
|
|
|
|
- YAxis leftAxis = mChart.getAxisLeft();
|
|
|
+ final YAxis leftAxis = mChart.getAxisLeft();
|
|
|
+ /* leftAxis.setValueFormatter(new ValueFormatter() {
|
|
|
+ @Override
|
|
|
+ public String getFormattedValue(float value) {
|
|
|
+ if (value != 0) {
|
|
|
+ return String.valueOf(value);
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });*/
|
|
|
leftAxis.setTypeface(tf);
|
|
|
leftAxis.setValueFormatter(new LargeValueFormatter());
|
|
|
leftAxis.setDrawGridLines(false);
|
|
|
leftAxis.setSpaceTop(25f);
|
|
|
- leftAxis.setAxisMinValue(0f);
|
|
|
-// leftAxis.setAxisMaxValue(100f);
|
|
|
- leftAxis.setAxisLineColor(getResources().getColor(R.color.red));
|
|
|
+ leftAxis.setAxisMinValue(1f);
|
|
|
+ leftAxis.setAxisMaxValue(100f);
|
|
|
+ leftAxis.setAxisLineColor(getResources().getColor(R.color.light_gray));
|
|
|
mChart.getAxisRight().setEnabled(false);
|
|
|
mChart.getAxisLeft().setEnabled(true);
|
|
|
mChart.setMaxVisibleValueCount(10);
|
|
|
- mChart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onNothingSelected() {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
|
|
|
ArrayList<BarEntry> yVals1 = new ArrayList<BarEntry>();
|
|
|
ArrayList<String> xVals = new ArrayList<String>();
|
|
|
@@ -282,10 +273,8 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
mChart.invalidate();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- private void initSaleBarChart(){
|
|
|
- mv = new MyMarkerView(this, R.layout.custom_marker_view);
|
|
|
- // sChart.setMarkerView(mv);
|
|
|
+
|
|
|
+ private void initSaleBarChart() {
|
|
|
sChart.setDescription("");
|
|
|
sChart.setMaxVisibleValueCount(60);
|
|
|
sChart.setPinchZoom(false);
|
|
|
@@ -294,13 +283,11 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
|
|
|
XAxis xAxis = sChart.getXAxis();
|
|
|
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
|
|
|
- // xAxis.setSpaceBetweenLabels(30);
|
|
|
+ xAxis.setSpaceBetweenLabels(30);
|
|
|
xAxis.setLabelsToSkip(0);
|
|
|
-
|
|
|
- xAxis.setAxisLineColor(getResources().getColor(R.color.red));
|
|
|
- xAxis.setSpaceBetweenLabels(8);
|
|
|
- xAxis.setAxisLineWidth(0f);
|
|
|
|
|
|
+ xAxis.setAxisLineColor(getResources().getColor(R.color.light_gray));
|
|
|
+ xAxis.setAxisLineWidth(0f);
|
|
|
xAxis.setDrawGridLines(false);
|
|
|
sChart.getAxisLeft().setDrawGridLines(false);
|
|
|
sChart.animateY(2500);
|
|
|
@@ -313,31 +300,32 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
XAxis xl = sChart.getXAxis();
|
|
|
xl.setTypeface(tf);
|
|
|
|
|
|
- YAxis leftAxis = sChart.getAxisLeft();
|
|
|
+
|
|
|
+ final YAxis leftAxis = sChart.getAxisLeft();
|
|
|
+ /* leftAxis.setValueFormatter(new ValueFormatter() {
|
|
|
+ @Override
|
|
|
+ public String getFormattedValue(float value) {
|
|
|
+ if (value != 0) {
|
|
|
+ return String.valueOf(value);
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });*/
|
|
|
leftAxis.setTypeface(tf);
|
|
|
leftAxis.setValueFormatter(new LargeValueFormatter());
|
|
|
leftAxis.setDrawGridLines(false);
|
|
|
leftAxis.setSpaceTop(25f);
|
|
|
- leftAxis.setAxisMinValue(0f);
|
|
|
-// leftAxis.setAxisMaxValue(100f);
|
|
|
- leftAxis.setAxisLineColor(getResources().getColor(R.color.red));
|
|
|
+ leftAxis.setAxisMinValue(1f);
|
|
|
+ leftAxis.setAxisMaxValue(100f);
|
|
|
+ leftAxis.setAxisLineColor(getResources().getColor(R.color.light_gray));
|
|
|
sChart.getAxisRight().setEnabled(false);
|
|
|
sChart.getAxisLeft().setEnabled(true);
|
|
|
sChart.setMaxVisibleValueCount(10);
|
|
|
- sChart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onValueSelected(Entry e, int dataSetIndex, Highlight h) {
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onNothingSelected() {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
ArrayList<BarEntry> yVals1 = new ArrayList<BarEntry>();
|
|
|
ArrayList<String> xVals = new ArrayList<String>();
|
|
|
-
|
|
|
BarDataSet set1 = new BarDataSet(yVals1, "日销售额");
|
|
|
set1.setColor(Color.rgb(164, 228, 251));
|
|
|
dataSets = new ArrayList<BarDataSet>();
|
|
|
@@ -347,10 +335,8 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
sChart.setData(data);
|
|
|
sChart.setNoDataText("暂时没有数据");
|
|
|
sChart.invalidate();
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
getMenuInflater().inflate(R.menu.menu_crm, menu);
|
|
|
@@ -384,8 +370,8 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
protected String[] sales = new String[]{
|
|
|
"客户", "联系人", "商机数", "商机变更", "销售订单", "拜访客户数", "拜访次数", "Aug", "Sep", "Okt", "Nov", "Dec"
|
|
|
};
|
|
|
-
|
|
|
- private void setData(int count, float [] ydata) {
|
|
|
+
|
|
|
+ private void setData(int count, float[] ydata) {
|
|
|
ArrayList<String> xVals = new ArrayList<String>();
|
|
|
for (int i = 0; i < count; i++) {
|
|
|
xVals.add(mMonths[i % 12]);
|
|
|
@@ -396,7 +382,10 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
yVals1.add(new BarEntry(val, i));
|
|
|
}
|
|
|
BarDataSet set1 = new BarDataSet(yVals1, "月销售额(单位:人民币 万元)");
|
|
|
- set1.setColors(ColorTemplate.JOYFUL_COLORS);
|
|
|
+ int [] JOYFUL_COLORS= {
|
|
|
+ Color.rgb(121,191,174), Color.rgb(91,161,209)
|
|
|
+ };
|
|
|
+ set1.setColors(JOYFUL_COLORS);
|
|
|
//set1.setVisible(false);
|
|
|
//set1.setDrawValues(false);
|
|
|
set1.setValueFormatter(new ValueFormatter() {
|
|
|
@@ -420,7 +409,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
if (value == 0) {
|
|
|
return "";
|
|
|
} else {
|
|
|
- return String.valueOf(value);
|
|
|
+ return new DecimalFormat("###,###,##0").format(value);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -436,12 +425,12 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
mChart.setData(data);
|
|
|
/**@注释:清空任何缩放 */
|
|
|
mChart.zoom(0, 0, 0, 0);
|
|
|
- mChart.zoom(ydata.length/4.2f,0,0,0);
|
|
|
+ mChart.zoom(ydata.length / 4.2f, 0, 0, 0);
|
|
|
mChart.invalidate();
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void setData1(int count, float [] ydata) {
|
|
|
+ private void setData1(int count, float[] ydata) {
|
|
|
ArrayList<String> xVals = new ArrayList<String>();
|
|
|
for (int i = 0; i < count; i++) {
|
|
|
xVals.add(sales[i % 12]);
|
|
|
@@ -458,11 +447,15 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
BarDataSet set1 = new BarDataSet(yVals1, "数量(单位:个)");
|
|
|
- set1.setColors(ColorTemplate.JOYFUL_COLORS);
|
|
|
+ int [] JOYFUL_COLORS= {
|
|
|
+ Color.rgb(121,191,174), Color.rgb(91,161,209)
|
|
|
+ };
|
|
|
+ set1.setColors(JOYFUL_COLORS);
|
|
|
//set1.setVisible(false);
|
|
|
//set1.setDrawValues(false);
|
|
|
set1.setValueFormatter(new ValueFormatter() {
|
|
|
private DecimalFormat mFormat;
|
|
|
+
|
|
|
public void DefaultValueFormatter(int digits) {
|
|
|
|
|
|
StringBuffer b = new StringBuffer();
|
|
|
@@ -474,13 +467,14 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
|
|
|
mFormat = new DecimalFormat("###,###,###,##0" + b.toString());
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public String getFormattedValue(float value) {
|
|
|
try {
|
|
|
- if (value==0){
|
|
|
+ if (value == 0) {
|
|
|
return "";
|
|
|
- }else {
|
|
|
- return String.valueOf(value);
|
|
|
+ } else {
|
|
|
+ return new DecimalFormat("###,###,##0").format(value);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -497,8 +491,8 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
sChart.setData(data1);
|
|
|
sChart.invalidate();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
switch (v.getId()) {
|
|
|
@@ -508,9 +502,9 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
case R.id.ib_customer:
|
|
|
startActivity(new Intent(this, CustomerListActivity.class));
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
case R.id.ib_customer_vistor:
|
|
|
- startActivity(new Intent(this, OAActivity.class).putExtra("type",1));
|
|
|
+ startActivity(new Intent(this, OAActivity.class).putExtra("type", 1));
|
|
|
break;
|
|
|
case R.id.ib_waller:
|
|
|
startActivity(new Intent(this, SalesRankingActivity.class));
|
|
|
@@ -521,7 +515,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
case R.id.ib_index_condition:
|
|
|
showDateDialog(R.id.ib_index_condition);
|
|
|
break;
|
|
|
- case R.id.ib_ranking_condition:
|
|
|
+ case R.id.ib_ranking_condition:
|
|
|
showDateDialog(R.id.ib_ranking_condition);
|
|
|
break;
|
|
|
/* case R.id.ib_em_condition:
|
|
|
@@ -548,11 +542,11 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
JSONArray receivables = root.getJSONArray("receivables");
|
|
|
JSONArray profits = root.getJSONArray("profits");
|
|
|
if (sales != null) {
|
|
|
- if (!sales.isEmpty()){
|
|
|
+ if (!sales.isEmpty()) {
|
|
|
if (sales.size() != 2) {
|
|
|
- if (sales.getJSONArray(0).getString(2).equals(CommonUtil.getSharedPreferences(ct,"erp_usernme"))) {
|
|
|
+ if (sales.getJSONArray(0).getString(2).equals(CommonUtil.getSharedPreferences(ct, "erp_usernme"))) {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_sale_left,
|
|
|
- "第"+sales.getJSONArray(0).get(3) + "名"
|
|
|
+ "第" + sales.getJSONArray(0).get(3) + "名"
|
|
|
, new String[]{
|
|
|
String.valueOf(sales.getJSONArray(0).get(3))},
|
|
|
ct.getResources().getColor(R.color.red));
|
|
|
@@ -562,14 +556,14 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
, new String[]{
|
|
|
String.valueOf(sales.getJSONArray(0).get(0))},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_sale_left,
|
|
|
- "第"+"__"+"名",
|
|
|
- new String[]{"__"},ct.getResources().getColor(R.color.gray)
|
|
|
+ "第" + "__" + "名",
|
|
|
+ new String[]{"__"}, ct.getResources().getColor(R.color.gray)
|
|
|
);
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_sale_right,
|
|
|
- "__"+ "万元"
|
|
|
- , new String[]{ "__"},
|
|
|
+ "__" + "万元"
|
|
|
+ , new String[]{"__"},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
}
|
|
|
} else {
|
|
|
@@ -585,34 +579,33 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
String.valueOf(sales.getJSONArray(1).get(0))},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_sale_left,
|
|
|
- "第"+"__"+"名",
|
|
|
- new String[]{"__"},ct.getResources().getColor(R.color.gray)
|
|
|
+ "第" + "__" + "名",
|
|
|
+ new String[]{"__"}, ct.getResources().getColor(R.color.gray)
|
|
|
);
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_sale_right,
|
|
|
- "__"+ "万元"
|
|
|
- , new String[]{ "__"},
|
|
|
+ "__" + "万元"
|
|
|
+ , new String[]{"__"},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- if (visits != null&&!visits.isEmpty()) {
|
|
|
+ if (visits != null && !visits.isEmpty()) {
|
|
|
if (visits.size() != 2) {
|
|
|
- if (visits.getJSONArray(0).getString(1).equals(CommonUtil.getSharedPreferences(ct,"erp_username")))
|
|
|
- {
|
|
|
+ if (visits.getJSONArray(0).getString(1).equals(CommonUtil.getSharedPreferences(ct, "erp_username"))) {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_visit_left,
|
|
|
"第" + visits.getJSONArray(0).get(3).toString()
|
|
|
+ "名"
|
|
|
, new String[]{visits.getJSONArray(0).get(3).toString()},
|
|
|
ct.getResources().getColor(R.color.red));
|
|
|
|
|
|
- CommonUtil.textAarrySpanForStyle(tv_rank_visit_right,visits.getJSONArray(0).getIntValue(2)
|
|
|
+ CommonUtil.textAarrySpanForStyle(tv_rank_visit_right, visits.getJSONArray(0).getIntValue(2)
|
|
|
+ "个"
|
|
|
- , new String[]{ String.valueOf(visits.getJSONArray(0).getIntValue(2))},
|
|
|
+ , new String[]{String.valueOf(visits.getJSONArray(0).getIntValue(2))},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//名称 拜访次数,拜访个数,排名
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_visit_left,
|
|
|
"第__名",
|
|
|
@@ -620,7 +613,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
, ct.getResources().getColor(R.color.gray));
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_visit_right,
|
|
|
"__个"
|
|
|
- , new String[]{ "__"},
|
|
|
+ , new String[]{"__"},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
}
|
|
|
|
|
|
@@ -631,110 +624,108 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
ct.getResources().getColor(R.color.red));
|
|
|
// tv_rank_visit_left.setText("第" + visits.getJSONArray(1).getIntValue(3)+"名");
|
|
|
tv_rank_visit_right.setText(visits.getJSONArray(1).getIntValue(2) + "个");
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_visit_left,
|
|
|
"第__名",
|
|
|
new String[]{"__"}
|
|
|
, ct.getResources().getColor(R.color.gray));
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_visit_right,
|
|
|
"__个"
|
|
|
- , new String[]{ "__"},
|
|
|
+ , new String[]{"__"},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
}
|
|
|
|
|
|
- if (profits != null&&!profits.isEmpty()) {
|
|
|
+ if (profits != null && !profits.isEmpty()) {
|
|
|
if (profits.size() == 2) {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_rirun_left,
|
|
|
"第" + profits.getJSONArray(1).get(3).toString() + "名"
|
|
|
, new String[]{
|
|
|
String.valueOf(profits.getJSONArray(1).get(3).toString())
|
|
|
}, ct.getResources().getColor(R.color.red));
|
|
|
- CommonUtil.textAarrySpanForStyle(tv_rank_rirun_right,profits.getJSONArray(1).get(0) + "万元"
|
|
|
+ CommonUtil.textAarrySpanForStyle(tv_rank_rirun_right, profits.getJSONArray(1).get(0) + "万元"
|
|
|
, new String[]{
|
|
|
- String.valueOf(profits.getJSONArray(0).get(0))
|
|
|
- }, ct.getResources().getColor(R.color.gray));
|
|
|
+ String.valueOf(profits.getJSONArray(0).get(0))
|
|
|
+ }, ct.getResources().getColor(R.color.gray));
|
|
|
} else {
|
|
|
- if (profits.getJSONArray(0).getString(2).equals(CommonUtil.getSharedPreferences(ct,"erp_username")))
|
|
|
- {
|
|
|
+ if (profits.getJSONArray(0).getString(2).equals(CommonUtil.getSharedPreferences(ct, "erp_username"))) {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_rirun_left,
|
|
|
- "第" + profits.getJSONArray(0).get(3).toString()+ "名"
|
|
|
+ "第" + profits.getJSONArray(0).get(3).toString() + "名"
|
|
|
, new String[]{
|
|
|
String.valueOf(profits.getJSONArray(0).get(3).toString())
|
|
|
}, ct.getResources().getColor(R.color.red));
|
|
|
|
|
|
- CommonUtil.textAarrySpanForStyle(tv_rank_rirun_right,profits.getJSONArray(0).get(0) + "万元"
|
|
|
+ CommonUtil.textAarrySpanForStyle(tv_rank_rirun_right, profits.getJSONArray(0).get(0) + "万元"
|
|
|
, new String[]{
|
|
|
String.valueOf(profits.getJSONArray(0).get(0))
|
|
|
}, ct.getResources().getColor(R.color.gray));
|
|
|
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_rirun_left,
|
|
|
- "第"+"__"+"名",
|
|
|
- new String[]{"__"},ct.getResources().getColor(R.color.gray)
|
|
|
+ "第" + "__" + "名",
|
|
|
+ new String[]{"__"}, ct.getResources().getColor(R.color.gray)
|
|
|
);
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_rirun_right,
|
|
|
- "__"+ "万元"
|
|
|
- , new String[]{ "__"},
|
|
|
+ "__" + "万元"
|
|
|
+ , new String[]{"__"},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_rirun_left,
|
|
|
- "第"+"__"+"名",
|
|
|
- new String[]{"__"},ct.getResources().getColor(R.color.gray)
|
|
|
+ "第" + "__" + "名",
|
|
|
+ new String[]{"__"}, ct.getResources().getColor(R.color.gray)
|
|
|
);
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_rirun_right,
|
|
|
- "__"+ "万元"
|
|
|
- , new String[]{ "__"},
|
|
|
+ "__" + "万元"
|
|
|
+ , new String[]{"__"},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (receivables != null&&!receivables.isEmpty()) {
|
|
|
+ if (receivables != null && !receivables.isEmpty()) {
|
|
|
if (receivables.size() == 2) {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_income_left,
|
|
|
- "第"+ receivables.getJSONArray(1).get(3).toString() +"名"
|
|
|
+ "第" + receivables.getJSONArray(1).get(3).toString() + "名"
|
|
|
, new String[]{
|
|
|
- String.valueOf( receivables.getJSONArray(1).get(3).toString())},
|
|
|
+ String.valueOf(receivables.getJSONArray(1).get(3).toString())},
|
|
|
ct.getResources().getColor(R.color.red));
|
|
|
- CommonUtil.textAarrySpanForStyle(tv_rank_income_right,receivables.getJSONArray(1).get(0) + "万元"
|
|
|
+ CommonUtil.textAarrySpanForStyle(tv_rank_income_right, receivables.getJSONArray(1).get(0) + "万元"
|
|
|
, new String[]{String.valueOf(receivables.getJSONArray(1).get(0))},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
} else {
|
|
|
- if (receivables.getJSONArray(0).getString(2).equals(CommonUtil.getSharedPreferences(ct,"erp_username")))
|
|
|
- {
|
|
|
+ if (receivables.getJSONArray(0).getString(2).equals(CommonUtil.getSharedPreferences(ct, "erp_username"))) {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_income_left,
|
|
|
- "第" + receivables.getJSONArray(0).getString(1)+ "名"
|
|
|
+ "第" + receivables.getJSONArray(0).getString(1) + "名"
|
|
|
, new String[]{receivables.getJSONArray(0).getString(1)},
|
|
|
ct.getResources().getColor(R.color.red));
|
|
|
|
|
|
- CommonUtil.textAarrySpanForStyle(tv_rank_income_right,receivables.getJSONArray(0).get(0) + "万元"
|
|
|
+ CommonUtil.textAarrySpanForStyle(tv_rank_income_right, receivables.getJSONArray(0).get(0) + "万元"
|
|
|
, new String[]{
|
|
|
String.valueOf(receivables.getJSONArray(0).get(0))},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_income_left,
|
|
|
- "第"+"__"+"名",
|
|
|
- new String[]{"__"},ct.getResources().getColor(R.color.gray)
|
|
|
+ "第" + "__" + "名",
|
|
|
+ new String[]{"__"}, ct.getResources().getColor(R.color.gray)
|
|
|
);
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_income_right,
|
|
|
- "__"+"万元"
|
|
|
- , new String[]{ "__"},
|
|
|
+ "__" + "万元"
|
|
|
+ , new String[]{"__"},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_income_left,
|
|
|
- "第"+"__"+"名",
|
|
|
- new String[]{"__"},ct.getResources().getColor(R.color.gray)
|
|
|
+ "第" + "__" + "名",
|
|
|
+ new String[]{"__"}, ct.getResources().getColor(R.color.gray)
|
|
|
);
|
|
|
CommonUtil.textAarrySpanForStyle(tv_rank_income_right,
|
|
|
- "__"+"万元"
|
|
|
- , new String[]{ "__"},
|
|
|
+ "__" + "万元"
|
|
|
+ , new String[]{"__"},
|
|
|
ct.getResources().getColor(R.color.gray));
|
|
|
}
|
|
|
break;
|
|
|
@@ -742,8 +733,8 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
progressDialog.dismiss();
|
|
|
Log.i(TAG, "handleMessage SalesKit:" + msg.getData().getString("result"));
|
|
|
root = JSON.parseObject(msg.getData().getString("result")).getJSONObject("datas");
|
|
|
- float [] ydata1={0,0,0,0,0,0,0};
|
|
|
- if (root!=null) {
|
|
|
+ float[] ydata1 = {0, 0, 0, 0, 0, 0, 0};
|
|
|
+ if (root != null) {
|
|
|
ydata1[0] = root.getIntValue("customercount");
|
|
|
ydata1[1] = root.getIntValue("contactcount");
|
|
|
ydata1[2] = root.getIntValue("salecount");
|
|
|
@@ -753,13 +744,13 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
ydata1[6] = root.getJSONArray("visit").getIntValue(1);
|
|
|
tv_chuhuo.setText("出货" + root.getFloatValue("saleamount") + "万元");
|
|
|
tv_huikuan.setText("回款" + root.getFloatValue("backamount") + "万元");
|
|
|
- for (int i=0;i<ydata1.length;i++){
|
|
|
- Log.i(TAG, "handleMessage:ydata1["+i+"]=" + ydata1[i] );
|
|
|
- }
|
|
|
+ for (int i = 0; i < ydata1.length; i++) {
|
|
|
+ Log.i(TAG, "handleMessage:ydata1[" + i + "]=" + ydata1[i]);
|
|
|
+ }
|
|
|
setData1(7, ydata1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
setData1(7, ydata1);
|
|
|
- tv_chuhuo.setText("出货" + root.getIntValue("saleamount") + "万元");
|
|
|
+ tv_chuhuo.setText("出货" + root.getIntValue("saleamount") + "万元");
|
|
|
tv_huikuan.setText("回款" + root.getIntValue("backamount") + "万元");
|
|
|
}
|
|
|
break;
|
|
|
@@ -768,101 +759,101 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
Log.i(TAG, "handleMessage Targets:" + msg.getData().getString("result"));
|
|
|
root = JSON.parseObject(msg.getData().getString("result")).getJSONObject("datas");
|
|
|
//解析指标和下属
|
|
|
- if(!root.getJSONArray("target").isEmpty()){
|
|
|
+ if (!root.getJSONArray("target").isEmpty()) {
|
|
|
JSONObject target = root.getJSONArray("target").getJSONObject(0);
|
|
|
tv_em_a.setText(target.getString("CUSTOMERCOUNT"));
|
|
|
- float [] ydata={0,0,0,0,0,0,0};
|
|
|
- ydata[0]=target.getIntValue("RANK");
|
|
|
- ydata[1]=target.getFloatValue("FIRSTBFCOUNT/10000");
|
|
|
- ydata[2]=target.getIntValue("TOPCOUNT");
|
|
|
- ydata[3]=target.getFloatValue("ACTUALPROFIT/10000");
|
|
|
- setData(7,ydata);
|
|
|
- }else{
|
|
|
- float [] ydata={0,0,0,0,0,0,0};
|
|
|
- setData(7,ydata);
|
|
|
+ float[] ydata = {0, 0, 0, 0, 0, 0, 0};
|
|
|
+ ydata[0] = target.getIntValue("RANK");
|
|
|
+ ydata[1] = target.getFloatValue("FIRSTBFCOUNT/10000");
|
|
|
+ ydata[2] = target.getIntValue("TOPCOUNT");
|
|
|
+ ydata[3] = target.getFloatValue("ACTUALPROFIT/10000");
|
|
|
+ setData(7, ydata);
|
|
|
+ } else {
|
|
|
+ float[] ydata = {0, 0, 0, 0, 0, 0, 0};
|
|
|
+ setData(7, ydata);
|
|
|
+ }
|
|
|
+ if (!root.getJSONArray("subs").isEmpty()) {
|
|
|
+ int size = root.getJSONArray("subs").size();
|
|
|
+ switch (size) {
|
|
|
+ case 1:
|
|
|
+ ll_data_one.setVisibility(View.VISIBLE);
|
|
|
+ ll_data_two.setVisibility(View.GONE);
|
|
|
+ ll_data_three.setVisibility(View.GONE);
|
|
|
+ tv_em_a.setText(root.getJSONArray("subs").getJSONObject(0).getString("CUSTOMERCOUNT"));
|
|
|
+
|
|
|
+ tv_em_plana.setText(root.getJSONArray("subs").getJSONObject(0).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(0).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
+ tv_em_salea.setText(root.getJSONArray("subs").getJSONObject(0).getIntValue("RANK")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(0).getIntValue("TOPCOUNT"));
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ ll_data_one.setVisibility(View.GONE);
|
|
|
+ ll_data_two.setVisibility(View.VISIBLE);
|
|
|
+ ll_data_three.setVisibility(View.GONE);
|
|
|
+ tv_em_a.setText(root.getJSONArray("subs").getJSONObject(0).getString("CUSTOMERCOUNT"));
|
|
|
+ tv_em_b.setText(root.getJSONArray("subs").getJSONObject(1).getString("CUSTOMERCOUNT"));
|
|
|
+
|
|
|
+ tv_em_plana.setText(root.getJSONArray("subs").getJSONObject(0).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(0).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
+ tv_em_salea.setText(root.getJSONArray("subs").getJSONObject(0).getIntValue("RANK")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(0).getIntValue("TOPCOUNT"));
|
|
|
+
|
|
|
+ tv_em_planb.setText(root.getJSONArray("subs").getJSONObject(1).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(1).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
+ tv_em_saleb.setText(root.getJSONArray("subs").getJSONObject(1).getIntValue("RANK")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(1).getIntValue("TOPCOUNT"));
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ ll_data_one.setVisibility(View.GONE);
|
|
|
+ ll_data_two.setVisibility(View.GONE);
|
|
|
+ ll_data_three.setVisibility(View.VISIBLE);
|
|
|
+ tv_em_a.setText(root.getJSONArray("subs").getJSONObject(0).getString("CUSTOMERCOUNT"));
|
|
|
+ tv_em_b.setText(root.getJSONArray("subs").getJSONObject(1).getString("CUSTOMERCOUNT"));
|
|
|
+ tv_em_c.setText(root.getJSONArray("subs").getJSONObject(2).getString("CUSTOMERCOUNT"));
|
|
|
+
|
|
|
+
|
|
|
+ tv_em_plana.setText(root.getJSONArray("subs").getJSONObject(0).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(0).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
+ tv_em_salea.setText(root.getJSONArray("subs").getJSONObject(0).getIntValue("RANK")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(0).getIntValue("TOPCOUNT"));
|
|
|
+
|
|
|
+ tv_em_planb.setText(root.getJSONArray("subs").getJSONObject(1).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(1).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
+ tv_em_saleb.setText(root.getJSONArray("subs").getJSONObject(1).getIntValue("RANK")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(1).getIntValue("TOPCOUNT"));
|
|
|
+
|
|
|
+ tv_em_planc.setText(root.getJSONArray("subs").getJSONObject(2).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(2).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
+ tv_em_salec.setText(root.getJSONArray("subs").getJSONObject(2).getIntValue("RANK")
|
|
|
+ + "/" + root.getJSONArray("subs").getJSONObject(2).getIntValue("TOPCOUNT"));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ ll_data_empty.setVisibility(View.GONE);
|
|
|
+ } else {
|
|
|
+ ll_data_empty.setVisibility(View.VISIBLE);
|
|
|
+ ll_data_one.setVisibility(View.GONE);
|
|
|
+ ll_data_two.setVisibility(View.GONE);
|
|
|
+ ll_data_three.setVisibility(View.GONE);
|
|
|
}
|
|
|
- if(!root.getJSONArray("subs").isEmpty()){
|
|
|
- int size= root.getJSONArray("subs").size();
|
|
|
- switch (size){
|
|
|
- case 1:
|
|
|
- ll_data_one.setVisibility(View.VISIBLE);
|
|
|
- ll_data_two.setVisibility(View.GONE);
|
|
|
- ll_data_three.setVisibility(View.GONE);
|
|
|
- tv_em_a.setText(root.getJSONArray("subs").getJSONObject(0).getString("CUSTOMERCOUNT"));
|
|
|
-
|
|
|
- tv_em_plana.setText(root.getJSONArray("subs").getJSONObject(0).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
- +"/"+root.getJSONArray("subs").getJSONObject(0).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
- tv_em_salea.setText(root.getJSONArray("subs").getJSONObject(0).getIntValue("RANK")
|
|
|
- +"/"+ root.getJSONArray("subs").getJSONObject(0).getIntValue("TOPCOUNT"));
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- ll_data_one.setVisibility(View.GONE);
|
|
|
- ll_data_two.setVisibility(View.VISIBLE);
|
|
|
- ll_data_three.setVisibility(View.GONE);
|
|
|
- tv_em_a.setText(root.getJSONArray("subs").getJSONObject(0).getString("CUSTOMERCOUNT"));
|
|
|
- tv_em_b.setText(root.getJSONArray("subs").getJSONObject(1).getString("CUSTOMERCOUNT"));
|
|
|
-
|
|
|
- tv_em_plana.setText(root.getJSONArray("subs").getJSONObject(0).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
- + "/" + root.getJSONArray("subs").getJSONObject(0).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
- tv_em_salea.setText(root.getJSONArray("subs").getJSONObject(0).getIntValue("RANK")
|
|
|
- + "/" + root.getJSONArray("subs").getJSONObject(0).getIntValue("TOPCOUNT"));
|
|
|
-
|
|
|
- tv_em_planb.setText(root.getJSONArray("subs").getJSONObject(1).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
- + "/" + root.getJSONArray("subs").getJSONObject(1).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
- tv_em_saleb.setText(root.getJSONArray("subs").getJSONObject(1).getIntValue("RANK")
|
|
|
- + "/" + root.getJSONArray("subs").getJSONObject(1).getIntValue("TOPCOUNT"));
|
|
|
-
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- ll_data_one.setVisibility(View.GONE);
|
|
|
- ll_data_two.setVisibility(View.GONE);
|
|
|
- ll_data_three.setVisibility(View.VISIBLE);
|
|
|
- tv_em_a.setText(root.getJSONArray("subs").getJSONObject(0).getString("CUSTOMERCOUNT"));
|
|
|
- tv_em_b.setText(root.getJSONArray("subs").getJSONObject(1).getString("CUSTOMERCOUNT"));
|
|
|
- tv_em_c.setText(root.getJSONArray("subs").getJSONObject(2).getString("CUSTOMERCOUNT"));
|
|
|
-
|
|
|
-
|
|
|
- tv_em_plana.setText(root.getJSONArray("subs").getJSONObject(0).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
- + "/" + root.getJSONArray("subs").getJSONObject(0).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
- tv_em_salea.setText(root.getJSONArray("subs").getJSONObject(0).getIntValue("RANK")
|
|
|
- + "/" + root.getJSONArray("subs").getJSONObject(0).getIntValue("TOPCOUNT"));
|
|
|
-
|
|
|
- tv_em_planb.setText(root.getJSONArray("subs").getJSONObject(1).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
- + "/" + root.getJSONArray("subs").getJSONObject(1).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
- tv_em_saleb.setText(root.getJSONArray("subs").getJSONObject(1).getIntValue("RANK")
|
|
|
- + "/" + root.getJSONArray("subs").getJSONObject(1).getIntValue("TOPCOUNT"));
|
|
|
-
|
|
|
- tv_em_planc.setText(root.getJSONArray("subs").getJSONObject(2).getFloatValue("FIRSTBFCOUNT/10000")
|
|
|
- +"/"+root.getJSONArray("subs").getJSONObject(2).getFloatValue("ACTUALPROFIT/10000"));
|
|
|
- tv_em_salec.setText(root.getJSONArray("subs").getJSONObject(2).getIntValue("RANK")
|
|
|
- +"/"+ root.getJSONArray("subs").getJSONObject(2).getIntValue("TOPCOUNT"));
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- ll_data_empty.setVisibility(View.GONE);
|
|
|
- }else{
|
|
|
- ll_data_empty.setVisibility(View.VISIBLE);
|
|
|
- ll_data_one.setVisibility(View.GONE);
|
|
|
- ll_data_two.setVisibility(View.GONE);
|
|
|
- ll_data_three.setVisibility(View.GONE);
|
|
|
- }
|
|
|
break;
|
|
|
case INIT_InactionCusts:
|
|
|
progressDialog.dismiss();
|
|
|
Log.i(TAG, "handleMessage InactionCusts:" + msg.getData().getString("result"));
|
|
|
- if(JSON.parseObject(msg.getData().getString("result")).get("data") instanceof JSONObject){
|
|
|
- root = JSON.parseObject(msg.getData().getString("result")).getJSONObject("datas");
|
|
|
- CommonUtil.textAarrySpanForStyle(tv_cu_count,
|
|
|
- root.getIntValue("customernum") + " 个"
|
|
|
- , new String[]{String.valueOf(root.getIntValue("customernum"))},
|
|
|
- ct.getResources().getColor(R.color.yellow_home));
|
|
|
- ll_data_empty1.setVisibility(View.GONE);
|
|
|
- ll_customer_lost.setVisibility(View.VISIBLE);
|
|
|
- }else{
|
|
|
- //无数据处理
|
|
|
- ll_customer_lost.setVisibility(View.GONE);
|
|
|
- ll_data_empty1.setVisibility(View.VISIBLE);
|
|
|
- }
|
|
|
+ if (JSON.parseObject(msg.getData().getString("result")).get("data") instanceof JSONObject) {
|
|
|
+ root = JSON.parseObject(msg.getData().getString("result")).getJSONObject("datas");
|
|
|
+ CommonUtil.textAarrySpanForStyle(tv_cu_count,
|
|
|
+ root.getIntValue("customernum") + " 个"
|
|
|
+ , new String[]{String.valueOf(root.getIntValue("customernum"))},
|
|
|
+ ct.getResources().getColor(R.color.yellow_home));
|
|
|
+ ll_data_empty1.setVisibility(View.GONE);
|
|
|
+ ll_customer_lost.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ //无数据处理
|
|
|
+ ll_customer_lost.setVisibility(View.GONE);
|
|
|
+ ll_data_empty1.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
break;
|
|
|
case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
|
|
|
@@ -870,19 +861,19 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
break;
|
|
|
case 6:
|
|
|
JSONArray array = JSON.parseObject(msg.getData().getString("result")).getJSONArray("datas");
|
|
|
- if (array!=null){
|
|
|
- if (array.size()>0){
|
|
|
+ if (array != null) {
|
|
|
+ if (array.size() > 0) {
|
|
|
//显示下属面板
|
|
|
- Log.i("raomeng",msg.getData().getString("result"));
|
|
|
+ Log.i("raomeng", msg.getData().getString("result"));
|
|
|
ll_subordinate.setVisibility(View.VISIBLE);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//隐藏下属面板
|
|
|
- Log.i("raomeng",msg.getData().getString("result"));
|
|
|
+ Log.i("raomeng", msg.getData().getString("result"));
|
|
|
ll_subordinate.setVisibility(View.GONE);
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -942,7 +933,8 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
|
|
|
private void sendPersonalRank(String date) {
|
|
|
progressDialog.show();
|
|
|
- LinkedHashMap<String, Object> headers = new LinkedHashMap<>();;
|
|
|
+ LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+ ;
|
|
|
String url;
|
|
|
Map<String, Object> params;
|
|
|
url = Constants.getAppBaseUrl(ct) + "mobile/crm/getPersonalRank.action";
|
|
|
@@ -1024,14 +1016,13 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
popupWindow.showAsDropDown(parent, windowManager.getDefaultDisplay().getWidth(), 0);
|
|
|
}
|
|
|
|
|
|
- private void closePoppupWindow(){
|
|
|
- if (popupWindow != null && popupWindow.isShowing()){
|
|
|
+ private void closePoppupWindow() {
|
|
|
+ if (popupWindow != null && popupWindow.isShowing()) {
|
|
|
popupWindow.dismiss();
|
|
|
popupWindow = null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
private List<Map<String, Object>> getPopData() {
|
|
|
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
|
|
@@ -1075,7 +1066,7 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
|
|
|
|
|
|
private void showDateDialog(final int resId) {
|
|
|
- DatePicker picker = new DatePicker(this,DatePicker.YEAR_MONTH);
|
|
|
+ DatePicker picker = new DatePicker(this, DatePicker.YEAR_MONTH);
|
|
|
picker.setRange(1950, 2030);
|
|
|
//Calendar.getInstance().get(Calendar.DAY_OF_MONTH)
|
|
|
picker.setSelectedItem(
|
|
|
@@ -1087,12 +1078,12 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
// ToastUtil.showToast(ct, year + "-" + month + "-" + day);
|
|
|
switch (resId) {
|
|
|
case R.id.ib_ranking_condition://排名
|
|
|
- ToastUtil.showToast(ct, year + "-" + month );
|
|
|
- sendPersonalRank(year+month);
|
|
|
+ ToastUtil.showToast(ct, year + "-" + month);
|
|
|
+ sendPersonalRank(year + month);
|
|
|
break;
|
|
|
case R.id.ib_index_condition://图表
|
|
|
- ToastUtil.showToast(ct, year + "-" + month );
|
|
|
- sendTargets(year+month);
|
|
|
+ ToastUtil.showToast(ct, year + "-" + month);
|
|
|
+ sendTargets(year + month);
|
|
|
break;
|
|
|
/* case R.id.ib_sale_condition://销售
|
|
|
ToastUtil.showToast(ct, year + "-" + month );
|
|
|
@@ -1118,6 +1109,6 @@ public class ClientActivity extends BaseActivity implements View.OnClickListener
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
ViewUtil.httpSendRequest(ct, url, param, mHandler, headers, what, null, null, "get");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|