|
@@ -21,13 +21,14 @@ import com.common.library.okhttp.callback.Callback;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
import com.ynstkz.shitu.android.R;
|
|
import com.ynstkz.shitu.android.R;
|
|
import com.ynstkz.shitu.android.application.STSign;
|
|
import com.ynstkz.shitu.android.application.STSign;
|
|
|
|
+import com.ynstkz.shitu.android.base.BaseBean;
|
|
import com.ynstkz.shitu.android.base.TitleBarActivity;
|
|
import com.ynstkz.shitu.android.base.TitleBarActivity;
|
|
import com.ynstkz.shitu.android.bean.LocalCityBean;
|
|
import com.ynstkz.shitu.android.bean.LocalCityBean;
|
|
-import com.ynstkz.shitu.android.bean.StudentFamilyInfoBean;
|
|
|
|
-import com.ynstkz.shitu.android.bean.StudentInfoAddBean;
|
|
|
|
|
|
+import com.ynstkz.shitu.android.bean.StudentFamilyDataBean;
|
|
import com.ynstkz.shitu.android.bean.StudentInfoBean;
|
|
import com.ynstkz.shitu.android.bean.StudentInfoBean;
|
|
|
|
+import com.ynstkz.shitu.android.bean.StudentInfoDataBean;
|
|
|
|
+import com.ynstkz.shitu.android.bean.StudentInfoSaveBean;
|
|
import com.ynstkz.shitu.android.data.RequestGroup;
|
|
import com.ynstkz.shitu.android.data.RequestGroup;
|
|
-import com.ynstkz.shitu.android.data.SharedPreferencesUtils;
|
|
|
|
import com.ynstkz.shitu.android.view.ScrollViewWithGridView;
|
|
import com.ynstkz.shitu.android.view.ScrollViewWithGridView;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -71,6 +72,8 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
Button btnSave;
|
|
Button btnSave;
|
|
@Bind(R.id.tv_ProvinceId)
|
|
@Bind(R.id.tv_ProvinceId)
|
|
TextView tvProvinceId;
|
|
TextView tvProvinceId;
|
|
|
|
+ @Bind(R.id.edit_residenceAddress)
|
|
|
|
+ EditText editResidenceAddress;
|
|
|
|
|
|
//学生信息
|
|
//学生信息
|
|
private String birthday;
|
|
private String birthday;
|
|
@@ -79,8 +82,11 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
private String residenceCityId;
|
|
private String residenceCityId;
|
|
private String residenceRegionId;
|
|
private String residenceRegionId;
|
|
|
|
|
|
|
|
+ private String infoId;
|
|
|
|
+
|
|
//家庭成员信息
|
|
//家庭成员信息
|
|
- private List<StudentFamilyInfoBean> listStudentFamilyInfo;
|
|
|
|
|
|
+ private StudentInfoSaveBean studentInfoSaveBean;
|
|
|
|
+ private List<StudentFamilyDataBean> listStudentFamilyData;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
@@ -97,11 +103,10 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
|
|
|
|
private void initView() {
|
|
private void initView() {
|
|
tvTitle.setText("学生信息");
|
|
tvTitle.setText("学生信息");
|
|
- initFamilyInfo();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void initData() {
|
|
private void initData() {
|
|
- listStudentFamilyInfo = new ArrayList<>();
|
|
|
|
|
|
+ studentInfoSaveBean = new StudentInfoSaveBean();
|
|
getStudentInfo();
|
|
getStudentInfo();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -201,7 +206,24 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
showToast("民族不能为空");
|
|
showToast("民族不能为空");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- saveApplyStudentInfo(studentName, birthday, sex + "", ethnic, residenceProvinceId, residenceCityId, residenceRegionId);
|
|
|
|
|
|
+ String residenceAddress = editResidenceAddress.getText().toString().trim();
|
|
|
|
+ if (TextUtils.isEmpty(residenceAddress)) {
|
|
|
|
+ showToast("详细地址不能为空");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ StudentInfoDataBean studentInfoBean = new StudentInfoDataBean();
|
|
|
|
+ studentInfoBean.setInfoId(infoId);
|
|
|
|
+ studentInfoBean.setStudentName(studentName);
|
|
|
|
+ studentInfoBean.setBirthday(birthday);
|
|
|
|
+ studentInfoBean.setSex(sex);
|
|
|
|
+ studentInfoBean.setEthnic(ethnic);
|
|
|
|
+ studentInfoBean.setResidenceProvinceId(residenceProvinceId);
|
|
|
|
+ studentInfoBean.setResidenceCityId(residenceCityId);
|
|
|
|
+ studentInfoBean.setResidenceRegionId(residenceRegionId);
|
|
|
|
+ studentInfoBean.setResidenceAddress(residenceAddress);
|
|
|
|
+ studentInfoSaveBean.setStudentInfo(studentInfoBean);
|
|
|
|
+ studentInfoSaveBean.setFamilyList(saveApplyFamilyInfo());
|
|
|
|
+ saveApplyStudentInfo(studentInfoSaveBean);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -247,15 +269,33 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
if (dataBean == null) {
|
|
if (dataBean == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- StudentInfoBean.DataBean.InfoBean infoBean = dataBean.getStudentInfo();
|
|
|
|
- if (infoBean != null) {
|
|
|
|
- editUsername.setText(infoBean.getStudentName());
|
|
|
|
- tvBirthday.setText(infoBean.getBirthday());
|
|
|
|
- sex = infoBean.getSex();
|
|
|
|
|
|
+ StudentInfoDataBean studentInfoData = dataBean.getStudentInfo();
|
|
|
|
+ if (studentInfoData != null) {
|
|
|
|
+ infoId = studentInfoData.getInfoId() + "";
|
|
|
|
+ editUsername.setText(studentInfoData.getStudentName());
|
|
|
|
+ tvBirthday.setText(studentInfoData.getBirthday().substring(0,10));
|
|
|
|
+ birthday = tvBirthday.getText().toString().trim();
|
|
|
|
+ sex = studentInfoData.getSex();
|
|
tvSex.setText(getResources().getStringArray(R.array.choose_sex)[sex]);
|
|
tvSex.setText(getResources().getStringArray(R.array.choose_sex)[sex]);
|
|
- editNation.setText(infoBean.getEthnic());
|
|
|
|
- residenceCityId = infoBean.getResidenceCityId() + "";
|
|
|
|
-
|
|
|
|
|
|
+ editNation.setText(studentInfoData.getEthnic());
|
|
|
|
+ residenceProvinceId = studentInfoData.getResidenceProvinceId() + "";
|
|
|
|
+ residenceCityId = studentInfoData.getResidenceCityId() + "";
|
|
|
|
+ residenceRegionId = studentInfoData.getResidenceRegionId() + "";
|
|
|
|
+ //户口所在地
|
|
|
|
+ searchCityById("01", "", residenceProvinceId);
|
|
|
|
+ searchCityById("02", residenceProvinceId, residenceCityId);
|
|
|
|
+ searchCityById("03", residenceCityId, residenceRegionId);
|
|
|
|
+ editResidenceAddress.setText(studentInfoData.getResidenceAddress());
|
|
|
|
+
|
|
|
|
+ if(dataBean.getFamilyList() != null && dataBean.getFamilyList().size() > 0 ){
|
|
|
|
+ listStudentFamilyData = dataBean.getFamilyList();
|
|
|
|
+ initFamilyInfo(listStudentFamilyData);
|
|
|
|
+ } else {
|
|
|
|
+ StudentFamilyDataBean studentFamilyDataBean = new StudentFamilyDataBean();
|
|
|
|
+ listStudentFamilyData= new ArrayList<>();
|
|
|
|
+ listStudentFamilyData.add(studentFamilyDataBean);
|
|
|
|
+ initFamilyInfo(listStudentFamilyData);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -296,7 +336,7 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
listDialog.setItems(cityNames, new DialogInterface.OnClickListener() {
|
|
listDialog.setItems(cityNames, new DialogInterface.OnClickListener() {
|
|
@Override
|
|
@Override
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
- if("01".equals(type)){
|
|
|
|
|
|
+ if ("01".equals(type)) {
|
|
residenceProvinceId = dataBean.get(i).getRegionId() + "";
|
|
residenceProvinceId = dataBean.get(i).getRegionId() + "";
|
|
tvProvinceId.setText(dataBean.get(i).getRegionName());
|
|
tvProvinceId.setText(dataBean.get(i).getRegionName());
|
|
} else if ("02".equals(type)) {
|
|
} else if ("02".equals(type)) {
|
|
@@ -320,15 +360,16 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 保存学生信息
|
|
|
|
|
|
+ * 搜索城市根据ID
|
|
|
|
+ *
|
|
|
|
+ * @param type
|
|
|
|
+ * @param parentId
|
|
*/
|
|
*/
|
|
- private void saveApplyStudentInfo(String studentName, String birthday, String sex, String ethnic, String residenceProvinceId,
|
|
|
|
- String residenceCityId, String residenceRegionId) {
|
|
|
|
-
|
|
|
|
- RequestGroup.saveApplyStudentInfo(studentName, birthday, sex, ethnic, residenceProvinceId, residenceCityId, residenceRegionId, new Callback() {
|
|
|
|
|
|
+ private void searchCityById(final String type, String parentId, final String locationId) {
|
|
|
|
+ RequestGroup.getLocalCity(parentId, new Callback() {
|
|
@Override
|
|
@Override
|
|
public Object parseNetworkResponse(Response response, int id) throws Exception {
|
|
public Object parseNetworkResponse(Response response, int id) throws Exception {
|
|
- return new Gson().fromJson(response.body().string(), StudentInfoAddBean.class);
|
|
|
|
|
|
+ return new Gson().fromJson(response.body().string(), LocalCityBean.class);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -338,12 +379,32 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onResponse(Object response, int id) {
|
|
public void onResponse(Object response, int id) {
|
|
- StudentInfoAddBean studentInfoAddBean = (StudentInfoAddBean) response;
|
|
|
|
- if (studentInfoAddBean != null) {
|
|
|
|
- if ("200".equals(studentInfoAddBean.getCode())) {
|
|
|
|
- saveApplyFamilyInfo(studentInfoAddBean.getData() + "");
|
|
|
|
|
|
+ LocalCityBean localCityBean = (LocalCityBean) response;
|
|
|
|
+ if (localCityBean != null) {
|
|
|
|
+ if ("200".equals(localCityBean.getCode())) {
|
|
|
|
+ if (localCityBean.getData() != null) {
|
|
|
|
+ final List<LocalCityBean.DataBean> dataBean = localCityBean.getData();
|
|
|
|
+ if (dataBean != null && dataBean.size() > 0) {
|
|
|
|
+ for (int i = 0; i < dataBean.size(); i++) {
|
|
|
|
+ String regionId = dataBean.get(i).getRegionId() + "";
|
|
|
|
+ if ("01".equals(type)) {
|
|
|
|
+ if (regionId.equals(locationId)) {
|
|
|
|
+ tvProvinceId.setText(dataBean.get(i).getRegionName());
|
|
|
|
+ }
|
|
|
|
+ } else if ("02".equals(type)) {
|
|
|
|
+ if (regionId.equals(locationId)) {
|
|
|
|
+ tvResidenceCityId.setText(dataBean.get(i).getRegionName());
|
|
|
|
+ }
|
|
|
|
+ } else if ("03".equals(type)) {
|
|
|
|
+ if (regionId.equals(locationId)) {
|
|
|
|
+ tvResidenceRegionId.setText(dataBean.get(i).getRegionName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- showToast(studentInfoAddBean.getMsg());
|
|
|
|
|
|
+ showToast(localCityBean.getMsg());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -352,35 +413,14 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 保存家庭成员信息
|
|
|
|
|
|
+ * 保存学生信息
|
|
*/
|
|
*/
|
|
- private void saveApplyFamilyInfo(String studentId) {
|
|
|
|
- if (llMemberFamily.getChildCount() > 0) {
|
|
|
|
- for (int i = 0; i < llMemberFamily.getChildCount(); i++) {
|
|
|
|
- LinearLayout viewMemberFamilyItem = (LinearLayout) llMemberFamily.getChildAt(i);
|
|
|
|
-
|
|
|
|
- String relationShip = ((EditText) viewMemberFamilyItem.findViewById(R.id.edit_relation)).getText().toString().trim();
|
|
|
|
- String tv_familyName = ((EditText) viewMemberFamilyItem.findViewById(R.id.tv_familyName)).getText().toString().trim();
|
|
|
|
- String familyPhone = ((EditText) viewMemberFamilyItem.findViewById(R.id.edit_familyPhone)).getText().toString().trim();
|
|
|
|
- String job = ((EditText) viewMemberFamilyItem.findViewById(R.id.edit_job)).getText().toString().trim();
|
|
|
|
- String remark = ((EditText) viewMemberFamilyItem.findViewById(R.id.edit_remark)).getText().toString().trim();
|
|
|
|
|
|
+ private void saveApplyStudentInfo(StudentInfoSaveBean studentInfoSaveBean) {
|
|
|
|
|
|
- StudentFamilyInfoBean studentFamilyInfoBean = new StudentFamilyInfoBean();
|
|
|
|
- studentFamilyInfoBean.setRelationShip(relationShip);
|
|
|
|
- studentFamilyInfoBean.setFamilyName(tv_familyName);
|
|
|
|
- studentFamilyInfoBean.setFamilyPhone(familyPhone);
|
|
|
|
- studentFamilyInfoBean.setJob(job);
|
|
|
|
- studentFamilyInfoBean.setRemark(remark);
|
|
|
|
- studentFamilyInfoBean.setStudentInfoId(studentId);
|
|
|
|
- studentFamilyInfoBean.setUserId(SharedPreferencesUtils.getUserId());
|
|
|
|
- listStudentFamilyInfo.add(studentFamilyInfoBean);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- RequestGroup.applyFamilyInfo(listStudentFamilyInfo, new Callback() {
|
|
|
|
|
|
+ RequestGroup.saveApplyStudentInfo(studentInfoSaveBean, new Callback() {
|
|
@Override
|
|
@Override
|
|
public Object parseNetworkResponse(Response response, int id) throws Exception {
|
|
public Object parseNetworkResponse(Response response, int id) throws Exception {
|
|
- return new Gson().fromJson(response.body().string(), StudentInfoAddBean.class);
|
|
|
|
|
|
+ return new Gson().fromJson(response.body().string(), BaseBean.class);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -390,47 +430,82 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onResponse(Object response, int id) {
|
|
public void onResponse(Object response, int id) {
|
|
- StudentInfoAddBean studentInfoAddBean = (StudentInfoAddBean) response;
|
|
|
|
- if (studentInfoAddBean != null) {
|
|
|
|
- if ("200".equals(studentInfoAddBean.getCode())) { //提交家庭信息成功
|
|
|
|
|
|
+ BaseBean baseBean = (BaseBean) response;
|
|
|
|
+ if (baseBean != null) {
|
|
|
|
+ showToast(baseBean.getMsg());
|
|
|
|
+ if ("200".equals(baseBean.getCode())) {
|
|
finish();
|
|
finish();
|
|
}
|
|
}
|
|
- showToast(studentInfoAddBean.getMsg());
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 初始化家庭成员信息
|
|
|
|
- */
|
|
|
|
- private void initFamilyInfo() {
|
|
|
|
- llMemberFamily.removeAllViews();
|
|
|
|
- View familyView = LayoutInflater.from(this).inflate(R.layout.item_student_family, null);
|
|
|
|
- TextView tvFamilyLab = familyView.findViewById(R.id.tv_family_lab);
|
|
|
|
- tvFamilyLab.setText("家庭成员1");
|
|
|
|
- ImageView ivFamilyAdd = familyView.findViewById(R.id.iv_family_add);
|
|
|
|
- //添加成员
|
|
|
|
- ivFamilyAdd.setOnClickListener(new View.OnClickListener() {
|
|
|
|
- @Override
|
|
|
|
- public void onClick(View view) {
|
|
|
|
- final View familyView = LayoutInflater.from(StudentInfoActivity.this).inflate(R.layout.item_student_family, null);
|
|
|
|
- TextView tvFamilyLab = familyView.findViewById(R.id.tv_family_lab);
|
|
|
|
|
|
+ private void initFamilyInfo(final List<StudentFamilyDataBean> familyListBean){
|
|
|
|
+ if(familyListBean != null && familyListBean.size() > 0) {
|
|
|
|
+ llMemberFamily.removeAllViews();
|
|
|
|
+ for(int i=0; i<familyListBean.size(); i++) {
|
|
|
|
+
|
|
|
|
+ final StudentFamilyDataBean familyListItem = familyListBean.get(i);
|
|
|
|
+ View familyView = LayoutInflater.from(this).inflate(R.layout.item_student_family, null);
|
|
ImageView ivFamilyAdd = familyView.findViewById(R.id.iv_family_add);
|
|
ImageView ivFamilyAdd = familyView.findViewById(R.id.iv_family_add);
|
|
- ivFamilyAdd.setImageResource(R.drawable.family_info_remove_icon);
|
|
|
|
|
|
+
|
|
|
|
+ ((TextView)familyView.findViewById(R.id.tv_framily_id)).setText(familyListItem.getFamilyId()+"");
|
|
|
|
+ ((EditText)familyView.findViewById(R.id.edit_relation)).setText(familyListItem.getRelationShip());
|
|
|
|
+ ((EditText)familyView.findViewById(R.id.tv_familyName)).setText(familyListItem.getFamilyName());
|
|
|
|
+ ((EditText)familyView.findViewById(R.id.edit_familyPhone)).setText(familyListItem.getFamilyPhone());
|
|
|
|
+
|
|
|
|
+ if(i == 0){
|
|
|
|
+ ivFamilyAdd.setImageResource(R.drawable.family_info_add_icon);
|
|
|
|
+ ivFamilyAdd.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
+ StudentFamilyDataBean addfamily = new StudentFamilyDataBean();
|
|
|
|
+ familyListBean.add(addfamily);
|
|
|
|
+ initFamilyInfo(familyListBean);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ ivFamilyAdd.setImageResource(R.drawable.family_info_remove_icon);
|
|
|
|
+ ivFamilyAdd.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
+ familyListBean.remove(familyListItem);
|
|
|
|
+ deleteStudentFamily(familyListItem.getFamilyId());
|
|
|
|
+ initFamilyInfo(familyListBean);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
llMemberFamily.addView(familyView);
|
|
llMemberFamily.addView(familyView);
|
|
- ivFamilyAdd.setOnClickListener(new View.OnClickListener() {
|
|
|
|
- @Override
|
|
|
|
- public void onClick(View view) {
|
|
|
|
- llMemberFamily.removeView(familyView);
|
|
|
|
- refreshFamilyLab();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- tvFamilyLab.setText("家庭成员" + llMemberFamily.getChildCount());
|
|
|
|
|
|
+ }
|
|
|
|
+ refreshFamilyLab();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 保存家庭成员信息
|
|
|
|
+ */
|
|
|
|
+ private List<StudentFamilyDataBean> saveApplyFamilyInfo() {
|
|
|
|
+ if (llMemberFamily.getChildCount() > 0) {
|
|
|
|
+ List<StudentFamilyDataBean> listStudentFamilyInfo = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < llMemberFamily.getChildCount(); i++) {
|
|
|
|
+ LinearLayout viewMemberFamilyItem = (LinearLayout) llMemberFamily.getChildAt(i);
|
|
|
|
+ String familyId = ((TextView) viewMemberFamilyItem.findViewById(R.id.tv_framily_id)).getText().toString().trim();
|
|
|
|
+ String relationShip = ((EditText) viewMemberFamilyItem.findViewById(R.id.edit_relation)).getText().toString().trim();
|
|
|
|
+ String tv_familyName = ((EditText) viewMemberFamilyItem.findViewById(R.id.tv_familyName)).getText().toString().trim();
|
|
|
|
+ String familyPhone = ((EditText) viewMemberFamilyItem.findViewById(R.id.edit_familyPhone)).getText().toString().trim();
|
|
|
|
+ StudentFamilyDataBean studentFamilyInfoBean = new StudentFamilyDataBean();
|
|
|
|
+ studentFamilyInfoBean.setRelationShip(relationShip);
|
|
|
|
+ studentFamilyInfoBean.setFamilyName(tv_familyName);
|
|
|
|
+ studentFamilyInfoBean.setFamilyPhone(familyPhone);
|
|
|
|
+ listStudentFamilyInfo.add(studentFamilyInfoBean);
|
|
|
|
+ if(!TextUtils.isEmpty(familyId) && !"null".equals(familyId)) {
|
|
|
|
+ studentFamilyInfoBean.setFamilyId(familyId);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- });
|
|
|
|
- llMemberFamily.addView(familyView);
|
|
|
|
|
|
+ return listStudentFamilyInfo;
|
|
|
|
+ }
|
|
|
|
+ return new ArrayList<>();
|
|
}
|
|
}
|
|
|
|
|
|
private void refreshFamilyLab() {
|
|
private void refreshFamilyLab() {
|
|
@@ -442,4 +517,37 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除家庭信息
|
|
|
|
+ * @param familyId
|
|
|
|
+ */
|
|
|
|
+ private void deleteStudentFamily(String familyId){
|
|
|
|
+
|
|
|
|
+ if(TextUtils.isEmpty(familyId)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ RequestGroup.deleteStudentFamily(familyId, new Callback() {
|
|
|
|
+ @Override
|
|
|
|
+ public Object parseNetworkResponse(Response response, int id) throws Exception {
|
|
|
|
+ return new Gson().fromJson(response.body().string(), BaseBean.class);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onError(Call call, Exception e, int id) {
|
|
|
|
+ showToast(getString(R.string.error_msg));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onResponse(Object response, int id) {
|
|
|
|
+ BaseBean baseBean = (BaseBean)response;
|
|
|
|
+ if(baseBean != null){
|
|
|
|
+ if(!"200".equals(baseBean.getCode())) {
|
|
|
|
+ showToast(baseBean.getMsg());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|