Commit 17585259e3dc79c09dd54101f22519911bde81b1
1 parent
fd11b76f
Exists in
yxb_dev
and in
2 other branches
no message
Showing
8 changed files
with
91 additions
and
31 deletions
Show diff stats
.idea/modules.xml
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | <module fileurl="file://$PROJECT_DIR$/parentwork.iml" filepath="$PROJECT_DIR$/parentwork.iml" /> | 9 | <module fileurl="file://$PROJECT_DIR$/parentwork.iml" filepath="$PROJECT_DIR$/parentwork.iml" /> |
| 10 | <module fileurl="file://F:\parentWorkHolper\parentwork.iml" filepath="F:\parentWorkHolper\parentwork.iml" /> | 10 | <module fileurl="file://F:\parentWorkHolper\parentwork.iml" filepath="F:\parentWorkHolper\parentwork.iml" /> |
| 11 | <module fileurl="file://$PROJECT_DIR$/processor/processor.iml" filepath="$PROJECT_DIR$/processor/processor.iml" /> | 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 | <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 | <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 | </modules> | 14 | </modules> |
| 14 | </component> | 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,15 +38,15 @@ public class AppConfig { | ||
| 38 | public static String APP_IS_START = "app_is_start"; | 38 | public static String APP_IS_START = "app_is_start"; |
| 39 | 39 | ||
| 40 | //http://campus.myjxt.com/ | 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 | // public static final String url_version = BASE_URL + "api/Common/AppVersion?appType=3"; | 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 @@ | @@ -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,9 +4,11 @@ import com.google.gson.JsonObject; | ||
| 4 | import com.share.mvpsdk.base.BasePresenter; | 4 | import com.share.mvpsdk.base.BasePresenter; |
| 5 | import com.share.mvpsdk.base.IBaseModel; | 5 | import com.share.mvpsdk.base.IBaseModel; |
| 6 | import com.share.mvpsdk.base.IBaseView; | 6 | import com.share.mvpsdk.base.IBaseView; |
| 7 | +import com.shunzhi.parent.bean.report.ChatBean; | ||
| 7 | import com.shunzhi.parent.bean.report.SceneDetialBean; | 8 | import com.shunzhi.parent.bean.report.SceneDetialBean; |
| 8 | 9 | ||
| 9 | import java.util.List; | 10 | import java.util.List; |
| 11 | +import java.util.Map; | ||
| 10 | 12 | ||
| 11 | import io.reactivex.Observable; | 13 | import io.reactivex.Observable; |
| 12 | 14 | ||
| @@ -23,6 +25,7 @@ public interface ReportSceneContract { | @@ -23,6 +25,7 @@ public interface ReportSceneContract { | ||
| 23 | } | 25 | } |
| 24 | interface IReportSceneView extends IBaseView { | 26 | interface IReportSceneView extends IBaseView { |
| 25 | void showSceneList(List<SceneDetialBean> list); | 27 | void showSceneList(List<SceneDetialBean> list); |
| 28 | + void showChart(List<ChatBean>list1, List<ChatBean>list2, List<ChatBean>list3); | ||
| 26 | void showSceneInfo(String rank,String scoree,String pscoree,String sceneName); | 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,6 +5,7 @@ import com.google.gson.Gson; | ||
| 5 | import com.google.gson.JsonArray; | 5 | import com.google.gson.JsonArray; |
| 6 | import com.google.gson.JsonObject; | 6 | import com.google.gson.JsonObject; |
| 7 | import com.share.mvpsdk.utils.ToastUtils; | 7 | import com.share.mvpsdk.utils.ToastUtils; |
| 8 | +import com.shunzhi.parent.bean.report.ChatBean; | ||
| 8 | import com.shunzhi.parent.bean.report.SceneDetialBean; | 9 | import com.shunzhi.parent.bean.report.SceneDetialBean; |
| 9 | import com.shunzhi.parent.contract.report.ReportSceneContract; | 10 | import com.shunzhi.parent.contract.report.ReportSceneContract; |
| 10 | import com.shunzhi.parent.model.report.ReportSceneModel; | 11 | import com.shunzhi.parent.model.report.ReportSceneModel; |
| @@ -49,7 +50,30 @@ public class ReportScenePresenter extends ReportSceneContract.ReportScenePresent | @@ -49,7 +50,30 @@ public class ReportScenePresenter extends ReportSceneContract.ReportScenePresent | ||
| 49 | SceneDetialBean bean = g.fromJson(it.next().toString(), SceneDetialBean.class); //String转化成JavaBean | 50 | SceneDetialBean bean = g.fromJson(it.next().toString(), SceneDetialBean.class); //String转化成JavaBean |
| 50 | list.add(bean); //加入list | 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 | mIView.showSceneList(list); | 75 | mIView.showSceneList(list); |
| 76 | + mIView.showChart(list1,list2,list3); | ||
| 53 | mIView.showSceneInfo(rank,scoree,pscoree,sceneName); | 77 | mIView.showSceneInfo(rank,scoree,pscoree,sceneName); |
| 54 | } | 78 | } |
| 55 | }, new Consumer<Throwable>() { | 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,6 +20,7 @@ import com.shunzhi.parent.bean.ReportBean; | ||
| 20 | import com.shunzhi.parent.contract.report.ReportContract; | 20 | import com.shunzhi.parent.contract.report.ReportContract; |
| 21 | import com.shunzhi.parent.popu.ShaiXuanPop; | 21 | import com.shunzhi.parent.popu.ShaiXuanPop; |
| 22 | import com.shunzhi.parent.presenter.report.ReportPresenter; | 22 | import com.shunzhi.parent.presenter.report.ReportPresenter; |
| 23 | +import com.shunzhi.parent.ui.activity.report.ReportSceneActivity; | ||
| 23 | 24 | ||
| 24 | import java.util.List; | 25 | import java.util.List; |
| 25 | 26 | ||
| @@ -60,6 +61,9 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | @@ -60,6 +61,9 @@ public class ChengZhangFragment extends BaseMVPCompatFragment<ReportContract.Rep | ||
| 60 | @Override | 61 | @Override |
| 61 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 62 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 62 | 63 | ||
| 64 | + ReportSceneActivity.getInstance(getActivity(),3); | ||
| 65 | + | ||
| 66 | + | ||
| 63 | layout_report = view.findViewById(R.id.layout_report); | 67 | layout_report = view.findViewById(R.id.layout_report); |
| 64 | recyclerView = view.findViewById(R.id.recycle_report); | 68 | recyclerView = view.findViewById(R.id.recycle_report); |
| 65 | layout_kaoqin = view.findViewById(R.id.layout_kaoqin); | 69 | layout_kaoqin = view.findViewById(R.id.layout_kaoqin); |
app/src/main/java/com/shunzhi/parent/ui/fragment/report/ReportSceneFragment.java
| 1 | package com.shunzhi.parent.ui.fragment.report; | 1 | package com.shunzhi.parent.ui.fragment.report; |
| 2 | 2 | ||
| 3 | import android.annotation.SuppressLint; | 3 | import android.annotation.SuppressLint; |
| 4 | +import android.content.res.Resources; | ||
| 4 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 5 | import android.support.annotation.NonNull; | 6 | import android.support.annotation.NonNull; |
| 6 | import android.support.annotation.Nullable; | 7 | import android.support.annotation.Nullable; |
| @@ -15,6 +16,7 @@ import com.share.mvpsdk.view.chartview.ChartView; | @@ -15,6 +16,7 @@ import com.share.mvpsdk.view.chartview.ChartView; | ||
| 15 | import com.share.mvpsdk.view.chartview.data.InputData; | 16 | import com.share.mvpsdk.view.chartview.data.InputData; |
| 16 | import com.shunzhi.parent.R; | 17 | import com.shunzhi.parent.R; |
| 17 | import com.shunzhi.parent.adapter.ReportSceneAdapter; | 18 | import com.shunzhi.parent.adapter.ReportSceneAdapter; |
| 19 | +import com.shunzhi.parent.bean.report.ChatBean; | ||
| 18 | import com.shunzhi.parent.bean.report.SceneDetialBean; | 20 | import com.shunzhi.parent.bean.report.SceneDetialBean; |
| 19 | import com.shunzhi.parent.contract.report.ReportSceneContract; | 21 | import com.shunzhi.parent.contract.report.ReportSceneContract; |
| 20 | import com.shunzhi.parent.presenter.report.ReportScenePresenter; | 22 | import com.shunzhi.parent.presenter.report.ReportScenePresenter; |
| @@ -34,7 +36,7 @@ public class ReportSceneFragment extends BaseMVPCompatFragment<ReportSceneContra | @@ -34,7 +36,7 @@ public class ReportSceneFragment extends BaseMVPCompatFragment<ReportSceneContra | ||
| 34 | private TextView tv_rank, tv_scoree, tv_pscoree,tv_sceneName; | 36 | private TextView tv_rank, tv_scoree, tv_pscoree,tv_sceneName; |
| 35 | 37 | ||
| 36 | private ChartView chartView; | 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 | int schoolId=1,sceneId; | 40 | int schoolId=1,sceneId; |
| 39 | 41 | ||
| 40 | @NonNull | 42 | @NonNull |
| @@ -62,56 +64,56 @@ public class ReportSceneFragment extends BaseMVPCompatFragment<ReportSceneContra | @@ -62,56 +64,56 @@ public class ReportSceneFragment extends BaseMVPCompatFragment<ReportSceneContra | ||
| 62 | sceneDetialAdapter.addAll(scenenlist); | 64 | sceneDetialAdapter.addAll(scenenlist); |
| 63 | recycle_scene.setAdapter(sceneDetialAdapter); | 65 | recycle_scene.setAdapter(sceneDetialAdapter); |
| 64 | mPresenter.reportSceneResult(sceneId,0,objectId,schoolId, 0,startData,endData); | 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 | chartView.setColors(R.color.textColor, R.color.huodong_blue, R.color.gray); | 80 | chartView.setColors(R.color.textColor, R.color.huodong_blue, R.color.gray); |
| 71 | - List<InputData> inputDataList = new ArrayList<>(); | ||
| 72 | List<InputData> inputDataList1 = new ArrayList<>(); | 81 | List<InputData> inputDataList1 = new ArrayList<>(); |
| 73 | List<InputData> inputDataList2 = new ArrayList<>(); | 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 | inputDataList1.add(inputData); | 86 | inputDataList1.add(inputData); |
| 84 | } | 87 | } |
| 85 | 88 | ||
| 86 | chartView.setChartPaths(inputDataList1); | 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 | inputDataList2.add(inputData); | 93 | inputDataList2.add(inputData); |
| 91 | } | 94 | } |
| 92 | 95 | ||
| 93 | chartView.setChartPaths(inputDataList2); | 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 | @Override | 108 | @Override |
| 108 | public void showSceneInfo(String rank, String scoree, String pscoree,String sceneName) { | 109 | public void showSceneInfo(String rank, String scoree, String pscoree,String sceneName) { |
| 109 | tv_rank.setText("等级:" + rank); | 110 | tv_rank.setText("等级:" + rank); |
| 111 | + Resources res=getResources(); | ||
| 110 | if(!scoree.startsWith("-")){ | 112 | if(!scoree.startsWith("-")){ |
| 111 | scoree="+"+scoree; | 113 | scoree="+"+scoree; |
| 112 | - tv_scoree.setTextColor(R.color.textGreen); | 114 | + tv_scoree.setTextColor(res.getColor(R.color.textGreen)); |
| 113 | }else{ | 115 | }else{ |
| 114 | - tv_scoree.setTextColor(R.color.textRed); | 116 | + tv_scoree.setTextColor(res.getColor(R.color.textRed)); |
| 115 | } | 117 | } |
| 116 | tv_scoree.setText("得分:" + scoree); | 118 | tv_scoree.setText("得分:" + scoree); |
| 117 | tv_pscoree.setText("绩点:" + pscoree); | 119 | tv_pscoree.setText("绩点:" + pscoree); |