|
|
|
@ -2,6 +2,8 @@ package com.rehome.zhdcoa.service;
|
|
|
|
|
|
|
|
|
|
|
|
import android.app.IntentService;
|
|
|
|
import android.app.IntentService;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.Intent;
|
|
|
|
|
|
|
|
import android.text.TextUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import com.rehome.zhdcoa.App;
|
|
|
|
import com.rehome.zhdcoa.App;
|
|
|
|
import com.rehome.zhdcoa.Contans;
|
|
|
|
import com.rehome.zhdcoa.Contans;
|
|
|
|
import com.rehome.zhdcoa.DBModel.Djjh;
|
|
|
|
import com.rehome.zhdcoa.DBModel.Djjh;
|
|
|
|
@ -53,6 +55,10 @@ import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
import static org.litepal.crud.DataSupport.where;
|
|
|
|
import static org.litepal.crud.DataSupport.where;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.net.ssl.HostnameVerifier;
|
|
|
|
|
|
|
|
import javax.net.ssl.SSLSession;
|
|
|
|
|
|
|
|
import javax.net.ssl.SSLSocketFactory;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 上传已完成数据
|
|
|
|
* 上传已完成数据
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -380,6 +386,21 @@ public class UploadDataService extends IntentService {
|
|
|
|
//showLog(xf.toString());
|
|
|
|
//showLog(xf.toString());
|
|
|
|
Request<String> request = NoHttp.createStringRequest(Contans.IP + Contans.XFDJJHSC + "?cjscr=" + UiUtlis.encoder(App.getInstance().getUserInfo().getManid()), RequestMethod.POST);
|
|
|
|
Request<String> request = NoHttp.createStringRequest(Contans.IP + Contans.XFDJJHSC + "?cjscr=" + UiUtlis.encoder(App.getInstance().getUserInfo().getManid()), RequestMethod.POST);
|
|
|
|
request.setDefineRequestBodyForJson(UiUtlis.encoder(xfjson));
|
|
|
|
request.setDefineRequestBodyForJson(UiUtlis.encoder(xfjson));
|
|
|
|
|
|
|
|
if(!TextUtils.isEmpty(request.url())){
|
|
|
|
|
|
|
|
String url =request.url();
|
|
|
|
|
|
|
|
if(url.startsWith("https://219.131.195.3:7100")||url.startsWith("https://219.131.195.3:7011")||url.startsWith("https://219.131.195.3:7081")||url.startsWith("https://219.131.195.3:7082")){
|
|
|
|
|
|
|
|
SSLSocketFactory socketFactory = NohttpUtils.getSSLSocketFactory(this);
|
|
|
|
|
|
|
|
if (socketFactory != null) {
|
|
|
|
|
|
|
|
request.setSSLSocketFactory(socketFactory);
|
|
|
|
|
|
|
|
request.setHostnameVerifier(new HostnameVerifier() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean verify(String s, SSLSession sslSession) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
queue.add(0, request, new HttpResponseListener<>(null, request, callback, false, false, ""));
|
|
|
|
queue.add(0, request, new HttpResponseListener<>(null, request, callback, false, false, ""));
|
|
|
|
//NohttpUtils.getInstance().add(null, 0, request, callback, false, false, "");
|
|
|
|
//NohttpUtils.getInstance().add(null, 0, request, callback, false, false, "");
|
|
|
|
List<XfXcjsInfo> xcjss = DataSupport.findAll(XfXcjsInfo.class);
|
|
|
|
List<XfXcjsInfo> xcjss = DataSupport.findAll(XfXcjsInfo.class);
|
|
|
|
@ -389,6 +410,21 @@ public class UploadDataService extends IntentService {
|
|
|
|
"&jhid=" + UiUtlis.encoder(info.getJhid()) + "&filename=" + UiUtlis.encoder(info.getFilename()) +
|
|
|
|
"&jhid=" + UiUtlis.encoder(info.getJhid()) + "&filename=" + UiUtlis.encoder(info.getFilename()) +
|
|
|
|
"&djr=" + UiUtlis.encoder(info.getDjr()) + "&xfid=" + UiUtlis.encoder(info.getXfid()), RequestMethod.POST);
|
|
|
|
"&djr=" + UiUtlis.encoder(info.getDjr()) + "&xfid=" + UiUtlis.encoder(info.getXfid()), RequestMethod.POST);
|
|
|
|
xcjs.add(Contans.FILEPS, new FileBinary(new File(info.getPath())));
|
|
|
|
xcjs.add(Contans.FILEPS, new FileBinary(new File(info.getPath())));
|
|
|
|
|
|
|
|
if(!TextUtils.isEmpty(xcjs.url())){
|
|
|
|
|
|
|
|
String url =xcjs.url();
|
|
|
|
|
|
|
|
if(url.startsWith("https://219.131.195.3:7100")||url.startsWith("https://219.131.195.3:7011")||url.startsWith("https://219.131.195.3:7081")||url.startsWith("https://219.131.195.3:7082")){
|
|
|
|
|
|
|
|
SSLSocketFactory socketFactory = NohttpUtils.getSSLSocketFactory(this);
|
|
|
|
|
|
|
|
if (socketFactory != null) {
|
|
|
|
|
|
|
|
xcjs.setSSLSocketFactory(socketFactory);
|
|
|
|
|
|
|
|
xcjs.setHostnameVerifier(new HostnameVerifier() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean verify(String s, SSLSession sslSession) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
queue.add(1, xcjs, new HttpResponseListener<>(null, xcjs, callback, false, false, ""));
|
|
|
|
queue.add(1, xcjs, new HttpResponseListener<>(null, xcjs, callback, false, false, ""));
|
|
|
|
//NohttpUtils.getInstance().add(null, 1, xcjs, callback, false, false, "上传中...");
|
|
|
|
//NohttpUtils.getInstance().add(null, 1, xcjs, callback, false, false, "上传中...");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -398,6 +434,21 @@ public class UploadDataService extends IntentService {
|
|
|
|
//showLog(ba.toString());
|
|
|
|
//showLog(ba.toString());
|
|
|
|
Request<String> baxc = NoHttp.createStringRequest(Contans.IP + Contans.BAXCJHSC + "?cjscr=" + UiUtlis.encoder(App.getInstance().getUserInfo().getManid()), RequestMethod.POST);
|
|
|
|
Request<String> baxc = NoHttp.createStringRequest(Contans.IP + Contans.BAXCJHSC + "?cjscr=" + UiUtlis.encoder(App.getInstance().getUserInfo().getManid()), RequestMethod.POST);
|
|
|
|
baxc.setDefineRequestBodyForJson(UiUtlis.encoder(bajson));
|
|
|
|
baxc.setDefineRequestBodyForJson(UiUtlis.encoder(bajson));
|
|
|
|
|
|
|
|
if(!TextUtils.isEmpty(baxc.url())){
|
|
|
|
|
|
|
|
String url =baxc.url();
|
|
|
|
|
|
|
|
if(url.startsWith("https://219.131.195.3:7100")||url.startsWith("https://219.131.195.3:7011")||url.startsWith("https://219.131.195.3:7081")||url.startsWith("https://219.131.195.3:7082")){
|
|
|
|
|
|
|
|
SSLSocketFactory socketFactory = NohttpUtils.getSSLSocketFactory(this);
|
|
|
|
|
|
|
|
if (socketFactory != null) {
|
|
|
|
|
|
|
|
baxc.setSSLSocketFactory(socketFactory);
|
|
|
|
|
|
|
|
baxc.setHostnameVerifier(new HostnameVerifier() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean verify(String s, SSLSession sslSession) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
queue.add(2, baxc, new HttpResponseListener<>(null, baxc, callback, false, false, ""));
|
|
|
|
queue.add(2, baxc, new HttpResponseListener<>(null, baxc, callback, false, false, ""));
|
|
|
|
//NohttpUtils.getInstance().add(null, 2, baxc, callback, false, false, "");
|
|
|
|
//NohttpUtils.getInstance().add(null, 2, baxc, callback, false, false, "");
|
|
|
|
|
|
|
|
|
|
|
|
@ -411,6 +462,21 @@ public class UploadDataService extends IntentService {
|
|
|
|
Request<String> yhpc = NoHttp.createStringRequest(Contans.IP + Contans.YHPC + "?cjscr=" + UiUtlis.encoder(App.getInstance().getUserInfo().getManid()), RequestMethod.POST);
|
|
|
|
Request<String> yhpc = NoHttp.createStringRequest(Contans.IP + Contans.YHPC + "?cjscr=" + UiUtlis.encoder(App.getInstance().getUserInfo().getManid()), RequestMethod.POST);
|
|
|
|
String json1 = "{\"Rows\":" + GsonUtils.GsonString(info) + ",\"Total\": " + info.size() + "}";
|
|
|
|
String json1 = "{\"Rows\":" + GsonUtils.GsonString(info) + ",\"Total\": " + info.size() + "}";
|
|
|
|
yhpc.setDefineRequestBodyForJson(json1);
|
|
|
|
yhpc.setDefineRequestBodyForJson(json1);
|
|
|
|
|
|
|
|
if(!TextUtils.isEmpty(yhpc.url())){
|
|
|
|
|
|
|
|
String url =yhpc.url();
|
|
|
|
|
|
|
|
if(url.startsWith("https://219.131.195.3:7100")||url.startsWith("https://219.131.195.3:7011")||url.startsWith("https://219.131.195.3:7081")||url.startsWith("https://219.131.195.3:7082")){
|
|
|
|
|
|
|
|
SSLSocketFactory socketFactory = NohttpUtils.getSSLSocketFactory(this);
|
|
|
|
|
|
|
|
if (socketFactory != null) {
|
|
|
|
|
|
|
|
yhpc.setSSLSocketFactory(socketFactory);
|
|
|
|
|
|
|
|
yhpc.setHostnameVerifier(new HostnameVerifier() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean verify(String s, SSLSession sslSession) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
queue.add(3, yhpc, new HttpResponseListener<>(null, yhpc, callback, false, false, ""));
|
|
|
|
queue.add(3, yhpc, new HttpResponseListener<>(null, yhpc, callback, false, false, ""));
|
|
|
|
//NohttpUtils.getInstance().add(null, 3, yhpc, callback, false, false, "");
|
|
|
|
//NohttpUtils.getInstance().add(null, 3, yhpc, callback, false, false, "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -418,6 +484,21 @@ public class UploadDataService extends IntentService {
|
|
|
|
requestCount++;
|
|
|
|
requestCount++;
|
|
|
|
Request<String> lyxc = NoHttp.createStringRequest(Contans.IP + Contans.LYXCSC + "?cjscr=" + UiUtlis.encoder(App.getInstance().getUserInfo().getManid()), RequestMethod.POST);
|
|
|
|
Request<String> lyxc = NoHttp.createStringRequest(Contans.IP + Contans.LYXCSC + "?cjscr=" + UiUtlis.encoder(App.getInstance().getUserInfo().getManid()), RequestMethod.POST);
|
|
|
|
lyxc.setDefineRequestBodyForJson(UiUtlis.encoder(lyjson));
|
|
|
|
lyxc.setDefineRequestBodyForJson(UiUtlis.encoder(lyjson));
|
|
|
|
|
|
|
|
if(!TextUtils.isEmpty(lyxc.url())){
|
|
|
|
|
|
|
|
String url =lyxc.url();
|
|
|
|
|
|
|
|
if(url.startsWith("https://219.131.195.3:7100")||url.startsWith("https://219.131.195.3:7011")||url.startsWith("https://219.131.195.3:7081")||url.startsWith("https://219.131.195.3:7082")){
|
|
|
|
|
|
|
|
SSLSocketFactory socketFactory = NohttpUtils.getSSLSocketFactory(this);
|
|
|
|
|
|
|
|
if (socketFactory != null) {
|
|
|
|
|
|
|
|
lyxc.setSSLSocketFactory(socketFactory);
|
|
|
|
|
|
|
|
lyxc.setHostnameVerifier(new HostnameVerifier() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean verify(String s, SSLSession sslSession) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
queue.add(4, lyxc, new HttpResponseListener<>(null, lyxc, callback, false, false, ""));
|
|
|
|
queue.add(4, lyxc, new HttpResponseListener<>(null, lyxc, callback, false, false, ""));
|
|
|
|
//NohttpUtils.getInstance().add(null, 4, lyxc, callback, false, false, "");
|
|
|
|
//NohttpUtils.getInstance().add(null, 4, lyxc, callback, false, false, "");
|
|
|
|
|
|
|
|
|
|
|
|
@ -429,6 +510,21 @@ public class UploadDataService extends IntentService {
|
|
|
|
"&jhid=" + UiUtlis.encoder(lyinfo.getJhid()) + "&filename=" + UiUtlis.encoder(lyinfo.getFilename()) +
|
|
|
|
"&jhid=" + UiUtlis.encoder(lyinfo.getJhid()) + "&filename=" + UiUtlis.encoder(lyinfo.getFilename()) +
|
|
|
|
"&djr=" + UiUtlis.encoder(lyinfo.getDjr()) + "&xfid=" + UiUtlis.encoder(lyinfo.getXfid()), RequestMethod.POST);
|
|
|
|
"&djr=" + UiUtlis.encoder(lyinfo.getDjr()) + "&xfid=" + UiUtlis.encoder(lyinfo.getXfid()), RequestMethod.POST);
|
|
|
|
xcjs.add(Contans.FILEPS, new FileBinary(new File(lyinfo.getPath())));
|
|
|
|
xcjs.add(Contans.FILEPS, new FileBinary(new File(lyinfo.getPath())));
|
|
|
|
|
|
|
|
if(!TextUtils.isEmpty(xcjs.url())){
|
|
|
|
|
|
|
|
String url =xcjs.url();
|
|
|
|
|
|
|
|
if(url.startsWith("https://219.131.195.3:7100")||url.startsWith("https://219.131.195.3:7011")||url.startsWith("https://219.131.195.3:7081")||url.startsWith("https://219.131.195.3:7082")){
|
|
|
|
|
|
|
|
SSLSocketFactory socketFactory = NohttpUtils.getSSLSocketFactory(this);
|
|
|
|
|
|
|
|
if (socketFactory != null) {
|
|
|
|
|
|
|
|
xcjs.setSSLSocketFactory(socketFactory);
|
|
|
|
|
|
|
|
xcjs.setHostnameVerifier(new HostnameVerifier() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean verify(String s, SSLSession sslSession) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
queue.add(5, xcjs, new HttpResponseListener<>(null, xcjs, callback, false, false, ""));
|
|
|
|
queue.add(5, xcjs, new HttpResponseListener<>(null, xcjs, callback, false, false, ""));
|
|
|
|
//NohttpUtils.getInstance().add(null, 5, xcjs, callback, false, false, "");
|
|
|
|
//NohttpUtils.getInstance().add(null, 5, xcjs, callback, false, false, "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|