|
|
@@ -151,6 +151,12 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
private int maxTime = 1;
|
|
|
private ImageView sound_monitor_vibration_sv2;
|
|
|
private boolean error_ok_image;;
|
|
|
+ private TextView tv_pscode;
|
|
|
+ private TextView tv_ps_prodcode;
|
|
|
+ private TextView tv_ps_stepcode;
|
|
|
+ private TextView tv_pr_spec;
|
|
|
+ private TextView tv_pr_detail;
|
|
|
+
|
|
|
@Override
|
|
|
protected void onDestroy() {
|
|
|
// SharedPreUtil.removeAll(getApplicationContext());
|
|
|
@@ -188,8 +194,14 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
line_login_post = findViewById(R.id.line_login_post);
|
|
|
ra_dataurl = findViewById(R.id.ra_dataurl);
|
|
|
sound_monitor_vibration_sv2 = findViewById(R.id.sound_monitor_Vibration_sv2);
|
|
|
-
|
|
|
sound_monitor_vibration_sv = findViewById(R.id.sound_monitor_Vibration_sv);
|
|
|
+ tv_pscode = findViewById(R.id.tv_pscode);
|
|
|
+ tv_ps_prodcode = findViewById(R.id.tv_ps_prodcode);
|
|
|
+ tv_ps_stepcode = findViewById(R.id.tv_ps_stepcode);
|
|
|
+
|
|
|
+ tv_pr_spec = findViewById(R.id.tv_pr_spec);
|
|
|
+ tv_pr_detail = findViewById(R.id.tv_pr_detail);
|
|
|
+
|
|
|
TextView btn_sengMessage = findViewById(R.id.btn_sengMessage);
|
|
|
tcp_text = findViewById(R.id.tcp_text);
|
|
|
findViewById(R.id.index_edit).setOnClickListener(this);
|
|
|
@@ -240,27 +252,28 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
btn_get.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- if (StringUtil.isEmpty(filename)){
|
|
|
- CommonUtil.toastNoRepeat(IndexActivity.this,"请先获取数据");
|
|
|
+ if (StringUtil.isEmpty(filename)) {
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this, "请先获取数据");
|
|
|
return;
|
|
|
}
|
|
|
-// getPdfOrImage("");
|
|
|
- if (filename.contains(".pdf")||filename.contains(".PDF")){
|
|
|
- Intent intent=new Intent(IndexActivity.this,PdfsActivity.class);
|
|
|
- intent.putStringArrayListExtra("lists",list);
|
|
|
- intent.putExtra("filename",filename);
|
|
|
+ // getPdfOrImage("");
|
|
|
+ if (filename.contains(".pdf") || filename.contains(".PDF")) {
|
|
|
+ Intent intent = new Intent(IndexActivity.this, PdfsActivity.class);
|
|
|
+ intent.putStringArrayListExtra("lists", list);
|
|
|
+ intent.putExtra("filename", filename);
|
|
|
startActivity(intent);
|
|
|
- }else if (filename.contains(".PNG")||filename.contains(".JPG")||filename.contains(".webp")||filename.contains(".jpeg")
|
|
|
- ||filename.contains(".png")||filename.contains(".jpg")||filename.contains(".WEBP")||filename.contains(".JPEG")){
|
|
|
- Intent intent=new Intent(IndexActivity.this,BannerActivity.class);
|
|
|
- intent.putStringArrayListExtra("lists",list);
|
|
|
+ } else if (filename.contains(".PNG") || filename.contains(".JPG") || filename.contains(".webp") || filename.contains(".jpeg")
|
|
|
+ || filename.contains(".png") || filename.contains(".jpg") || filename.contains(".WEBP") || filename.contains(".JPEG")) {
|
|
|
+ Intent intent = new Intent(IndexActivity.this, BannerActivity.class);
|
|
|
+ intent.putStringArrayListExtra("lists", list);
|
|
|
startActivity(intent);
|
|
|
- CommonUtil.toastNoRepeat(IndexActivity.this,"图片");
|
|
|
- }else {
|
|
|
- CommonUtil.toastNoRepeat(IndexActivity.this,"此文件无法打开");
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this, "此文件无法打开");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
btn_getbanner.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
@@ -298,6 +311,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
/**
|
|
|
* ----------------------------------------岗位资源列表-------------------------------------------
|
|
|
*/
|
|
|
+
|
|
|
rv_data.addItemDecoration(new DividerItemDecoration(this, LinearLayout.VERTICAL));
|
|
|
rv_data.setLayoutManager(new LinearLayoutManager(this));
|
|
|
mList = new ArrayList<>();
|
|
|
@@ -310,9 +324,17 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
ComDataBean bean = myAdapter.getBeanByPositon(position);
|
|
|
|
|
|
String itemCode = bean.getPS_CODE();
|
|
|
+ String ps_prodcode = bean.getPS_PRODCODE();
|
|
|
+ String ps_stepcode = bean.getPS_STEPCODE();
|
|
|
+ String pr_spec = bean.getPR_SPEC();
|
|
|
+ String pr_detail = bean.getPR_DETAIL();
|
|
|
// String itemName= bean.getItemremark();
|
|
|
+ tv_ps_prodcode.setText(ps_prodcode);
|
|
|
+ tv_ps_stepcode.setText(ps_stepcode);
|
|
|
+ tv_pr_spec.setText(pr_spec);
|
|
|
mPositionR.setText(itemCode);
|
|
|
-
|
|
|
+ tv_pr_detail.setText(pr_detail);
|
|
|
+ mPositionR.setSelection(mPositionR.getText().toString().trim().length());
|
|
|
myAdapter.notifyDataSetChanged();
|
|
|
rv_data.setVisibility(View.GONE);
|
|
|
getPdfOrImage(itemCode);
|
|
|
@@ -453,10 +475,17 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ String ss_brdips = SharedPreUtil.getString(IndexActivity.this, "ss_brdip", null);
|
|
|
+ String ss_brdports = SharedPreUtil.getString(IndexActivity.this, "ss_brdport", null);
|
|
|
sound_monitor_vibration_sv2.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
+ if (StringUtil.isEmpty(ss_brdips)||StringUtil.isEmpty(ss_brdports)){
|
|
|
+ error_ok_image=false;
|
|
|
+ sound_monitor_vibration_sv2.setSelected(false);
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this,"站点或端口为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (error_ok_image){
|
|
|
error_ok_image=false;
|
|
|
sound_monitor_vibration_sv2.setSelected(false);
|
|
|
@@ -1299,8 +1328,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
Gson gson = new Gson();
|
|
|
ResourcefileBean loginData = gson.fromJson(o.toString(), ResourcefileBean.class);
|
|
|
ResourcefileBean.DataBean data = loginData.getData();
|
|
|
- String ps_code = data.getPs_code();
|
|
|
- Log.e("ps_code",ps_code);
|
|
|
+ tv_pscode.setText(data.getPs_code());
|
|
|
List<ResourcefileBean.DataBean.UrlBean> url = data.getUrl();
|
|
|
if (url.isEmpty()){
|
|
|
CommonUtil.toastNoRepeat(IndexActivity.this,"数据为空");
|
|
|
@@ -1412,20 +1440,6 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
private void initPopupWindow() {
|
|
|
PopupWindow popupWindow = new PopupWindow(this);
|
|
|
View inflate = LayoutInflater.from(this).inflate(R.layout.view_popup_window, null, false);
|
|
|
@@ -1481,11 +1495,14 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(),"data");
|
|
|
if (dataArray == null || dataArray.size() == 0){
|
|
|
CommonUtil.toastNoRepeat(IndexActivity.this,"未搜索到匹配数据");
|
|
|
+ return;
|
|
|
}
|
|
|
for(Object index:dataArray){
|
|
|
JSONObject data = (JSONObject) index;
|
|
|
ComDataBean bean = new ComDataBean();
|
|
|
bean.setPS_CODE(data.getString("PS_CODE"));
|
|
|
+ bean.setPR_SPEC(data.getString("PR_SPEC"));
|
|
|
+ bean.setPR_DETAIL(data.getString("PR_DETAIL"));
|
|
|
if (data.getString("PS_PRODCODE")==null){
|
|
|
bean.setPS_PRODCODE("null");
|
|
|
}else {
|
|
|
@@ -1497,6 +1514,16 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
bean.setPS_STEPCODE(data.getString("PS_STEPCODE"));
|
|
|
}
|
|
|
|
|
|
+// if (data.getString("PR_SPEC")==null){
|
|
|
+// bean.setPR_SPEC("null");
|
|
|
+// }else {
|
|
|
+//
|
|
|
+// }
|
|
|
+// if (data.getString("PR_DETAIL")==null){
|
|
|
+// bean.setPR_DETAIL("null");
|
|
|
+// }else {
|
|
|
+//
|
|
|
+// }
|
|
|
mList.add(bean);
|
|
|
}
|
|
|
myAdapter.setmList(mList);
|
|
|
@@ -1606,8 +1633,26 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
String PS_CODE = null;
|
|
|
String PS_PRODCODE = null;
|
|
|
String PS_STEPCODE = null;
|
|
|
+ String PR_SPEC = null;
|
|
|
+ String PR_DETAIL= null;
|
|
|
boolean isChecked;
|
|
|
|
|
|
+ public String getPR_SPEC() {
|
|
|
+ return PR_SPEC;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPR_SPEC(String PR_SPEC) {
|
|
|
+ this.PR_SPEC = PR_SPEC;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPR_DETAIL() {
|
|
|
+ return PR_DETAIL;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPR_DETAIL(String PR_DETAIL) {
|
|
|
+ this.PR_DETAIL = PR_DETAIL;
|
|
|
+ }
|
|
|
+
|
|
|
public boolean getChecked() {
|
|
|
return isChecked;
|
|
|
}
|
|
|
@@ -1708,25 +1753,17 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
public void historyData(){
|
|
|
String ss_brdips = SharedPreUtil.getString(IndexActivity.this, "ss_brdip", null);
|
|
|
String ss_brdports = SharedPreUtil.getString(IndexActivity.this, "ss_brdport", null);
|
|
|
-// if (StringUtil.isEmpty(ss_brdips)||StringUtil.isEmpty(ss_brdports)){
|
|
|
-// handler.removeCallbacks(runnable);
|
|
|
-// error_ok_image=false;
|
|
|
-// sound_monitor_vibration_sv2.setSelected(false);
|
|
|
-// CommonUtil.toastNoRepeat(IndexActivity.this,"请选择站点");
|
|
|
-// return;
|
|
|
-// }
|
|
|
-
|
|
|
+ error_ok_image=true;
|
|
|
+ Log.e("是否关闭","没有关闭");
|
|
|
QpushClient.getInstance(new Handler(new Handler.Callback() {
|
|
|
@Override
|
|
|
public boolean handleMessage(Message msg) {
|
|
|
String stringtext = msg.obj.toString();
|
|
|
setdataDisplay(stringtext);
|
|
|
-
|
|
|
-
|
|
|
Log.e("服务器数据", msg.obj.toString());
|
|
|
return false;
|
|
|
}
|
|
|
- })).init("10.1.162.69",8899);
|
|
|
+ })).init("10.1.162.56",8989);//Integer.valueOf(ss_brdports)
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1742,7 +1779,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
handler.removeCallbacks(runnable);
|
|
|
error_ok_image=false;
|
|
|
sound_monitor_vibration_sv2.setSelected(false);
|
|
|
- CommonUtil.toastNoRepeat(IndexActivity.this,"请选择站点");
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this,"站点或端口为空");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1777,8 +1814,41 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
urlBeanList.clear();
|
|
|
list = new ArrayList<>();
|
|
|
// String stringtext="[{path=aHR0cDovL21lcy51YnRvYi5uZXQ6ODA5OS9wb3N0YXR0YWNoL3pob25neWwvMTY2ZDZmNjc0NjhlNDMwYWE4OWEwMzZlY2JlZWM4NjUuanBn, ps_sourcecode=ZZ_01_PCBA, filename=945.jpg, ps_prodcode=04.DMH.EM11218201A, ps_code=2022110005, ss_code=A02}][{path=aHR0cDovL21lcy51YnRvYi5uZXQ6ODA5OS9wb3N0YXR0YWNoL3pob25neWwvMTY2ZDZmNjc0NjhlNDMwYWE4OWEwMzZlY2JlZWM4NjUuanBn, ps_sourcecode=ZZ_01_PCBA, filename=1234321.jpg, ps_prodcode=04.DMH.EM11218201A, ps_code=2022110005, ss_code=A01}]";
|
|
|
- ArrayList<String> allSatisfyStr = getAllSatisfyStr(stringtext, "filename=[\\w+]+");
|
|
|
- ArrayList<String> allSatisfyStrpdf = getAllSatisfyStr(stringtext, "path=[\\w+]+[\\s\\S][\\w+]+");
|
|
|
+ ArrayList<String> allSatisfyStr = getAllSatisfyStr(stringtext, "filename=([^,]*)");//取filehname
|
|
|
+
|
|
|
+ ArrayList<String> ps_prodcodeSatisfyStr = getAllSatisfyStr(stringtext, "ps_prodcode=([^,]*)");
|
|
|
+
|
|
|
+ for (int i=0;i<ps_prodcodeSatisfyStr.size();i++){
|
|
|
+ String s = ps_prodcodeSatisfyStr.get(i);
|
|
|
+ String[] separated = s.split("=");
|
|
|
+ tv_ps_prodcode.setText(separated[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ ArrayList<String> ps_codeSatisfyStr = getAllSatisfyStr(stringtext, "ps_code=([^,]*)");
|
|
|
+
|
|
|
+ for (int i=0;i<ps_codeSatisfyStr.size();i++){
|
|
|
+ String s = ps_codeSatisfyStr.get(i);
|
|
|
+ String[] separated = s.split("=");
|
|
|
+ tv_pscode.setText(separated[1]);
|
|
|
+ }
|
|
|
+ ArrayList<String> pr_detailSatisfyStr = getAllSatisfyStr(stringtext, "pr_detail=([^,]*)");
|
|
|
+
|
|
|
+ for (int i=0;i<pr_detailSatisfyStr.size();i++){
|
|
|
+ String s = pr_detailSatisfyStr.get(i);
|
|
|
+ String[] separated = s.split("=");
|
|
|
+ tv_pr_detail.setText(separated[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ ArrayList<String> pr_specSatisfyStr = getAllSatisfyStr(stringtext, "pr_spec=([^,]*)");
|
|
|
+
|
|
|
+ for (int i=0;i<pr_specSatisfyStr.size();i++){
|
|
|
+ String s = pr_specSatisfyStr.get(i);
|
|
|
+ String[] separated = s.split("=");
|
|
|
+ tv_pr_spec.setText(separated[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ArrayList<String> allSatisfyStrpdf = getAllSatisfyStr(stringtext, "path=([^,]*)");//取path
|
|
|
if (!StringUtil.isEmpty(stringtext)) {
|
|
|
for (int i = 0; i < allSatisfyStr.size(); i++) {
|
|
|
ResourcefileBean.DataBean.UrlBean tcpReceiveBean = new ResourcefileBean.DataBean.UrlBean();
|
|
|
@@ -1804,31 +1874,39 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
String str2 = new String(Base64.decode(separateds[1].getBytes(), Base64.DEFAULT));
|
|
|
tcpReceiveBean.setPath(str2);
|
|
|
// urlBeanList.add(tcpReceiveBean);
|
|
|
+ Log.e("str2",str2);
|
|
|
list.add(str2);
|
|
|
|
|
|
}
|
|
|
- filename = urlBeanList.get(0).getFilename();
|
|
|
- pdfOrImageAdapter.setmList(urlBeanList);
|
|
|
- pdfOrImageAdapter.notifyDataSetChanged();
|
|
|
- }
|
|
|
- if (StringUtil.isEmpty(filename)) {
|
|
|
- CommonUtil.toastNoRepeat(IndexActivity.this, "请先获取数据");
|
|
|
- return;
|
|
|
- }
|
|
|
-// getPdfOrImage("");
|
|
|
- if (filename.contains(".pdf") || filename.contains(".PDF")) {
|
|
|
- Intent intent = new Intent(IndexActivity.this, PdfsActivity.class);
|
|
|
- intent.putStringArrayListExtra("lists", list);
|
|
|
- intent.putExtra("filename", filename);
|
|
|
- startActivity(intent);
|
|
|
- } else if (filename.contains(".PNG") || filename.contains(".JPG") || filename.contains(".webp") || filename.contains(".jpeg")
|
|
|
- || filename.contains(".png") || filename.contains(".jpg") || filename.contains(".WEBP") || filename.contains(".JPEG")) {
|
|
|
- Intent intent = new Intent(IndexActivity.this, BannerActivity.class);
|
|
|
- intent.putStringArrayListExtra("lists", list);
|
|
|
- startActivity(intent);
|
|
|
- } else {
|
|
|
- CommonUtil.toastNoRepeat(IndexActivity.this, "此文件无法打开");
|
|
|
- }
|
|
|
+ if (urlBeanList!=null){
|
|
|
+ for (int j=0;j<urlBeanList.size();j++){
|
|
|
+ filename = urlBeanList.get(j).getFilename();
|
|
|
+ Log.e("str3",filename);
|
|
|
+ }
|
|
|
+
|
|
|
+ pdfOrImageAdapter.setmList(urlBeanList);
|
|
|
+ pdfOrImageAdapter.notifyDataSetChanged();
|
|
|
+ }
|
|
|
+ if (StringUtil.isEmpty(filename)) {
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this, "请先获取数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // getPdfOrImage("");
|
|
|
+ if (filename.contains(".pdf") || filename.contains(".PDF")) {
|
|
|
+ Intent intent = new Intent(IndexActivity.this, PdfsActivity.class);
|
|
|
+ intent.putStringArrayListExtra("lists", list);
|
|
|
+ intent.putExtra("filename", filename);
|
|
|
+ startActivity(intent);
|
|
|
+ } else if (filename.contains(".PNG") || filename.contains(".JPG") || filename.contains(".webp") || filename.contains(".jpeg")
|
|
|
+ || filename.contains(".png") || filename.contains(".jpg") || filename.contains(".WEBP") || filename.contains(".JPEG")) {
|
|
|
+ Intent intent = new Intent(IndexActivity.this, BannerActivity.class);
|
|
|
+ intent.putStringArrayListExtra("lists", list);
|
|
|
+ startActivity(intent);
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this, "此文件无法打开");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|