|
@@ -15,6 +15,7 @@ import com.common.data.JSONUtil;
|
|
|
import com.common.data.StringUtil;
|
|
import com.common.data.StringUtil;
|
|
|
import com.core.app.MyApplication;
|
|
import com.core.app.MyApplication;
|
|
|
import com.core.base.BaseActivity;
|
|
import com.core.base.BaseActivity;
|
|
|
|
|
+import com.core.utils.CommonUtil;
|
|
|
import com.me.network.app.http.HttpClient;
|
|
import com.me.network.app.http.HttpClient;
|
|
|
import com.me.network.app.http.Method;
|
|
import com.me.network.app.http.Method;
|
|
|
import com.me.network.app.http.rx.ResultListener;
|
|
import com.me.network.app.http.rx.ResultListener;
|
|
@@ -49,8 +50,10 @@ public class PersonSettingActivity extends BaseActivity implements View.OnClickL
|
|
|
setContentView(R.layout.person_setting_activity);
|
|
setContentView(R.layout.person_setting_activity);
|
|
|
|
|
|
|
|
initView();
|
|
initView();
|
|
|
|
|
+ initData();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
private void initView() {
|
|
private void initView() {
|
|
|
|
|
|
|
|
mUserNameTv = (FormEditText) findViewById(R.id.user_name_tv);
|
|
mUserNameTv = (FormEditText) findViewById(R.id.user_name_tv);
|
|
@@ -71,22 +74,29 @@ public class PersonSettingActivity extends BaseActivity implements View.OnClickL
|
|
|
|
|
|
|
|
mBtnSave.setOnClickListener(this);
|
|
mBtnSave.setOnClickListener(this);
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ private void initData() {
|
|
|
|
|
|
|
|
//更新时的数据获取
|
|
//更新时的数据获取
|
|
|
- PersonSetingBean.ResultBean model = new PersonSetingBean.ResultBean();
|
|
|
|
|
- model = getIntent().getParcelableExtra("model");
|
|
|
|
|
- if (model != null)
|
|
|
|
|
- showUpdatedata(model);
|
|
|
|
|
|
|
+ String result = getIntent().getStringExtra("mdoel");
|
|
|
|
|
+ int position = getIntent().getIntExtra("position",-1);
|
|
|
|
|
+ if (!StringUtil.isEmpty(result) && position != -1)
|
|
|
|
|
+ showUpdatedata(result,position);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void showUpdatedata(PersonSetingBean.ResultBean model) {
|
|
|
|
|
- mUserNameTv.setText(model.getSm_username());
|
|
|
|
|
- mUserDepartmentTv.setText(model.getSm_stname());
|
|
|
|
|
- mUserJobTv.setText(model.getSm_level());
|
|
|
|
|
- mUserTelTv.setText(model.getSm_telephone());
|
|
|
|
|
- mUserEmailTv.setText("");
|
|
|
|
|
-
|
|
|
|
|
- sm_id = model.getSm_id();
|
|
|
|
|
|
|
+ private void showUpdatedata(String result,int position) {
|
|
|
|
|
+ PersonSetingBean model = new PersonSetingBean();
|
|
|
|
|
+ try {
|
|
|
|
|
+ model = JSON.parseObject(result,PersonSetingBean.class);
|
|
|
|
|
+ mUserNameTv.setText(model.getResult().get(position).getSm_username());
|
|
|
|
|
+ mUserDepartmentTv.setText(model.getResult().get(position).getSm_stname());
|
|
|
|
|
+ mUserJobTv.setText(model.getResult().get(position).getSm_level());
|
|
|
|
|
+ mUserTelTv.setText(model.getResult().get(position).getSm_telephone());
|
|
|
|
|
+ mUserEmailTv.setText("");
|
|
|
|
|
+ sm_id = model.getResult().get(position).getSm_id();
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -105,7 +115,6 @@ public class PersonSettingActivity extends BaseActivity implements View.OnClickL
|
|
|
&& mUserDepartmentTv.testValidity() && mUserJobTv.testValidity() &&
|
|
&& mUserDepartmentTv.testValidity() && mUserJobTv.testValidity() &&
|
|
|
mUserTelTv.testValidity()&& mUserEmailTv.testValidity()
|
|
mUserTelTv.testValidity()&& mUserEmailTv.testValidity()
|
|
|
){
|
|
){
|
|
|
-
|
|
|
|
|
if (mUserEmailTv.getText().toString().contains("@")){
|
|
if (mUserEmailTv.getText().toString().contains("@")){
|
|
|
saveRequest();
|
|
saveRequest();
|
|
|
}else {
|
|
}else {
|
|
@@ -124,8 +133,10 @@ public class PersonSettingActivity extends BaseActivity implements View.OnClickL
|
|
|
params.put("sm_stid",111);
|
|
params.put("sm_stid",111);
|
|
|
params.put("sm_userid",MyApplication.getInstance().mLoginUser.getUserId());
|
|
params.put("sm_userid",MyApplication.getInstance().mLoginUser.getUserId());
|
|
|
params.put("sm_username",mUserNameTv.getText().toString());
|
|
params.put("sm_username",mUserNameTv.getText().toString());
|
|
|
|
|
+// params.put("sm_companyid",CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_uu"));
|
|
|
params.put("sm_companyid",201);
|
|
params.put("sm_companyid",201);
|
|
|
- params.put("sm_companyname",mUserDepartmentTv.getText().toString());
|
|
|
|
|
|
|
+ params.put("sm_stname",mUserDepartmentTv.getText().toString());
|
|
|
|
|
+ params.put("sm_companyname", CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_commpany"));
|
|
|
params.put("sm_level",mUserJobTv.getText().toString());
|
|
params.put("sm_level",mUserJobTv.getText().toString());
|
|
|
params.put("sm_telephone",mUserTelTv.getText().toString());
|
|
params.put("sm_telephone",mUserTelTv.getText().toString());
|
|
|
params.put("sm_email",mUserEmailTv.getText().toString());
|
|
params.put("sm_email",mUserEmailTv.getText().toString());
|