|
@@ -54,6 +54,7 @@ import com.google.gson.Gson;
|
|
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
|
|
import com.uas.standard_esop.R;
|
|
import com.uas.standard_esop.R;
|
|
|
import com.uas.standard_esop.application.PdaApplication;
|
|
import com.uas.standard_esop.application.PdaApplication;
|
|
|
|
|
+import com.uas.standard_esop.bean.BeanSop;
|
|
|
import com.uas.standard_esop.bean.CloseEventBusBean;
|
|
import com.uas.standard_esop.bean.CloseEventBusBean;
|
|
|
import com.uas.standard_esop.bean.IpAndPortBean;
|
|
import com.uas.standard_esop.bean.IpAndPortBean;
|
|
|
import com.uas.standard_esop.bean.LineCodeEntity;
|
|
import com.uas.standard_esop.bean.LineCodeEntity;
|
|
@@ -150,6 +151,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
private LinearLayout line_login_post;
|
|
private LinearLayout line_login_post;
|
|
|
private RecyclerView ra_dataurl;
|
|
private RecyclerView ra_dataurl;
|
|
|
private ArrayList<ResourcefileBean.DataBean.UrlBean> urlBeanList;
|
|
private ArrayList<ResourcefileBean.DataBean.UrlBean> urlBeanList;
|
|
|
|
|
+ private ArrayList<BeanSop> urlBeantwoList;
|
|
|
private SelectAdapter pdfOrImageAdapter;
|
|
private SelectAdapter pdfOrImageAdapter;
|
|
|
private String ss_nametext;
|
|
private String ss_nametext;
|
|
|
private String ss_codetext;
|
|
private String ss_codetext;
|
|
@@ -203,6 +205,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
private ImageView iv_login_post;
|
|
private ImageView iv_login_post;
|
|
|
private String tvSS_brdip;
|
|
private String tvSS_brdip;
|
|
|
private String tvSS_brdport;
|
|
private String tvSS_brdport;
|
|
|
|
|
+ private BeanSop urlBean;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void onDestroy() {
|
|
protected void onDestroy() {
|
|
@@ -374,6 +377,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
urlBeanList = new ArrayList<>();
|
|
urlBeanList = new ArrayList<>();
|
|
|
|
|
+ urlBeantwoList = new ArrayList<>();
|
|
|
pdfOrImageAdapter = new SelectAdapter(urlBeanList);
|
|
pdfOrImageAdapter = new SelectAdapter(urlBeanList);
|
|
|
// ra_dataurl.addItemDecoration(new DividerItemDecoration(this, LinearLayout.HORIZONTAL));
|
|
// ra_dataurl.addItemDecoration(new DividerItemDecoration(this, LinearLayout.HORIZONTAL));
|
|
|
// ra_dataurl.setLayoutManager(new LinearLayoutManager(this));
|
|
// ra_dataurl.setLayoutManager(new LinearLayoutManager(this));
|
|
@@ -885,6 +889,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ //获取数据
|
|
|
private void getSourcePunchInfo() {
|
|
private void getSourcePunchInfo() {
|
|
|
if (tv_dc_line.getText().toString().trim().isEmpty()){
|
|
if (tv_dc_line.getText().toString().trim().isEmpty()){
|
|
|
return;
|
|
return;
|
|
@@ -894,7 +899,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- progressDialog.show();
|
|
|
|
|
|
|
+// progressDialog.show();
|
|
|
VollyRequest.getInstance().stringRequest(mStringRequest,
|
|
VollyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
new HttpParams.Builder()
|
|
new HttpParams.Builder()
|
|
|
.url(GloableParams.ADDRESS_SPM_GETSOPRELEASE)
|
|
.url(GloableParams.ADDRESS_SPM_GETSOPRELEASE)
|
|
@@ -907,7 +912,63 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
progressDialog.dismiss();
|
|
|
- setdataDisplay(o.toString());
|
|
|
|
|
|
|
+ JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(),"data");
|
|
|
|
|
+ LogUtil.edayin("stringtextsss=======",o.toString()+"");
|
|
|
|
|
+ urlBeantwoList.clear();
|
|
|
|
|
+ for (Object index : dataArray){
|
|
|
|
|
+ JSONObject data = (JSONObject) index;
|
|
|
|
|
+ urlBean = new BeanSop(data.getString("PATH")
|
|
|
|
|
+ ,data.getString("FILENAME"));
|
|
|
|
|
+ urlBeantwoList.add(urlBean);
|
|
|
|
|
+ }
|
|
|
|
|
+ list = new ArrayList<>();
|
|
|
|
|
+ for (int i=0;i<urlBeantwoList.size();i++){
|
|
|
|
|
+ BeanSop urlBean = urlBeantwoList.get(i);
|
|
|
|
|
+ String filename = urlBean.getFilename().replace(".jpg","");
|
|
|
|
|
+ if (StringUtil.isEmpty(urlBean.getPath())){
|
|
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this,"数据为空");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (filename.equals(at_gvtext.getText().toString().trim())){
|
|
|
|
|
+ String path = urlBean.getPath();
|
|
|
|
|
+ String str2 = new String(Base64.decode(path.getBytes(),Base64.DEFAULT));
|
|
|
|
|
+ Log.e("str2==",str2);
|
|
|
|
|
+ list.add(str2);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ if (urlBeantwoList.size()>0) {
|
|
|
|
|
+
|
|
|
|
|
+ String filenametcp=null;
|
|
|
|
|
+ for (int i=0;i<urlBeantwoList.size();i++){
|
|
|
|
|
+ BeanSop urlBean = urlBeantwoList.get(i);
|
|
|
|
|
+ filenametcp = urlBean.getFilename();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StringUtil.isEmpty(filenametcp)) {
|
|
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this, "未有 "+at_gvtext.getText().toString().trim()+" 匹配数据");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // getPdfOrImage("");
|
|
|
|
|
+ if (filenametcp.contains(".pdf") || filenametcp.contains(".PDF")) {
|
|
|
|
|
+ Intent intent = new Intent(IndexActivity.this, PdfsActivity.class);
|
|
|
|
|
+ intent.putStringArrayListExtra("lists", list);
|
|
|
|
|
+ intent.putExtra("filename", filenametcp);
|
|
|
|
|
+ startActivity(intent);
|
|
|
|
|
+ } else if (filenametcp.contains(".PNG") || filenametcp.contains(".JPG") || filenametcp.contains(".webp") || filenametcp.contains(".jpeg")
|
|
|
|
|
+ || filenametcp.contains(".png") || filenametcp.contains(".jpg") || filenametcp.contains(".WEBP") || filenametcp.contains(".JPEG")) {
|
|
|
|
|
+ Intent intent = new Intent(IndexActivity.this, BannerActivity.class);
|
|
|
|
|
+ intent.putStringArrayListExtra("lists", list);
|
|
|
|
|
+ startActivity(intent);
|
|
|
|
|
+ } else if (filenametcp.contains(".MP4") || filenametcp.contains(".mp4")){
|
|
|
|
|
+ Intent intent = new Intent(IndexActivity.this, VideoActivity.class);
|
|
|
|
|
+ intent.putStringArrayListExtra("lists", list);
|
|
|
|
|
+ startActivity(intent);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this, "此文件无法打开");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+// setdataDisplay(o.toString());
|
|
|
}
|
|
}
|
|
|
@Override
|
|
@Override
|
|
|
public void onFail(int flag, String failStr) throws Exception {
|
|
public void onFail(int flag, String failStr) throws Exception {
|
|
@@ -1179,7 +1240,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
em_name_port.setText(ss_brdport);
|
|
em_name_port.setText(ss_brdport);
|
|
|
sound_monitor_vibration_sv.setClickable(true);
|
|
sound_monitor_vibration_sv.setClickable(true);
|
|
|
at_gvtext.setText(ss_nametext);
|
|
at_gvtext.setText(ss_nametext);
|
|
|
- getchangeTcpdata();
|
|
|
|
|
|
|
+// getchangeTcpdata();
|
|
|
closeListPopupWindow();
|
|
closeListPopupWindow();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -2056,7 +2117,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
@Override
|
|
@Override
|
|
|
public boolean handleMessage(Message msg) {
|
|
public boolean handleMessage(Message msg) {
|
|
|
String stringtext = msg.obj.toString();
|
|
String stringtext = msg.obj.toString();
|
|
|
- setdataDisplay(stringtext);
|
|
|
|
|
|
|
+// setdataDisplay(stringtext);
|
|
|
// new Thread(new Runnable() {
|
|
// new Thread(new Runnable() {
|
|
|
// @Override
|
|
// @Override
|
|
|
// public void run() {
|
|
// public void run() {
|
|
@@ -2091,53 +2152,12 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
}
|
|
}
|
|
|
public void setdataDisplay(String stringtextsss){//获取数据
|
|
public void setdataDisplay(String stringtextsss){//获取数据
|
|
|
|
|
|
|
|
- LogUtil.edayin("stringtextsss=======",stringtextsss+"");
|
|
|
|
|
-// if (badJson){
|
|
|
|
|
- SharedPreUtil.removeString(this,"stringtexttcp");
|
|
|
|
|
- SharedPreUtil.saveString(IndexActivity.this,"stringtexttcp", stringtextsss);
|
|
|
|
|
if (!stringtextsss.isEmpty()) {
|
|
if (!stringtextsss.isEmpty()) {
|
|
|
list = new ArrayList<>();
|
|
list = new ArrayList<>();
|
|
|
- Gson gson = new Gson();
|
|
|
|
|
- ResourcefileBean loginData = gson.fromJson(stringtextsss, ResourcefileBean.class);
|
|
|
|
|
- ResourcefileBean.DataBean data = loginData.getData();
|
|
|
|
|
- tv_pscode.setText(data.getPs_code());
|
|
|
|
|
- li_codedata = data.getLi_code();
|
|
|
|
|
- urlBeanList.clear();
|
|
|
|
|
- List<ResourcefileBean.DataBean.UrlBean> url = data.getUrl();
|
|
|
|
|
- if (url.isEmpty()){
|
|
|
|
|
- CommonUtil.toastNoRepeat(IndexActivity.this,"数据为空");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- for (int i=0;i<url.size();i++){
|
|
|
|
|
- ResourcefileBean.DataBean.UrlBean urlBean = url.get(i);
|
|
|
|
|
- String filename = urlBean.getFilename().replace(".jpg","");
|
|
|
|
|
- if (StringUtil.isEmpty(tv_dc_line.getText().toString().trim())){
|
|
|
|
|
- if (filename.equals(at_gvtext.getText().toString().trim())){
|
|
|
|
|
- String path = urlBean.getPath();
|
|
|
|
|
- String str2 = new String(Base64.decode(path.getBytes(),Base64.DEFAULT));
|
|
|
|
|
- list.add(str2);
|
|
|
|
|
- urlBeanList.add(urlBean);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }else {
|
|
|
|
|
- if (filename.equals(at_gvtext.getText().toString().trim())&&li_codedata.equals(tv_dc_line.getText().toString().trim())){
|
|
|
|
|
- String path = urlBean.getPath();
|
|
|
|
|
- String str2 = new String(Base64.decode(path.getBytes(),Base64.DEFAULT));
|
|
|
|
|
- list.add(str2);
|
|
|
|
|
- urlBeanList.add(urlBean);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-// pdfOrImageAdapter.setmList(urlBeanList);
|
|
|
|
|
- pdfOrImageAdapter.notifyDataSetChanged();
|
|
|
|
|
-
|
|
|
|
|
String filenametcp=null;
|
|
String filenametcp=null;
|
|
|
// List<ResourcefileBean.DataBean.UrlBean> urlBeanList = pdfOrImageAdapter.getmList();
|
|
// List<ResourcefileBean.DataBean.UrlBean> urlBeanList = pdfOrImageAdapter.getmList();
|
|
|
- for (int i=0;i<urlBeanList.size();i++){
|
|
|
|
|
- ResourcefileBean.DataBean.UrlBean urlBean = urlBeanList.get(i);
|
|
|
|
|
|
|
+ for (int i=0;i<urlBeantwoList.size();i++){
|
|
|
|
|
+ BeanSop urlBean = urlBeantwoList.get(i);
|
|
|
filenametcp = urlBean.getFilename();
|
|
filenametcp = urlBean.getFilename();
|
|
|
}
|
|
}
|
|
|
if (StringUtil.isEmpty(filenametcp)) {
|
|
if (StringUtil.isEmpty(filenametcp)) {
|