|
|
@@ -29,6 +29,7 @@ import com.core.utils.CommonUtil;
|
|
|
import com.core.widget.MyListView;
|
|
|
import com.me.network.app.http.HttpClient;
|
|
|
import com.me.network.app.http.Method;
|
|
|
+import com.me.network.app.http.rx.Result2Listener;
|
|
|
import com.me.network.app.http.rx.ResultListener;
|
|
|
import com.me.network.app.http.rx.ResultSubscriber;
|
|
|
import com.uas.appme.R;
|
|
|
@@ -98,6 +99,14 @@ public class BSettingLocationActivity extends BaseActivity implements View.OnCli
|
|
|
model.setSt_name(JSON.parseObject(updateData).getString("st_name"));
|
|
|
mList.add(model);
|
|
|
myAdapter.notifyDataSetChanged();
|
|
|
+ }else {
|
|
|
+ BSetLocationBean model = new BSetLocationBean();
|
|
|
+ model.setSt_companyname(CommonUtil.getSharedPreferences(MyApplication.getInstance(),"erp_commpany"));
|
|
|
+ model.setSt_companyid(Constant.BASE_COMPANYID);
|
|
|
+ model.setSt_siid(sc_industrycode);
|
|
|
+ model.setSt_name("");
|
|
|
+ mList.add(model);
|
|
|
+ myAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -146,7 +155,8 @@ public class BSettingLocationActivity extends BaseActivity implements View.OnCli
|
|
|
.add("map",JSON.toJSONString(param))
|
|
|
.add("token",MyApplication.getInstance().mAccessToken)
|
|
|
.method(Method.POST)
|
|
|
- .build(),new ResultSubscriber<>(new ResultListener<Object>() {
|
|
|
+ .cacheTime(10000)
|
|
|
+ .build(),new ResultSubscriber<>(new Result2Listener<Object>() {
|
|
|
@Override
|
|
|
public void onResponse(Object o) {
|
|
|
if (!JSONUtil.validate(o.toString()) || o == null) return;
|
|
|
@@ -156,10 +166,15 @@ public class BSettingLocationActivity extends BaseActivity implements View.OnCli
|
|
|
setResult(20);
|
|
|
finish();
|
|
|
}
|
|
|
+ progressDialog.dismiss();save_bt.setEnabled(true);
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ public void onFailure(Object t) {
|
|
|
progressDialog.dismiss();save_bt.setEnabled(true);
|
|
|
}
|
|
|
}));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -267,6 +282,7 @@ public class BSettingLocationActivity extends BaseActivity implements View.OnCli
|
|
|
TextView cancel_tv = (TextView) contentView.findViewById(R.id.cancel_tv);
|
|
|
TextView sure_tv = (TextView) contentView.findViewById(R.id.sure_tv);
|
|
|
|
|
|
+ editname_et.setText(mList.get(position).getSt_name()+"");
|
|
|
DisplayMetrics dm = getResources().getDisplayMetrics();
|
|
|
int w_screen = dm.widthPixels;
|
|
|
int h_screen = dm.heightPixels;
|