| | |
| | | |
| | | try { |
| | | jsonObject = new JSONObject(str); |
| | | String headUrl = jsonObject.getString("head_url"); |
| | | int personType = jsonObject.getInt("personType"); |
| | | String id = jsonObject.getString("ID"); |
| | | String name = jsonObject.getString("name"); |
| | | int sex = 2;//默认是女生 |
| | |
| | | sex = 1; |
| | | } |
| | | } |
| | | Student student =new Student(1001,name,id,sex); |
| | | student.setHead_url(headUrl); |
| | | Student student = new Student(); |
| | | switch (personType){ |
| | | case 0: |
| | | //教练 |
| | | student.setStu_id(1002); |
| | | break; |
| | | case 1: |
| | | //学员 |
| | | student.setStu_id(1001); |
| | | |
| | | break; |
| | | default:break; |
| | | } |
| | | student.setName(name); |
| | | student.setSex(sex); |
| | | student.setPersonType(personType); |
| | | MyLog.i("更新签到人员信息:"+student.toString()); |
| | | WorkRoomDataBase.getWorkRoomDataBase(getApplicationContext()).getstudentDao().insert(student); |
| | | return Result.success(); |