Commit 17585259e3dc79c09dd54101f22519911bde81b1

Authored by 姚旭斌
1 parent fd11b76f

no message

.idea/modules.xml
... ... @@ -9,6 +9,7 @@
9 9 <module fileurl="file://$PROJECT_DIR$/parentwork.iml" filepath="$PROJECT_DIR$/parentwork.iml" />
10 10 <module fileurl="file://F:\parentWorkHolper\parentwork.iml" filepath="F:\parentWorkHolper\parentwork.iml" />
11 11 <module fileurl="file://$PROJECT_DIR$/processor/processor.iml" filepath="$PROJECT_DIR$/processor/processor.iml" />
  12 + <module fileurl="file://E:\parentwork\processor\processor.iml" filepath="E:\parentwork\processor\processor.iml" />
12 13 <module fileurl="file://$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" filepath="$PROJECT_DIR$/roundedimageview-2.2.1/roundedimageview-2.2.1.iml" />
13 14 </modules>
14 15 </component>
... ...
app/libs/processor.jar
No preview for this file type
app/src/main/java/com/shunzhi/parent/AppConfig.java
... ... @@ -38,15 +38,15 @@ public class AppConfig {
38 38 public static String APP_IS_START = "app_is_start";
39 39  
40 40 //http://campus.myjxt.com/
41   -// public static String BASE_URL="http://60.190.202.57:1000/";
42   -// public static String BASE_URL_ORDER="http://60.190.202.57:8101/";
43   -// public static String BASE_URL_FILE="http://60.190.202.57:8196";
  41 + public static String BASE_URL="http://60.190.202.57:1000/";
  42 + public static String BASE_URL_ORDER="http://60.190.202.57:8101/";
  43 + public static String BASE_URL_FILE="http://60.190.202.57:8196";
44 44  
45 45  
46 46 //正式
47   - public static String BASE_URL="http://campus.myjxt.com/";
48   - public static String BASE_URL_ORDER="http://parent.myjxt.com/";
49   - public static String BASE_URL_FILE="http://manage.myjxt.com";
  47 +// public static String BASE_URL="http://campus.myjxt.com/";
  48 +// public static String BASE_URL_ORDER="http://parent.myjxt.com/";
  49 +// public static String BASE_URL_FILE="http://manage.myjxt.com";
50 50 // public static final String url_version = BASE_URL + "api/Common/AppVersion?appType=3";
51 51  
52 52  
... ...
app/src/main/java/com/shunzhi/parent/bean/report/ChatBean.java 0 → 100644
... ... @@ -0,0 +1,26 @@
  1 +package com.shunzhi.parent.bean.report;
  2 +
  3 +/**
  4 + * Created by lenovo on 2018/4/10.
  5 + */
  6 +
  7 +public class ChatBean {
  8 + public String date;
  9 + public float gap;
  10 +
  11 + public String getDate() {
  12 + return date;
  13 + }
  14 +
  15 + public void setDate(String date) {
  16 + this.date = date;
  17 + }
  18 +
  19 + public float getGap() {
  20 + return gap;
  21 + }
  22 +
  23 + public void setGap(float gap) {
  24 + this.gap = gap;
  25 + }
  26 +}
... ...
app/src/main/java/com/shunzhi/parent/contract/report/ReportSceneContract.java
... ... @@ -4,9 +4,11 @@ import com.google.gson.JsonObject;
4 4 import com.share.mvpsdk.base.BasePresenter;
5 5 import com.share.mvpsdk.base.IBaseModel;
6 6 import com.share.mvpsdk.base.IBaseView;
  7 +import com.shunzhi.parent.bean.report.ChatBean;
7 8 import com.shunzhi.parent.bean.report.SceneDetialBean;
8 9  
9 10 import java.util.List;
  11 +import java.util.Map;
10 12  
11 13 import io.reactivex.Observable;
12 14  
... ... @@ -23,6 +25,7 @@ public interface ReportSceneContract {
23 25 }
24 26 interface IReportSceneView extends IBaseView {
25 27 void showSceneList(List<SceneDetialBean> list);
  28 + void showChart(List<ChatBean>list1, List<ChatBean>list2, List<ChatBean>list3);
26 29 void showSceneInfo(String rank,String scoree,String pscoree,String sceneName);
27 30  
28 31 }
... ...
app/src/main/java/com/shunzhi/parent/presenter/report/ReportScenePresenter.java
... ... @@ -5,6 +5,7 @@ import com.google.gson.Gson;
5 5 import com.google.gson.JsonArray;
6 6 import com.google.gson.JsonObject;
7 7 import com.share.mvpsdk.utils.ToastUtils;
  8 +import com.shunzhi.parent.bean.report.ChatBean;
8 9 import com.shunzhi.parent.bean.report.SceneDetialBean;
9 10 import com.shunzhi.parent.contract.report.ReportSceneContract;
10 11 import com.shunzhi.parent.model.report.ReportSceneModel;
... ... @@ -49,7 +50,30 @@ public class ReportScenePresenter extends ReportSceneContract.ReportScenePresent
49 50 SceneDetialBean bean = g.fromJson(it.next().toString(), SceneDetialBean.class); //String转化成JavaBean
50 51 list.add(bean); //加入list
51 52 }
  53 + List<ChatBean>list1=new ArrayList<>();
  54 + List<ChatBean>list2=new ArrayList<>();
  55 + List<ChatBean>list3=new ArrayList<>();
  56 + JsonArray objectGap = data.getAsJsonArray("objectGap");
  57 + JsonArray averageGap = data.getAsJsonArray("averageGap");
  58 + JsonArray highGap = data.getAsJsonArray("highGap");
  59 + Iterator it1 = objectGap.iterator(); //Iterator处理
  60 + while (it1.hasNext()) { //循环
  61 + ChatBean bean = g.fromJson(it1.next().toString(), ChatBean.class); //String转化成JavaBean
  62 + list1.add(bean); //加入list
  63 + }
  64 + Iterator it2 = averageGap.iterator(); //Iterator处理
  65 + while (it2.hasNext()) { //循环
  66 + ChatBean bean = g.fromJson(it2.next().toString(), ChatBean.class); //String转化成JavaBean
  67 + list2.add(bean); //加入list
  68 + }
  69 + Iterator it3 = highGap.iterator(); //Iterator处理
  70 + while (it3.hasNext()) { //循环
  71 + ChatBean bean = g.fromJson(it3.next().toString(), ChatBean.class); //String转化成JavaBean
  72 + list3.add(bean); //加入list
  73 + }
  74 +
52 75 mIView.showSceneList(list);
  76 + mIView.showChart(list1,list2,list3);
53 77 mIView.showSceneInfo(rank,scoree,pscoree,sceneName);
54 78 }
55 79 }, new Consumer<Throwable>() {
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ChengZhangFragment.java
... ... @@ -20,6 +20,7 @@ import com.shunzhi.parent.bean.ReportBean;
20 20 import com.shunzhi.parent.contract.report.ReportContract;
21 21 import com.shunzhi.parent.popu.ShaiXuanPop;
22 22 import com.shunzhi.parent.presenter.report.ReportPresenter;
  23 +import com.shunzhi.parent.ui.activity.report.ReportSceneActivity;
23 24  
24 25 import java.util.List;
25 26  
... ... @@ -60,6 +61,9 @@ public class ChengZhangFragment extends BaseMVPCompatFragment&lt;ReportContract.Rep
60 61 @Override
61 62 public void initUI(View view, @Nullable Bundle savedInstanceState) {
62 63  
  64 + ReportSceneActivity.getInstance(getActivity(),3);
  65 +
  66 +
63 67 layout_report = view.findViewById(R.id.layout_report);
64 68 recyclerView = view.findViewById(R.id.recycle_report);
65 69 layout_kaoqin = view.findViewById(R.id.layout_kaoqin);
... ...
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ReportSceneFragment.java
1 1 package com.shunzhi.parent.ui.fragment.report;
2 2  
3 3 import android.annotation.SuppressLint;
  4 +import android.content.res.Resources;
4 5 import android.os.Bundle;
5 6 import android.support.annotation.NonNull;
6 7 import android.support.annotation.Nullable;
... ... @@ -15,6 +16,7 @@ import com.share.mvpsdk.view.chartview.ChartView;
15 16 import com.share.mvpsdk.view.chartview.data.InputData;
16 17 import com.shunzhi.parent.R;
17 18 import com.shunzhi.parent.adapter.ReportSceneAdapter;
  19 +import com.shunzhi.parent.bean.report.ChatBean;
18 20 import com.shunzhi.parent.bean.report.SceneDetialBean;
19 21 import com.shunzhi.parent.contract.report.ReportSceneContract;
20 22 import com.shunzhi.parent.presenter.report.ReportScenePresenter;
... ... @@ -34,7 +36,7 @@ public class ReportSceneFragment extends BaseMVPCompatFragment&lt;ReportSceneContra
34 36 private TextView tv_rank, tv_scoree, tv_pscoree,tv_sceneName;
35 37  
36 38 private ChartView chartView;
37   - String startData="2018-04-04",endData="2018-04-04",objectId="102697";
  39 + String startData="2018-04-03",endData="2018-04-03",objectId="102697";
38 40 int schoolId=1,sceneId;
39 41  
40 42 @NonNull
... ... @@ -62,56 +64,56 @@ public class ReportSceneFragment extends BaseMVPCompatFragment&lt;ReportSceneContra
62 64 sceneDetialAdapter.addAll(scenenlist);
63 65 recycle_scene.setAdapter(sceneDetialAdapter);
64 66 mPresenter.reportSceneResult(sceneId,0,objectId,schoolId, 0,startData,endData);
65   - initChartViews();
66 67 }
67 68  
68   - private void initChartViews() {
69 69  
  70 + @Override
  71 + public void showSceneList(List<SceneDetialBean> list) {
  72 + scenenlist.clear();
  73 + scenenlist.addAll(list);
  74 + sceneDetialAdapter.addAll(scenenlist);
  75 + sceneDetialAdapter.notifyDataSetChanged();
  76 + }
  77 +
  78 + @Override
  79 + public void showChart(List<ChatBean> list1, List<ChatBean> list2, List<ChatBean> list3) {
70 80 chartView.setColors(R.color.textColor, R.color.huodong_blue, R.color.gray);
71   - List<InputData> inputDataList = new ArrayList<>();
72 81 List<InputData> inputDataList1 = new ArrayList<>();
73 82 List<InputData> inputDataList2 = new ArrayList<>();
74   - for (int i = 0; i < 7; i++) {
75   - InputData inputData = new InputData("3/" + i, 10 * i);
76   - inputDataList.add(inputData);
77   - }
78   -
79   - chartView.setChartPaths(inputDataList);
80   -
81   - for (int i = 0; i < 7; i++) {
82   - InputData inputData = new InputData("3/" + i, 20 * i);
  83 + List<InputData> inputDataList3 = new ArrayList<>();
  84 + for (int i = 0; i < list1.size(); i++) {
  85 + InputData inputData = new InputData(list1.get(i).getDate(), (long)list1.get(i).getGap());
83 86 inputDataList1.add(inputData);
84 87 }
85 88  
86 89 chartView.setChartPaths(inputDataList1);
87 90  
88   - for (int i = 0; i < 7; i++) {
89   - InputData inputData = new InputData("3/" + i, 15 * i);
  91 + for (int i = 0; i < list2.size(); i++) {
  92 + InputData inputData = new InputData(list2.get(i).getDate(), (long)list2.get(i).getGap());
90 93 inputDataList2.add(inputData);
91 94 }
92 95  
93 96 chartView.setChartPaths(inputDataList2);
94 97  
95   - }
  98 + for (int i = 0; i <list3.size(); i++) {
  99 + InputData inputData = new InputData(list3.get(i).getDate(),(long) list3.get(i).getGap());
  100 + inputDataList3.add(inputData);
  101 + }
  102 +
  103 + chartView.setChartPaths(inputDataList3);
96 104  
97 105  
98   - @Override
99   - public void showSceneList(List<SceneDetialBean> list) {
100   - scenenlist.clear();
101   - scenenlist.addAll(list);
102   - sceneDetialAdapter.addAll(scenenlist);
103   - sceneDetialAdapter.notifyDataSetChanged();
104 106 }
105 107  
106   - @SuppressLint("ResourceAsColor")
107 108 @Override
108 109 public void showSceneInfo(String rank, String scoree, String pscoree,String sceneName) {
109 110 tv_rank.setText("等级:" + rank);
  111 + Resources res=getResources();
110 112 if(!scoree.startsWith("-")){
111 113 scoree="+"+scoree;
112   - tv_scoree.setTextColor(R.color.textGreen);
  114 + tv_scoree.setTextColor(res.getColor(R.color.textGreen));
113 115 }else{
114   - tv_scoree.setTextColor(R.color.textRed);
  116 + tv_scoree.setTextColor(res.getColor(R.color.textRed));
115 117 }
116 118 tv_scoree.setText("得分:" + scoree);
117 119 tv_pscoree.setText("绩点:" + pscoree);
... ...