lizhanwei
2020-04-10 89752aee9911cdf0fd758474581859e11a45f296
app/src/main/java/safeluck/drive/evaluation/DB/StudentInfoUpdateWork.java
@@ -32,7 +32,7 @@
            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;//默认是女生
@@ -46,8 +46,22 @@
                        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();