|
@@ -22,7 +22,6 @@ import android.text.TextWatcher;
|
|
|
import android.util.Base64;
|
|
import android.util.Base64;
|
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
|
import android.view.Gravity;
|
|
import android.view.Gravity;
|
|
|
-import android.view.KeyEvent;
|
|
|
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.MotionEvent;
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
@@ -51,14 +50,15 @@ import com.chad.library.adapter.base.BaseViewHolder;
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
|
|
import com.uas.esop.R;
|
|
import com.uas.esop.R;
|
|
|
|
|
+import com.uas.esop.adapter.PdfOrImageAdapter;
|
|
|
import com.uas.esop.application.PdaApplication;
|
|
import com.uas.esop.application.PdaApplication;
|
|
|
|
|
+import com.uas.esop.bean.IpAndPortBean;
|
|
|
import com.uas.esop.bean.Master;
|
|
import com.uas.esop.bean.Master;
|
|
|
import com.uas.esop.bean.ResourcefileBean;
|
|
import com.uas.esop.bean.ResourcefileBean;
|
|
|
import com.uas.esop.bean.TCPEventBusBean;
|
|
import com.uas.esop.bean.TCPEventBusBean;
|
|
|
import com.uas.esop.fragment.BaseFragment;
|
|
import com.uas.esop.fragment.BaseFragment;
|
|
|
import com.uas.esop.fragment.WorkOrderSearchFragment;
|
|
import com.uas.esop.fragment.WorkOrderSearchFragment;
|
|
|
import com.uas.esop.global.GloableParams;
|
|
import com.uas.esop.global.GloableParams;
|
|
|
-import com.uas.esop.listener.MyEditorActionListener;
|
|
|
|
|
import com.uas.esop.tools.DataSourceManager;
|
|
import com.uas.esop.tools.DataSourceManager;
|
|
|
import com.uas.esop.tools.SharedPreUtil;
|
|
import com.uas.esop.tools.SharedPreUtil;
|
|
|
import com.uas.esop.tools.VolleyUtil;
|
|
import com.uas.esop.tools.VolleyUtil;
|
|
@@ -137,6 +137,13 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
private InputStream is;
|
|
private InputStream is;
|
|
|
private BufferedReader br;
|
|
private BufferedReader br;
|
|
|
private SwitchView sound_monitor_vibration_sv;
|
|
private SwitchView sound_monitor_vibration_sv;
|
|
|
|
|
+ private List<IpAndPortBean> delists;
|
|
|
|
|
+ private IpAndPortAdapter andPortAdapter;
|
|
|
|
|
+ private LinearLayout line_login_post;
|
|
|
|
|
+ private RecyclerView ra_dataurl;
|
|
|
|
|
+ private List<ResourcefileBean.DataBean.UrlBean> urlBeanList;
|
|
|
|
|
+ private PdfOrImageAdapter pdfOrImageAdapter;
|
|
|
|
|
+ private String ss_nametext;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void onDestroy() {
|
|
protected void onDestroy() {
|
|
@@ -172,6 +179,8 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
rv_data = findViewById(R.id.rv_data);
|
|
rv_data = findViewById(R.id.rv_data);
|
|
|
rela_dimss = findViewById(R.id.rela_dimss);
|
|
rela_dimss = findViewById(R.id.rela_dimss);
|
|
|
rv_datawork = findViewById(R.id.rv_datawork);
|
|
rv_datawork = findViewById(R.id.rv_datawork);
|
|
|
|
|
+ line_login_post = findViewById(R.id.line_login_post);
|
|
|
|
|
+ ra_dataurl = findViewById(R.id.ra_dataurl);
|
|
|
|
|
|
|
|
sound_monitor_vibration_sv = findViewById(R.id.sound_monitor_Vibration_sv);
|
|
sound_monitor_vibration_sv = findViewById(R.id.sound_monitor_Vibration_sv);
|
|
|
TextView btn_sengMessage = findViewById(R.id.btn_sengMessage);
|
|
TextView btn_sengMessage = findViewById(R.id.btn_sengMessage);
|
|
@@ -193,6 +202,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
view.findViewById(R.id.pop_exit_cancel_tv).setOnClickListener(this);
|
|
view.findViewById(R.id.pop_exit_cancel_tv).setOnClickListener(this);
|
|
|
view.findViewById(R.id.pop_exit_minimize_tv).setOnClickListener(this);
|
|
view.findViewById(R.id.pop_exit_minimize_tv).setOnClickListener(this);
|
|
|
view.findViewById(R.id.pop_exit_exit_tv).setOnClickListener(this);
|
|
view.findViewById(R.id.pop_exit_exit_tv).setOnClickListener(this);
|
|
|
|
|
+ line_login_post.setOnClickListener(this);
|
|
|
|
|
|
|
|
mExitPopupWindow = new PopupWindow(view, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
|
|
mExitPopupWindow = new PopupWindow(view, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
|
|
|
mExitPopupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
mExitPopupWindow.setBackgroundDrawable(new BitmapDrawable());
|
|
@@ -215,21 +225,9 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
// },500);
|
|
// },500);
|
|
|
- /**
|
|
|
|
|
- * tcp初始化
|
|
|
|
|
- */
|
|
|
|
|
- new Thread(new Runnable() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void run() {
|
|
|
|
|
- mTcpClient = new Tcpclient();
|
|
|
|
|
- mTcpClient.setConnectTimeOut(5000)//设置连接超时
|
|
|
|
|
- .setSocket("192.168.23.74",10001);//设置连接ip和端口10.1.162.69
|
|
|
|
|
- }
|
|
|
|
|
- }).start();
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- getPrintTemplate();
|
|
|
|
|
|
|
+// getPrintTemplate();//请求打印模板
|
|
|
String filepath="https://magpie-pic.oss-cn-shenzhen.aliyuncs.com/MTPTXS099039202211110020661.pdf";
|
|
String filepath="https://magpie-pic.oss-cn-shenzhen.aliyuncs.com/MTPTXS099039202211110020661.pdf";
|
|
|
|
|
|
|
|
btn_get.setOnClickListener(new View.OnClickListener() {
|
|
btn_get.setOnClickListener(new View.OnClickListener() {
|
|
@@ -245,6 +243,14 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
startActivity(intent);
|
|
startActivity(intent);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ urlBeanList = new ArrayList<>();
|
|
|
|
|
+ pdfOrImageAdapter = new PdfOrImageAdapter(urlBeanList);
|
|
|
|
|
+ ra_dataurl.addItemDecoration(new DividerItemDecoration(this, LinearLayout.VERTICAL));
|
|
|
|
|
+ ra_dataurl.setLayoutManager(new LinearLayoutManager(this));
|
|
|
|
|
+ pdfOrImageAdapter.setmList(urlBeanList);
|
|
|
|
|
+ ra_dataurl.setAdapter(pdfOrImageAdapter);
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* ----------------------------------------岗位资源列表-------------------------------------------
|
|
* ----------------------------------------岗位资源列表-------------------------------------------
|
|
|
*/
|
|
*/
|
|
@@ -258,9 +264,12 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
@Override
|
|
@Override
|
|
|
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
ComDataBean bean = myAdapter.getBeanByPositon(position);
|
|
ComDataBean bean = myAdapter.getBeanByPositon(position);
|
|
|
|
|
+
|
|
|
String itemCode = bean.getItemName();
|
|
String itemCode = bean.getItemName();
|
|
|
// String itemName= bean.getItemremark();
|
|
// String itemName= bean.getItemremark();
|
|
|
mPositionR.setText(itemCode);
|
|
mPositionR.setText(itemCode);
|
|
|
|
|
+
|
|
|
|
|
+ myAdapter.notifyDataSetChanged();
|
|
|
rv_data.setVisibility(View.GONE);
|
|
rv_data.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -306,6 +315,9 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
mPositionR.setText(itemCode);
|
|
mPositionR.setText(itemCode);
|
|
|
mPositionR.setSelection(mPositionR.getText().toString().trim().length());
|
|
mPositionR.setSelection(mPositionR.getText().toString().trim().length());
|
|
|
rv_data.setVisibility(View.GONE);
|
|
rv_data.setVisibility(View.GONE);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -368,20 +380,25 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
rela_dimss.setOnClickListener(new View.OnClickListener() {
|
|
rela_dimss.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
- rv_data.setVisibility(View.GONE);
|
|
|
|
|
|
|
+// rv_data.setVisibility(View.GONE);
|
|
|
rv_datawork.setVisibility(View.GONE);
|
|
rv_datawork.setVisibility(View.GONE);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-// historyData();
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ debughistoryData();
|
|
|
|
|
|
|
|
|
|
+ sound_monitor_vibration_sv.setChecked(false);
|
|
|
sound_monitor_vibration_sv.setOnCheckedChangeListener(new SwitchView.OnCheckedChangeListener() {
|
|
sound_monitor_vibration_sv.setOnCheckedChangeListener(new SwitchView.OnCheckedChangeListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onCheckedChanged(View view, boolean isChecked) {
|
|
public void onCheckedChanged(View view, boolean isChecked) {
|
|
|
|
|
+ Log.e("isChecked",isChecked+"");
|
|
|
|
|
+ if (isChecked==true){
|
|
|
|
|
+ historyData();
|
|
|
|
|
+ }else {
|
|
|
|
|
+ destoryhistoryData();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -419,6 +436,13 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
finish();
|
|
finish();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ String ss_name = SharedPreUtil.getString(IndexActivity.this, "ss_name", null);
|
|
|
|
|
+ if (!StringUtil.isEmpty(ss_name)){
|
|
|
|
|
+ mEmCodeTv.setText(ss_name);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ mEmCodeTv.setText("");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -441,10 +465,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
// intent2.putExtra("title", "岗位资源");
|
|
// intent2.putExtra("title", "岗位资源");
|
|
|
// intent2.putExtra("type", 1);
|
|
// intent2.putExtra("type", 1);
|
|
|
// startActivityForResult(intent2, Constants.FLAG.GET_COMMON_ITEM);
|
|
// startActivityForResult(intent2, Constants.FLAG.GET_COMMON_ITEM);
|
|
|
-// initEditPopupWindow();
|
|
|
|
|
getSC_CODEData();
|
|
getSC_CODEData();
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
break;
|
|
break;
|
|
|
case R.id.btn_actionbar_scan_iv:
|
|
case R.id.btn_actionbar_scan_iv:
|
|
|
if (CameraUtil.hasCamera()) {
|
|
if (CameraUtil.hasCamera()) {
|
|
@@ -460,7 +481,9 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
intent.putExtra(DataSourceManager.KEY_GRID_ITEMNAME, GloableParams.GRIDNAME_SETTING);
|
|
intent.putExtra(DataSourceManager.KEY_GRID_ITEMNAME, GloableParams.GRIDNAME_SETTING);
|
|
|
startActivity(intent);
|
|
startActivity(intent);
|
|
|
break;
|
|
break;
|
|
|
-
|
|
|
|
|
|
|
+ case R.id.line_login_post:
|
|
|
|
|
+ initEditPopupWindow();
|
|
|
|
|
+ break;
|
|
|
|
|
|
|
|
default:
|
|
default:
|
|
|
}
|
|
}
|
|
@@ -486,7 +509,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
if(result.contains("(")){
|
|
if(result.contains("(")){
|
|
|
// handleCode(result.split("\\(")[0], true);
|
|
// handleCode(result.split("\\(")[0], true);
|
|
|
mPositionR.setText(result.split("\\(")[0]);
|
|
mPositionR.setText(result.split("\\(")[0]);
|
|
|
- mEmCodeTv.setText(result.split("\\(")[1]);
|
|
|
|
|
|
|
+// mEmCodeTv.setText(result.split("\\(")[1]);
|
|
|
// mEmCodeTv.setSelection(result.split("\\(")[0].length());
|
|
// mEmCodeTv.setSelection(result.split("\\(")[0].length());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -499,13 +522,27 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * ip和port(端口)
|
|
|
|
|
+ */
|
|
|
private void initEditPopupWindow() {
|
|
private void initEditPopupWindow() {
|
|
|
|
|
+ delists = new ArrayList<>();
|
|
|
|
|
+ andPortAdapter = new IpAndPortAdapter(delists);
|
|
|
View contView = LayoutInflater.from(this).inflate(R.layout.index_edit_pup, null);
|
|
View contView = LayoutInflater.from(this).inflate(R.layout.index_edit_pup, null);
|
|
|
edit_et = (ClearableEditText) contView.findViewById(R.id.edit_et);
|
|
edit_et = (ClearableEditText) contView.findViewById(R.id.edit_et);
|
|
|
TextView sure_tv = (TextView) contView.findViewById(R.id.sure_tv);
|
|
TextView sure_tv = (TextView) contView.findViewById(R.id.sure_tv);
|
|
|
TextView cancle_tv = (TextView) contView.findViewById(R.id.cancle_tv);
|
|
TextView cancle_tv = (TextView) contView.findViewById(R.id.cancle_tv);
|
|
|
ImageView search_im = contView.findViewById(R.id.search_im);
|
|
ImageView search_im = contView.findViewById(R.id.search_im);
|
|
|
|
|
|
|
|
|
|
+ RecyclerView rv_ip_port_data = contView.findViewById(R.id.rv_ip_port_data);
|
|
|
|
|
+ rv_ip_port_data.addItemDecoration(new DividerItemDecoration(this, LinearLayout.VERTICAL));
|
|
|
|
|
+ rv_ip_port_data.setLayoutManager(new LinearLayoutManager(this));
|
|
|
|
|
+ andPortAdapter.setmList(delists);
|
|
|
|
|
+ rv_ip_port_data.setAdapter(andPortAdapter);
|
|
|
|
|
+ getdeBugData();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// search_im.setVisibility(View.GONE);
|
|
// search_im.setVisibility(View.GONE);
|
|
|
editPW = new PopupWindow(contView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
|
|
editPW = new PopupWindow(contView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
|
|
|
editPW.setTouchable(true);
|
|
editPW.setTouchable(true);
|
|
@@ -520,11 +557,17 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
editPW.showAtLocation(parentView, Gravity.CENTER, 0, 0);
|
|
editPW.showAtLocation(parentView, Gravity.CENTER, 0, 0);
|
|
|
CommonUtil.setBackgroundAlpha(this, 0.5f);
|
|
CommonUtil.setBackgroundAlpha(this, 0.5f);
|
|
|
|
|
|
|
|
- sure_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ andPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
- public void onClick(View v) {
|
|
|
|
|
- String code = edit_et.getText().toString().trim();
|
|
|
|
|
-// handleCode(code, true);
|
|
|
|
|
|
|
+ public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
|
|
+ List<IpAndPortBean> comDataBeans = andPortAdapter.getmList();
|
|
|
|
|
+ ss_nametext = comDataBeans.get(position).getSS_NAME();
|
|
|
|
|
+ for (int i = 0; i < comDataBeans.size(); i++) {
|
|
|
|
|
+ comDataBeans.get(i).setChecked(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ comDataBeans.get(position).setChecked(true);
|
|
|
|
|
+ andPortAdapter.notifyDataSetChanged();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -537,19 +580,78 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
startActivityForResult(intent, Constants.FLAG.GET_COMMON_ITEM);
|
|
startActivityForResult(intent, Constants.FLAG.GET_COMMON_ITEM);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- CommonUtil.setEditorActionListener(edit_et, new MyEditorActionListener() {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //确定
|
|
|
|
|
+ sure_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
- public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
|
|
- String code = edit_et.getText().toString().trim();
|
|
|
|
|
-// handleCode(code, true);
|
|
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ SharedPreUtil.saveString(IndexActivity.this,"ss_name", ss_nametext);
|
|
|
|
|
+ mEmCodeTv.setText(ss_nametext);
|
|
|
|
|
+ closeListPopupWindow();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ //取消
|
|
|
cancle_tv.setOnClickListener(new View.OnClickListener() {
|
|
cancle_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
|
|
+
|
|
|
closeListPopupWindow();
|
|
closeListPopupWindow();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ edit_et.addTextChangedListener(new TextWatcher() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onTextChanged(CharSequence s, int start, int before, int count) { }
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void afterTextChanged(Editable s) {
|
|
|
|
|
+ if (delists.isEmpty()){
|
|
|
|
|
+ getdeBugData();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (s.length() >= 0) {
|
|
|
|
|
+ String mSearchStr = s.toString().trim();
|
|
|
|
|
+ LogUtil.i("mSearchStr",mSearchStr);
|
|
|
|
|
+ List<IpAndPortBean> thisList = new ArrayList<>();
|
|
|
|
|
+ for(int i=0;i<delists.size();i++){
|
|
|
|
|
+ if(delists.get(i).getSS_STEPCODE().contains(mSearchStr) || delists.get(i).getSS_NAME().contains(mSearchStr)
|
|
|
|
|
+ ||delists.get(i).getSS_CODE().contains(mSearchStr)){
|
|
|
|
|
+ thisList.add(delists.get(i));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(i == delists.size() -1){
|
|
|
|
|
+ andPortAdapter = new IpAndPortAdapter(thisList);
|
|
|
|
|
+ rv_ip_port_data.setAdapter(andPortAdapter);
|
|
|
|
|
+ LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ andPortAdapter.notifyDataSetChanged();
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+
|
|
|
|
|
+ andPortAdapter = new IpAndPortAdapter(delists);
|
|
|
|
|
+ rv_ip_port_data.setAdapter(andPortAdapter);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ andPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
|
|
+ List<IpAndPortBean> comDataBeans = andPortAdapter.getmList();
|
|
|
|
|
+ String itemName = comDataBeans.get(position).getSS_NAME();
|
|
|
|
|
+ mPositionR.setText(itemName);
|
|
|
|
|
+ for (int i = 0; i < comDataBeans.size(); i++) {
|
|
|
|
|
+ comDataBeans.get(i).setChecked(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ comDataBeans.get(position).setChecked(true);
|
|
|
|
|
+ andPortAdapter.notifyDataSetChanged();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//修改岗位资源操作
|
|
//修改岗位资源操作
|
|
@@ -1083,23 +1185,25 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void getPdfOrImage(){
|
|
public void getPdfOrImage(){
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
progressDialog.show();
|
|
progressDialog.show();
|
|
|
VollyRequest.getInstance().stringRequest(mStringRequest,
|
|
VollyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
new HttpParams.Builder()
|
|
new HttpParams.Builder()
|
|
|
.url(GloableParams.ASTATIONTHE_RESOURCEFILE)
|
|
.url(GloableParams.ASTATIONTHE_RESOURCEFILE)
|
|
|
.method(Request.Method.GET)
|
|
.method(Request.Method.GET)
|
|
|
-// .addParam("sourcecode",mPositionR.getText().toString().trim())//岗位资源
|
|
|
|
|
-// .addParam("makecode",mCurDoc.getText().toString().trim())//工序单号
|
|
|
|
|
-// .addParam("prodcode",index_prodcode.getText().toString().trim())//产品编号
|
|
|
|
|
- .addParam("id","157043")
|
|
|
|
|
|
|
+ .addParam("sourcecode",mPositionR.getText().toString().trim())//岗位资源
|
|
|
|
|
+ .addParam("makecode",mCurDoc.getText().toString().trim())//工序单号
|
|
|
|
|
+ .addParam("prodcode",index_prodcode.getText().toString().trim())//产品编号
|
|
|
|
|
+// .addParam("id","157043")
|
|
|
.tag("Tag" + "getSourceByEmp")
|
|
.tag("Tag" + "getSourceByEmp")
|
|
|
.flag(0)
|
|
.flag(0)
|
|
|
.build(), new HttpCallback() {
|
|
.build(), new HttpCallback() {
|
|
|
|
|
|
|
|
private String filename;
|
|
private String filename;
|
|
|
-
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
|
|
|
+ urlBeanList.clear();
|
|
|
progressDialog.dismiss();
|
|
progressDialog.dismiss();
|
|
|
Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
|
|
Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
|
|
|
if (isSuccess){
|
|
if (isSuccess){
|
|
@@ -1120,6 +1224,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
String path = urlBean.getPath();
|
|
String path = urlBean.getPath();
|
|
|
String str2 = new String(Base64.decode(path.getBytes(),Base64.DEFAULT));
|
|
String str2 = new String(Base64.decode(path.getBytes(),Base64.DEFAULT));
|
|
|
list.add(str2);
|
|
list.add(str2);
|
|
|
|
|
+ urlBeanList.add(urlBean);
|
|
|
Log.e("res===",str2);
|
|
Log.e("res===",str2);
|
|
|
Log.e("path",path);
|
|
Log.e("path",path);
|
|
|
Log.e("filename", filename);
|
|
Log.e("filename", filename);
|
|
@@ -1138,6 +1243,9 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
CommonUtil.toastNoRepeat(IndexActivity.this,"此文件无法打开");
|
|
CommonUtil.toastNoRepeat(IndexActivity.this,"此文件无法打开");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ pdfOrImageAdapter.setmList(urlBeanList);
|
|
|
|
|
+ pdfOrImageAdapter.notifyDataSetChanged();
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1277,6 +1385,9 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 岗位资源
|
|
|
|
|
+ */
|
|
|
private void getSC_CODEData() {
|
|
private void getSC_CODEData() {
|
|
|
rv_data.setVisibility(View.VISIBLE);
|
|
rv_data.setVisibility(View.VISIBLE);
|
|
|
progressDialog.show();
|
|
progressDialog.show();
|
|
@@ -1322,6 +1433,57 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 站点
|
|
|
|
|
+ */
|
|
|
|
|
+ private void getdeBugData() {
|
|
|
|
|
+ progressDialog.show();
|
|
|
|
|
+ VollyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
|
|
+ new HttpParams.Builder()
|
|
|
|
|
+ .url(GloableParams.ASTATIONTHE_GETSOPSOURCE)
|
|
|
|
|
+ .method(Request.Method.GET)
|
|
|
|
|
+ .tag(Tag + "getSourceByEmp")
|
|
|
|
|
+ .flag(0)
|
|
|
|
|
+ .build(), new HttpCallback() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
|
|
+ progressDialog.dismiss();
|
|
|
|
|
+ Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
|
|
|
|
|
+ if (isSuccess){
|
|
|
|
|
+ JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(),"data");
|
|
|
|
|
+ if (dataArray == null || dataArray.size() == 0){
|
|
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this,"未搜索到匹配数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ for(Object index:dataArray){
|
|
|
|
|
+ JSONObject data = (JSONObject) index;
|
|
|
|
|
+ IpAndPortBean bean = new IpAndPortBean();
|
|
|
|
|
+ bean.setSS_STEPCODE(data.getString("SS_STEPCODE"));
|
|
|
|
|
+ bean.setSS_NAME(data.getString("SS_NAME"));
|
|
|
|
|
+ bean.setSS_CODE(data.getString("SS_CODE"));
|
|
|
|
|
+ delists.add(bean);
|
|
|
|
|
+ }
|
|
|
|
|
+ andPortAdapter.setmList(delists);
|
|
|
|
|
+ andPortAdapter.notifyDataSetChanged();
|
|
|
|
|
+
|
|
|
|
|
+ }else {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
|
|
+ progressDialog.dismiss();
|
|
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this, failStr);
|
|
|
|
|
+ rv_datawork.setVisibility(View.GONE);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private class ComListAdapter extends BaseQuickAdapter<ComDataBean, BaseViewHolder> {
|
|
private class ComListAdapter extends BaseQuickAdapter<ComDataBean, BaseViewHolder> {
|
|
|
private List<ComDataBean> mmmmList;
|
|
private List<ComDataBean> mmmmList;
|
|
|
|
|
|
|
@@ -1344,11 +1506,26 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
protected void convert(BaseViewHolder helper, ComDataBean item) {
|
|
protected void convert(BaseViewHolder helper, ComDataBean item) {
|
|
|
helper.setText(R.id.macode_Tv,item.getItemName());
|
|
helper.setText(R.id.macode_Tv,item.getItemName());
|
|
|
helper.setText(R.id.remark_Tv,item.getItemremark());
|
|
helper.setText(R.id.remark_Tv,item.getItemremark());
|
|
|
|
|
+ LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
|
|
|
|
|
+ if (item.getChecked()) {
|
|
|
|
|
+ line_true.setSelected(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ line_true.setSelected(false);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
private class ComDataBean{
|
|
private class ComDataBean{
|
|
|
String itemName = null;
|
|
String itemName = null;
|
|
|
String itemremark = null;
|
|
String itemremark = null;
|
|
|
|
|
+ boolean isChecked;
|
|
|
|
|
+
|
|
|
|
|
+ public boolean getChecked() {
|
|
|
|
|
+ return isChecked;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setChecked(boolean checked) {
|
|
|
|
|
+ isChecked = checked;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
public String getItemName() {
|
|
public String getItemName() {
|
|
|
return itemName;
|
|
return itemName;
|
|
@@ -1390,6 +1567,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
@Override
|
|
@Override
|
|
|
protected void convert(BaseViewHolder helper, FuzzyBean item) {
|
|
protected void convert(BaseViewHolder helper, FuzzyBean item) {
|
|
|
helper.setText(R.id.macode_Tv,item.getMA_CODE());
|
|
helper.setText(R.id.macode_Tv,item.getMA_CODE());
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1436,6 +1614,9 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
}
|
|
}
|
|
|
//发送+接收
|
|
//发送+接收
|
|
|
private void setMessageData(){
|
|
private void setMessageData(){
|
|
|
|
|
+ mTcpClient = new Tcpclient();
|
|
|
|
|
+ mTcpClient.setConnectTimeOut(5000)//设置连接超时
|
|
|
|
|
+ .setSocket("192.168.23.74",10001);//设置连接ip和端口10.1.162.69
|
|
|
new Thread(new Runnable() {
|
|
new Thread(new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -1468,14 +1649,78 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
|
|
|
QpushClient.getInstance(new Handler(new Handler.Callback() {
|
|
QpushClient.getInstance(new Handler(new Handler.Callback() {
|
|
|
@Override
|
|
@Override
|
|
|
public boolean handleMessage(Message msg) {
|
|
public boolean handleMessage(Message msg) {
|
|
|
|
|
+ Log.e("服务器数据",msg.obj.toString());
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ })).init("mes.ubtob.net",8099);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 测试连接
|
|
|
|
|
+ */
|
|
|
|
|
+ public void debughistoryData(){
|
|
|
|
|
+ //测试连接,连接后断开
|
|
|
|
|
+ QpushClient.getInstance(new Handler(new Handler.Callback() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean handleMessage(Message msg) {
|
|
|
|
|
+ if (msg.obj.toString().equals("debugtrue")){//测试连接成功
|
|
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this,msg.obj.toString());
|
|
|
|
|
+ }else {//测试连接失败 和拿到handler消息
|
|
|
|
|
+ if (msg.obj.toString().equals("newdata")){
|
|
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this,"更新数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ CommonUtil.toastNoRepeat(IndexActivity.this,msg.obj.toString());
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ Log.e("服务器返回",msg.obj.toString());
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- })).init("10.1.162.69",10001);
|
|
|
|
|
|
|
+ })).debugconnect("mes.ubtob.net",8099);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 断开socket
|
|
|
|
|
+ */
|
|
|
|
|
+ public void destoryhistoryData(){
|
|
|
|
|
+ QpushClient.getInstance(new Handler(new Handler.Callback() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean handleMessage(Message msg) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ })).onDestory();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ private class IpAndPortAdapter extends BaseQuickAdapter<IpAndPortBean, BaseViewHolder> {
|
|
|
|
|
+ private List<IpAndPortBean> mmmmList;
|
|
|
|
|
+
|
|
|
|
|
+ public List<IpAndPortBean> getmList() {
|
|
|
|
|
+ return mmmmList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setmList(List<IpAndPortBean> mList) {
|
|
|
|
|
+ this.mmmmList = mList;
|
|
|
|
|
+ }
|
|
|
|
|
+ public IpAndPortBean getBeanByPositon(int position){
|
|
|
|
|
+ return mmmmList.get(position);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ private IpAndPortAdapter(@Nullable List<IpAndPortBean> data) {
|
|
|
|
|
+ super(R.layout.fuzzy_ipandport_item, data);
|
|
|
|
|
+ this.mmmmList = data;
|
|
|
|
|
+ }
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void convert(BaseViewHolder helper, IpAndPortBean item) {
|
|
|
|
|
+ helper.setText(R.id.macode_ip__Tv,item.getSS_CODE()+"-"+item.getSS_STEPCODE()+"-"+item.getSS_NAME());
|
|
|
|
|
+ LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
|
|
|
|
|
+ if (item.getChecked()) {
|
|
|
|
|
+ line_true.setSelected(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ line_true.setSelected(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|