作者 朱振飞

add

@@ -50,13 +50,15 @@ public class ChildrenListEntity { @@ -50,13 +50,15 @@ public class ChildrenListEntity {
50 50
51 public static class DataBean { 51 public static class DataBean {
52 /** 52 /**
53 - * "id": 207, 53 + * "id": 2661,
54 * "gender": "女", 54 * "gender": "女",
55 - * "name": "张馨予",  
56 - * "photo": "http://tusmartedu.w.brotop.cn/assets/img/woman_icon.png",  
57 - * "class_name": "六年级(4班)",  
58 - * "grade_name": 6,  
59 - * "week_score": 0 55 + * "name": "易楚笑",
  56 + * "photo": "http://class.ynsdfx.com/uploads/20200329/459394ccdf652cf31717d813c71f60c7.jpg",
  57 + * "class_name": "四年级(3班)",
  58 + * "grade_name": 4,
  59 + * "week_score": 0,
  60 + * "score_level": 1,
  61 + * "score_level_color": "#FF5E5E"
60 */ 62 */
61 63
62 private int id; 64 private int id;
@@ -66,6 +68,24 @@ public class ChildrenListEntity { @@ -66,6 +68,24 @@ public class ChildrenListEntity {
66 private String class_name; 68 private String class_name;
67 private int grade_name; 69 private int grade_name;
68 private int week_score; 70 private int week_score;
  71 + private String score_level;
  72 + private String score_level_color;
  73 +
  74 + public String getScore_level() {
  75 + return score_level;
  76 + }
  77 +
  78 + public void setScore_level(String score_level) {
  79 + this.score_level = score_level;
  80 + }
  81 +
  82 + public String getScore_level_color() {
  83 + return score_level_color;
  84 + }
  85 +
  86 + public void setScore_level_color(String score_level_color) {
  87 + this.score_level_color = score_level_color;
  88 + }
69 89
70 public int getId() { 90 public int getId() {
71 return id; 91 return id;
@@ -205,7 +205,22 @@ public class LoginEntity { @@ -205,7 +205,22 @@ public class LoginEntity {
205 private String classId; 205 private String classId;
206 private String className; 206 private String className;
207 private String photo; 207 private String photo;
  208 + private String score_level_color;
  209 + private String score_level;
  210 + public String getScore_level_color() {
  211 + return score_level_color;
  212 + }
  213 + public void setScore_level_color(String score_level_color) {
  214 + this.score_level_color = score_level_color;
  215 + }
208 216
  217 + public String getScore_level() {
  218 + return score_level;
  219 + }
  220 +
  221 + public void setScore_level(String score_level) {
  222 + this.score_level = score_level;
  223 + }
209 224
210 public String getClassId() { 225 public String getClassId() {
211 return classId; 226 return classId;
@@ -81,6 +81,8 @@ public class M { @@ -81,6 +81,8 @@ public class M {
81 public final static String Type = "Type"; 81 public final static String Type = "Type";
82 public final static String ClassId = "ClassId"; 82 public final static String ClassId = "ClassId";
83 public final static String StudentId = "StudentId"; 83 public final static String StudentId = "StudentId";
  84 + public final static String SCORE_LEVEL = "SCORE_LEVEL";
  85 + public final static String SCORE_LEVEL_COLOR = "SCORE_LEVEL_COLOR";
84 public final static String StudentName = "StudentName"; 86 public final static String StudentName = "StudentName";
85 public final static String UserJson = "UserJson"; 87 public final static String UserJson = "UserJson";
86 public final static String IDENTITY = "identity"; 88 public final static String IDENTITY = "identity";
@@ -224,6 +224,10 @@ public class LoginActivity extends BaseActivity { @@ -224,6 +224,10 @@ public class LoginActivity extends BaseActivity {
224 Config.StudentPhoto=entity.getData().getUser().getStudentInfoList().get(0).getPhoto(); 224 Config.StudentPhoto=entity.getData().getUser().getStudentInfoList().get(0).getPhoto();
225 SharedPreferenceUtil.put(LoginActivity.this,M.STUDENTPHOTO,Config.StudentPhoto); 225 SharedPreferenceUtil.put(LoginActivity.this,M.STUDENTPHOTO,Config.StudentPhoto);
226 } 226 }
  227 +
  228 + SharedPreferenceUtil.put(LoginActivity.this,M.SCORE_LEVEL,entity.getData().getUser().getStudentInfoList().get(0).getScore_level());
  229 + SharedPreferenceUtil.put(LoginActivity.this,M.SCORE_LEVEL_COLOR,entity.getData().getUser().getStudentInfoList().get(0).getScore_level_color());
  230 +
227 SharedPreferenceUtil.put(LoginActivity.this,M.StudentId,entity.getData().getUser().getStudentInfoList().get(0).getId()); 231 SharedPreferenceUtil.put(LoginActivity.this,M.StudentId,entity.getData().getUser().getStudentInfoList().get(0).getId());
228 SharedPreferenceUtil.put(LoginActivity.this,M.StudentName,entity.getData().getUser().getStudentInfoList().get(0).getStudentName()); 232 SharedPreferenceUtil.put(LoginActivity.this,M.StudentName,entity.getData().getUser().getStudentInfoList().get(0).getStudentName());
229 } 233 }
@@ -23,6 +23,7 @@ import com.yinhebairong.clasmanage.entity.ChildrenListEntity; @@ -23,6 +23,7 @@ import com.yinhebairong.clasmanage.entity.ChildrenListEntity;
23 import com.yinhebairong.clasmanage.entity.LoginEntity; 23 import com.yinhebairong.clasmanage.entity.LoginEntity;
24 import com.yinhebairong.clasmanage.m.M; 24 import com.yinhebairong.clasmanage.m.M;
25 import com.yinhebairong.clasmanage.ui.MainActivity; 25 import com.yinhebairong.clasmanage.ui.MainActivity;
  26 +import com.yinhebairong.clasmanage.ui.login.LoginActivity;
26 import com.yinhebairong.clasmanage.utils.SharedPreferenceUtil; 27 import com.yinhebairong.clasmanage.utils.SharedPreferenceUtil;
27 import com.yinhebairong.clasmanage.widget.CircleImageView; 28 import com.yinhebairong.clasmanage.widget.CircleImageView;
28 29
@@ -115,9 +116,13 @@ public class Select_StudentActivity extends BaseActivity { @@ -115,9 +116,13 @@ public class Select_StudentActivity extends BaseActivity {
115 // SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentId,loginEntity.getData().getUser().getStudentInfoList().get(position).getId()); 116 // SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentId,loginEntity.getData().getUser().getStudentInfoList().get(position).getId());
116 // SharedPreferenceUtil.put(Select_StudentActivity.this,M.ClassId,loginEntity.getData().getUser().getStudentInfoList().get(position).getClassId()); 117 // SharedPreferenceUtil.put(Select_StudentActivity.this,M.ClassId,loginEntity.getData().getUser().getStudentInfoList().get(position).getClassId());
117 // SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentName,loginEntity.getData().getUser().getStudentInfoList().get(position).getStudentName()); 118 // SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentName,loginEntity.getData().getUser().getStudentInfoList().get(position).getStudentName());
  119 +
  120 + SharedPreferenceUtil.put(Select_StudentActivity.this, M.SCORE_LEVEL, baseStudentSelectAdapter.getData().get(position).getScore_level());
  121 + SharedPreferenceUtil.put(Select_StudentActivity.this, M.SCORE_LEVEL_COLOR, baseStudentSelectAdapter.getData().get(position).getScore_level_color());
  122 +
118 Intent intent = new Intent(Select_StudentActivity.this, StudentHeadImgActivity.class); 123 Intent intent = new Intent(Select_StudentActivity.this, StudentHeadImgActivity.class);
119 - intent.putExtra("student_id",baseStudentSelectAdapter.getData().get(position).getId());  
120 - intent.putExtra("student_img",baseStudentSelectAdapter.getData().get(position).getPhoto()); 124 + intent.putExtra("student_id", baseStudentSelectAdapter.getData().get(position).getId());
  125 + intent.putExtra("student_img", baseStudentSelectAdapter.getData().get(position).getPhoto());
121 startActivity(intent); 126 startActivity(intent);
122 finish(); 127 finish();
123 } 128 }
@@ -126,17 +131,17 @@ public class Select_StudentActivity extends BaseActivity { @@ -126,17 +131,17 @@ public class Select_StudentActivity extends BaseActivity {
126 @Override 131 @Override
127 public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) { 132 public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
128 Config.id = baseStudentSelectAdapter.getData().get(position).getId(); 133 Config.id = baseStudentSelectAdapter.getData().get(position).getId();
129 - Config.Student_name=baseStudentSelectAdapter.getData().get(position).getName();  
130 - Config.StudentPhoto=baseStudentSelectAdapter.getData().get(position).getPhoto();  
131 - for(LoginEntity.DataBean.UserBean.StudentInfoListBean bean:loginEntity.getData().getUser().getStudentInfoList()){  
132 - if(bean.getId()==Config.id){  
133 - Config.ClassId=bean.getClassId(); 134 + Config.Student_name = baseStudentSelectAdapter.getData().get(position).getName();
  135 + Config.StudentPhoto = baseStudentSelectAdapter.getData().get(position).getPhoto();
  136 + for (LoginEntity.DataBean.UserBean.StudentInfoListBean bean : loginEntity.getData().getUser().getStudentInfoList()) {
  137 + if (bean.getId() == Config.id) {
  138 + Config.ClassId = bean.getClassId();
134 } 139 }
135 } 140 }
136 - SharedPreferenceUtil.put(Select_StudentActivity.this,M.STUDENTPHOTO,baseStudentSelectAdapter.getData().get(position).getPhoto());  
137 - SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentId,loginEntity.getData().getUser().getStudentInfoList().get(position).getId());  
138 - SharedPreferenceUtil.put(Select_StudentActivity.this,M.ClassId,loginEntity.getData().getUser().getStudentInfoList().get(position).getClassId());  
139 - SharedPreferenceUtil.put(Select_StudentActivity.this,M.StudentName,loginEntity.getData().getUser().getStudentInfoList().get(position).getStudentName()); 141 + SharedPreferenceUtil.put(Select_StudentActivity.this, M.STUDENTPHOTO, baseStudentSelectAdapter.getData().get(position).getPhoto());
  142 + SharedPreferenceUtil.put(Select_StudentActivity.this, M.StudentId, loginEntity.getData().getUser().getStudentInfoList().get(position).getId());
  143 + SharedPreferenceUtil.put(Select_StudentActivity.this, M.ClassId, loginEntity.getData().getUser().getStudentInfoList().get(position).getClassId());
  144 + SharedPreferenceUtil.put(Select_StudentActivity.this, M.StudentName, loginEntity.getData().getUser().getStudentInfoList().get(position).getStudentName());
140 Intent intent = new Intent(Select_StudentActivity.this, MainActivity.class); 145 Intent intent = new Intent(Select_StudentActivity.this, MainActivity.class);
141 startActivity(intent); 146 startActivity(intent);
142 setResult(RESULT_OK); 147 setResult(RESULT_OK);
@@ -155,6 +160,7 @@ public class Select_StudentActivity extends BaseActivity { @@ -155,6 +160,7 @@ public class Select_StudentActivity extends BaseActivity {
155 class BaseStudentSelectAdapter extends BaseQuickAdapter<ChildrenListEntity.DataBean, BaseViewHolder> { 160 class BaseStudentSelectAdapter extends BaseQuickAdapter<ChildrenListEntity.DataBean, BaseViewHolder> {
156 161
157 private Context mContext; 162 private Context mContext;
  163 +
158 public BaseStudentSelectAdapter(int layoutResId, @Nullable List<ChildrenListEntity.DataBean> data, Context context) { 164 public BaseStudentSelectAdapter(int layoutResId, @Nullable List<ChildrenListEntity.DataBean> data, Context context) {
159 super(layoutResId, data); 165 super(layoutResId, data);
160 this.mContext = context; 166 this.mContext = context;