|
|
|
|
@ -9,6 +9,7 @@ import android.widget.CheckBox;
|
|
|
|
|
import android.widget.ListView;
|
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
import com.orhanobut.logger.Logger;
|
|
|
|
|
import com.rehome.zhdcoa.App;
|
|
|
|
|
import com.rehome.zhdcoa.Contans;
|
|
|
|
|
import com.rehome.zhdcoa.DBModel.LyxcXmList;
|
|
|
|
|
import com.rehome.zhdcoa.DBModel.LyxcqyList;
|
|
|
|
|
@ -29,6 +30,7 @@ import com.rehome.zhdcoa.base.BaseFragment;
|
|
|
|
|
import com.rehome.zhdcoa.utils.GsonUtils;
|
|
|
|
|
import com.rehome.zhdcoa.utils.HttpListener;
|
|
|
|
|
import com.rehome.zhdcoa.utils.HttpResponseListener;
|
|
|
|
|
import com.rehome.zhdcoa.utils.NohttpUtils;
|
|
|
|
|
import com.rehome.zhdcoa.utils.SPUtils;
|
|
|
|
|
import com.rehome.zhdcoa.utils.UiUtlis;
|
|
|
|
|
import com.rehome.zhdcoa.weiget.WaitDialog;
|
|
|
|
|
@ -204,6 +206,14 @@ public class XxzjhFragment extends BaseFragment {
|
|
|
|
|
private void requestData() {
|
|
|
|
|
Request<String> request = NoHttp.createStringRequest(Contans.IP + Contans.XFDJJHALL);
|
|
|
|
|
request.add("bzbh", UiUtlis.encoder((String) SPUtils.get(context, Contans.BZBH, "")));
|
|
|
|
|
if(App.getInstance().getUserInfo()!=null&&App.getInstance().getUserInfo().getToken()!=null){
|
|
|
|
|
String token = App.getInstance().getUserInfo().getToken();
|
|
|
|
|
String credential = "Bearer " + token;
|
|
|
|
|
request.addHeader("Authorization", credential);
|
|
|
|
|
showLog(request.url());
|
|
|
|
|
// showLog(credential);
|
|
|
|
|
// showLog(new Gson().toJson(request.headers()));
|
|
|
|
|
}
|
|
|
|
|
queue.add(0, request, new HttpResponseListener<>(getActivity(), request, callback, true, true, "加载中..."));
|
|
|
|
|
|
|
|
|
|
//NohttpUtils.getInstance().add(getActivity(), 0, request, callback, true, true, "加载中...");
|
|
|
|
|
@ -214,6 +224,14 @@ public class XxzjhFragment extends BaseFragment {
|
|
|
|
|
requestCount++;
|
|
|
|
|
Request<String> request = NoHttp.createStringRequest(Contans.IP + Contans.XFDJJHXZ);
|
|
|
|
|
request.add("jhid", UiUtlis.encoder(jhid));
|
|
|
|
|
if(App.getInstance().getUserInfo()!=null&&App.getInstance().getUserInfo().getToken()!=null){
|
|
|
|
|
String token = App.getInstance().getUserInfo().getToken();
|
|
|
|
|
String credential = "Bearer " + token;
|
|
|
|
|
request.addHeader("Authorization", credential);
|
|
|
|
|
showLog(request.url());
|
|
|
|
|
// showLog(credential);
|
|
|
|
|
// showLog(new Gson().toJson(request.headers()));
|
|
|
|
|
}
|
|
|
|
|
queue.add(1, request, new HttpResponseListener<>(getActivity(), request, callback, false, false, ""));
|
|
|
|
|
//NohttpUtils.getInstance().add(getActivity(), 1, request, callback, false, false, "下载计划中...");
|
|
|
|
|
|
|
|
|
|
@ -221,31 +239,71 @@ public class XxzjhFragment extends BaseFragment {
|
|
|
|
|
Request<String> request1 = NoHttp.createStringRequest(Contans.IP + Contans.XFXCMHQC);
|
|
|
|
|
request1.add("jhid", UiUtlis.encoder(jhid));
|
|
|
|
|
request1.add("xftype", 1);
|
|
|
|
|
if(App.getInstance().getUserInfo()!=null&&App.getInstance().getUserInfo().getToken()!=null){
|
|
|
|
|
String token = App.getInstance().getUserInfo().getToken();
|
|
|
|
|
String credential = "Bearer " + token;
|
|
|
|
|
request1.addHeader("Authorization", credential);
|
|
|
|
|
showLog(request1.url());
|
|
|
|
|
// showLog(credential);
|
|
|
|
|
// showLog(new Gson().toJson(request.headers()));
|
|
|
|
|
}
|
|
|
|
|
queue.add(2, request1, new HttpResponseListener<>(getActivity(), request1, callback, false, false, "加载中..."));
|
|
|
|
|
//NohttpUtils.getInstance().add(getActivity(), 2, request1, callback, false, false, "下载计划中...");
|
|
|
|
|
|
|
|
|
|
requestCount++;
|
|
|
|
|
Request<String> request2 = NoHttp.createStringRequest(Contans.IP + Contans.XFXCXM);
|
|
|
|
|
request2.add("jhid", UiUtlis.encoder(jhid));
|
|
|
|
|
if(App.getInstance().getUserInfo()!=null&&App.getInstance().getUserInfo().getToken()!=null){
|
|
|
|
|
String token = App.getInstance().getUserInfo().getToken();
|
|
|
|
|
String credential = "Bearer " + token;
|
|
|
|
|
request2.addHeader("Authorization", credential);
|
|
|
|
|
showLog(request2.url());
|
|
|
|
|
// showLog(credential);
|
|
|
|
|
// showLog(new Gson().toJson(request.headers()));
|
|
|
|
|
}
|
|
|
|
|
queue.add(3, request2, new HttpResponseListener<>(getActivity(), request2, callback, false, false, "加载中..."));
|
|
|
|
|
//NohttpUtils.getInstance().add(getActivity(), 3, request2, callback, false, false, "下载计划中");
|
|
|
|
|
} else if (xctypes.equals("2")) {
|
|
|
|
|
requestCount++;
|
|
|
|
|
Request<String> xfba = NoHttp.createStringRequest(Contans.IP + Contans.BAXCJHXZ);
|
|
|
|
|
xfba.add("jhid", UiUtlis.encoder(jhid));
|
|
|
|
|
if(App.getInstance().getUserInfo()!=null&&App.getInstance().getUserInfo().getToken()!=null){
|
|
|
|
|
String token = App.getInstance().getUserInfo().getToken();
|
|
|
|
|
String credential = "Bearer " + token;
|
|
|
|
|
xfba.addHeader("Authorization", credential);
|
|
|
|
|
showLog(xfba.url());
|
|
|
|
|
// showLog(credential);
|
|
|
|
|
// showLog(new Gson().toJson(request.headers()));
|
|
|
|
|
}
|
|
|
|
|
queue.add(4, xfba, new HttpResponseListener<>(getActivity(), xfba, callback, false, false, "加载中..."));
|
|
|
|
|
//NohttpUtils.getInstance().add(getActivity(), 4, xfba, callback, false, false, "下载计划中");
|
|
|
|
|
} else if (xctypes.equals("3")) {
|
|
|
|
|
requestCount++;
|
|
|
|
|
Request<String> lyxc = NoHttp.createStringRequest(Contans.IP + Contans.LYXCXM);
|
|
|
|
|
lyxc.add("jhid", UiUtlis.encoder(jhid));
|
|
|
|
|
if(App.getInstance().getUserInfo()!=null&&App.getInstance().getUserInfo().getToken()!=null){
|
|
|
|
|
String token = App.getInstance().getUserInfo().getToken();
|
|
|
|
|
String credential = "Bearer " + token;
|
|
|
|
|
lyxc.addHeader("Authorization", credential);
|
|
|
|
|
showLog(lyxc.url());
|
|
|
|
|
// showLog(credential);
|
|
|
|
|
// showLog(new Gson().toJson(request.headers()));
|
|
|
|
|
}
|
|
|
|
|
queue.add(5, lyxc, new HttpResponseListener<>(getActivity(), lyxc, callback, false, false, "加载中..."));
|
|
|
|
|
//NohttpUtils.getInstance().add(getActivity(), 5, lyxc, callback, false, false, "下载计划中");
|
|
|
|
|
requestCount++;
|
|
|
|
|
Request<String> lyxcqy = NoHttp.createStringRequest(Contans.IP + Contans.LYXCQY);
|
|
|
|
|
lyxcqy.add("jhid", UiUtlis.encoder(jhid));
|
|
|
|
|
if(App.getInstance().getUserInfo()!=null&&App.getInstance().getUserInfo().getToken()!=null){
|
|
|
|
|
String token = App.getInstance().getUserInfo().getToken();
|
|
|
|
|
String credential = "Bearer " + token;
|
|
|
|
|
lyxcqy.addHeader("Authorization", credential);
|
|
|
|
|
showLog(lyxcqy.url());
|
|
|
|
|
// showLog(credential);
|
|
|
|
|
// showLog(new Gson().toJson(request.headers()));
|
|
|
|
|
}
|
|
|
|
|
queue.add(6, lyxcqy, new HttpResponseListener<>(getActivity(), lyxcqy, callback, false, false, "加载中..."));
|
|
|
|
|
//NohttpUtils.getInstance().add(getActivity(), 6, lyxcqy, callback, false, false, "下载计划中");
|
|
|
|
|
NohttpUtils.getInstance().add(getActivity(), 6, lyxcqy, callback, false, false, "下载计划中");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|