|
|
@@ -0,0 +1,385 @@
|
|
|
+//package com.uas.hystorage.activity;
|
|
|
+//
|
|
|
+//import android.graphics.drawable.BitmapDrawable;
|
|
|
+//import android.support.v7.widget.DividerItemDecoration;
|
|
|
+//import android.support.v7.widget.LinearLayoutManager;
|
|
|
+//import android.view.Gravity;
|
|
|
+//import android.view.KeyEvent;
|
|
|
+//import android.view.LayoutInflater;
|
|
|
+//import android.view.View;
|
|
|
+//import android.view.Window;
|
|
|
+//import android.view.inputmethod.EditorInfo;
|
|
|
+//import android.widget.Button;
|
|
|
+//import android.widget.ImageView;
|
|
|
+//import android.widget.LinearLayout;
|
|
|
+//import android.widget.PopupWindow;
|
|
|
+//import android.widget.RadioGroup;
|
|
|
+//import android.widget.TextView;
|
|
|
+//
|
|
|
+//import com.alibaba.fastjson.JSON;
|
|
|
+//import com.alibaba.fastjson.JSONArray;
|
|
|
+//import com.alibaba.fastjson.JSONObject;
|
|
|
+//import com.android.volley.Request;
|
|
|
+//import com.android.volley.toolbox.StringRequest;
|
|
|
+//import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
+//import com.uas.hystorage.R;
|
|
|
+//import com.uas.hystorage.fragment.PostPunchFragment;
|
|
|
+//import com.uas.hystorage.global.GloableParams;
|
|
|
+//import com.uas.hystorage.listener.MyEditorActionListener;
|
|
|
+//import com.uas.hystorage.util.CommonUtil;
|
|
|
+//import com.uas.hystorage.util.FastjsonUtil;
|
|
|
+//import com.uas.hystorage.util.HttpCallback;
|
|
|
+//import com.uas.hystorage.util.HttpParams;
|
|
|
+//import com.uas.hystorage.util.LogUtil;
|
|
|
+//import com.uas.hystorage.util.StringUtil;
|
|
|
+//import com.uas.hystorage.util.VollyRequest;
|
|
|
+//import com.uas.hystorage.view.ClearableEditText;
|
|
|
+//
|
|
|
+//import java.util.ArrayList;
|
|
|
+//import java.util.List;
|
|
|
+//
|
|
|
+//import razerdp.basepopup.BasePopupWindow;
|
|
|
+//
|
|
|
+//public class InspectionSendSamples extends BaseActivity {
|
|
|
+//
|
|
|
+// private Button bt_return;
|
|
|
+// private TextView tv_title, tv_gangweiname;
|
|
|
+// private ImageView iv_icon, iv_search;
|
|
|
+// private RadioGroup rg_jianyanleixin;
|
|
|
+// private ClearableEditText cet_gangweiziyuan;
|
|
|
+// private TextView cet_jitai, cet_gondanhao, cet_xiangmuhao;
|
|
|
+// private TextView tv_isok, tv_details;
|
|
|
+// private Button bt_dayinbiaoqian;
|
|
|
+// private String rb_changetext;
|
|
|
+// private StringRequest mStringRequest;
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// protected void initViews() {
|
|
|
+// setContentView(R.layout.act_inspection_send_samples);
|
|
|
+// bt_return = findViewById(R.id.bt_return);
|
|
|
+// tv_title = findViewById(R.id.tv_title);
|
|
|
+// iv_icon = findViewById(R.id.iv_icon);
|
|
|
+//
|
|
|
+// rg_jianyanleixin = findViewById(R.id.rg_jianyanleixin);
|
|
|
+// cet_gangweiziyuan = findViewById(R.id.cet_gangweiziyuan);
|
|
|
+// iv_search = findViewById(R.id.iv_search);
|
|
|
+// tv_gangweiname = findViewById(R.id.tv_gangweiname);
|
|
|
+//
|
|
|
+// cet_jitai = findViewById(R.id.cet_jitai);
|
|
|
+// cet_gondanhao = findViewById(R.id.cet_gondanhao);
|
|
|
+// cet_xiangmuhao = findViewById(R.id.cet_xiangmuhao);
|
|
|
+//
|
|
|
+// bt_dayinbiaoqian = findViewById(R.id.bt_dayinbiaoqian);
|
|
|
+// tv_isok = findViewById(R.id.tv_isok);
|
|
|
+// tv_details = findViewById(R.id.tv_details);
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// protected void initEvents() {
|
|
|
+// iv_icon.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// //送样清单列表
|
|
|
+//
|
|
|
+// }
|
|
|
+// });
|
|
|
+// rg_jianyanleixin.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
|
|
+// @Override
|
|
|
+// public void onCheckedChanged(RadioGroup group, int checkedId) {
|
|
|
+// switch (checkedId) {
|
|
|
+// case R.id.rb_shoujian:
|
|
|
+// rb_changetext = "首件";
|
|
|
+// break;
|
|
|
+// case R.id.rb_xunjian:
|
|
|
+// rb_changetext = "巡检";
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// CommonUtil.setEditorActionListener(cet_gangweiziyuan, new MyEditorActionListener() {
|
|
|
+// @Override
|
|
|
+// public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
+// getJobResources();
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// iv_search.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// getRepairStep();
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// bt_dayinbiaoqian.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// getPrintLabel();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+//
|
|
|
+// private void getPrintLabel() {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// private void getRepairStep() {
|
|
|
+// progressDialog.show();
|
|
|
+// VollyRequest.getInstance().stringRequest(mStringRequest,
|
|
|
+// new HttpParams.Builder()
|
|
|
+// .url(GloableParams.ADDRESS_PAD_GETSOURCEBYEMP)
|
|
|
+// .method(Request.Method.GET)
|
|
|
+// .tag("getMaCode")
|
|
|
+// .flag(0)
|
|
|
+// .build(), new HttpCallback() {
|
|
|
+// @Override
|
|
|
+// public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+// progressDialog.dismiss();
|
|
|
+// Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
|
|
|
+// JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "data");
|
|
|
+// if (isSuccess){
|
|
|
+// if (dataArray == null){
|
|
|
+// CommonUtil.toastNoRepeat(InspectionSendSamples.this,"未搜索到匹配数据");
|
|
|
+// }else {
|
|
|
+// handleFeededlineData(dataArray);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// @Override
|
|
|
+// public void onFail(int flag, String failStr) throws Exception {
|
|
|
+// progressDialog.dismiss();
|
|
|
+// CommonUtil.toastNoRepeat(InspectionSendSamples.this, failStr);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+//
|
|
|
+// private void getJobResources() {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// protected void initDatas() {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// private void handleFeededlineData(JSONArray dataArray) {
|
|
|
+// PostPunchFragment.ComDataBean bean;
|
|
|
+// ComDataBeanList.clear();
|
|
|
+// for (Object index : dataArray) {
|
|
|
+// JSONObject data = (JSONObject) index;
|
|
|
+// bean= new PostPunchFragment.ComDataBean();
|
|
|
+// bean.setItemName(data.getString("SC_NAME"));
|
|
|
+// bean.setItemremark(data.getString("SC_CODE"));
|
|
|
+// ComDataBeanList.add(bean);
|
|
|
+// }
|
|
|
+// initresourcesPopupWindow();
|
|
|
+// }
|
|
|
+//
|
|
|
+// private void initresourcesPopupWindow() {
|
|
|
+// View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_recycle_item, null);
|
|
|
+// edit_et = (ClearableEditText) contView.findViewById(R.id.edit_et);
|
|
|
+// TextView sure_tv = (TextView) contView.findViewById(R.id.sure_tv);
|
|
|
+// TextView cancle_tv = (TextView) contView.findViewById(R.id.cancle_tv);
|
|
|
+// ImageView search_im = contView.findViewById(R.id.search_im);
|
|
|
+// LinearLayout line_top = contView.findViewById(R.id.line_top);
|
|
|
+// rv_line_ip_port_data = contView.findViewById(R.id.rv_ip_port_data);
|
|
|
+// rv_line_ip_port_data.addItemDecoration(new DividerItemDecoration(mActivity, LinearLayout.VERTICAL));
|
|
|
+// rv_line_ip_port_data.setLayoutManager(new LinearLayoutManager(mActivity));
|
|
|
+// ipAndResourcesPortAdapter = new PostPunchFragment.IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+// ipAndResourcesPortAdapter.setmList(ComDataBeanList);
|
|
|
+// rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+// setlineAdapter(ComDataBeanList);
|
|
|
+// // edit_et.setText(ct_qty.getText().toString().trim());
|
|
|
+//
|
|
|
+// edit_et.requestFocus();
|
|
|
+// editPW = new PopupWindow(contView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
|
|
|
+// editPW.setTouchable(true);
|
|
|
+// editPW.setBackgroundDrawable(new BitmapDrawable());
|
|
|
+// editPW.setOnDismissListener(new BasePopupWindow.OnDismissListener() {
|
|
|
+// @Override
|
|
|
+// public void onDismiss() {
|
|
|
+// closeListPopupWindow();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// View parentView = mActivity.getWindow().findViewById(Window.ID_ANDROID_CONTENT);
|
|
|
+// editPW.showAtLocation(parentView, Gravity.CENTER, 0, 0);
|
|
|
+// CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
|
|
|
+// edit_et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
+// @Override
|
|
|
+// public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
+// if (actionId == EditorInfo.IME_ACTION_DONE
|
|
|
+// || actionId == EditorInfo.IME_ACTION_SEND
|
|
|
+// || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
|
|
+// String mSearchStr = edit_et.getText().toString().trim();
|
|
|
+// if (!mSearchStr.isEmpty()) {
|
|
|
+// List<PostPunchFragment.ComDataBean> thisList = new ArrayList<>();
|
|
|
+// for(int i=0;i<ComDataBeanList.size();i++){
|
|
|
+// if(ComDataBeanList.get(i).getItemremark().contains(mSearchStr)||ComDataBeanList.get(i).getItemName().contains(mSearchStr)){
|
|
|
+// thisList.add(ComDataBeanList.get(i));
|
|
|
+// }
|
|
|
+// if(i == ComDataBeanList.size() -1){
|
|
|
+// ipAndResourcesPortAdapter = new PostPunchFragment.IpAndResourcesPortAdapter(thisList);
|
|
|
+// rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+// LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
|
|
|
+//
|
|
|
+// }
|
|
|
+// List<PostPunchFragment.ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+// for (int j = 0; j < lineCodeEntities.size(); j++) {
|
|
|
+// lineCodeEntities.get(j).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// ipAndResourcesPortAdapter = new PostPunchFragment.IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+// rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+// List<PostPunchFragment.ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+// for (int i = 0; i < lineCodeEntities.size(); i++) {
|
|
|
+// lineCodeEntities.get(i).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+//
|
|
|
+// }
|
|
|
+// ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+// List<PostPunchFragment.ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
|
|
|
+// sc_name = ipAndPortBeans.get(position).getItemName();
|
|
|
+// sc_code = ipAndPortBeans.get(position).getItemremark();
|
|
|
+// for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
+// ipAndPortBeans.get(i).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndPortBeans.get(position).setChecked(true);
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// return true;
|
|
|
+// }
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+//
|
|
|
+// search_im.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// String mSearchStr = edit_et.getText().toString().trim();
|
|
|
+// if (!mSearchStr.isEmpty()) {
|
|
|
+// List<PostPunchFragment.ComDataBean> thisList = new ArrayList<>();
|
|
|
+// for(int i=0;i<ComDataBeanList.size();i++){
|
|
|
+// if(ComDataBeanList.get(i).getItemremark().contains(mSearchStr)||ComDataBeanList.get(i).getItemName().contains(mSearchStr)){
|
|
|
+// thisList.add(ComDataBeanList.get(i));
|
|
|
+// }
|
|
|
+// if(i == ComDataBeanList.size() -1){
|
|
|
+// ipAndResourcesPortAdapter = new PostPunchFragment.IpAndResourcesPortAdapter(thisList);
|
|
|
+// rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+// LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
|
|
|
+//
|
|
|
+// }
|
|
|
+// List<PostPunchFragment.ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+// for (int j = 0; j < lineCodeEntities.size(); j++) {
|
|
|
+// lineCodeEntities.get(j).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// ipAndResourcesPortAdapter = new PostPunchFragment.IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+// rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+// List<PostPunchFragment.ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+// for (int i = 0; i < lineCodeEntities.size(); i++) {
|
|
|
+// lineCodeEntities.get(i).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+//
|
|
|
+// }
|
|
|
+// ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+// List<PostPunchFragment.ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
|
|
|
+// sc_name = ipAndPortBeans.get(position).getItemName();
|
|
|
+// sc_code = ipAndPortBeans.get(position).getItemremark();
|
|
|
+// for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
+// ipAndPortBeans.get(i).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndPortBeans.get(position).setChecked(true);
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+//
|
|
|
+// });
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+// List<String> list=new ArrayList<>();
|
|
|
+// //确定
|
|
|
+// sure_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// list.clear();
|
|
|
+//
|
|
|
+// if (StringUtil.isEmpty(sc_code)){
|
|
|
+// CommonUtil.toastNoRepeat(mActivity,"请选择工序");
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// ct_qty.setText(sc_code);
|
|
|
+// ct_qty.requestFocus();
|
|
|
+// ct_qty.setSelection(ct_qty.getText().length());
|
|
|
+// getSourcePunchInfo(ct_qty.getText().toString().trim());
|
|
|
+// closeListPopupWindow();
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// //取消
|
|
|
+// cancle_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(View v) {
|
|
|
+// closeListPopupWindow();
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// String mSearchStr = edit_et.getText().toString().trim();
|
|
|
+// if (mSearchStr.isEmpty()) {
|
|
|
+// ipAndResourcesPortAdapter = new PostPunchFragment.IpAndResourcesPortAdapter(ComDataBeanList);
|
|
|
+// rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
|
|
|
+// List<PostPunchFragment.ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
|
|
|
+// for (int i = 0; i < lineCodeEntities.size(); i++) {
|
|
|
+// lineCodeEntities.get(i).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+//
|
|
|
+// ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
+// List<PostPunchFragment.ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
|
|
|
+// sc_name = ipAndPortBeans.get(position).getItemName();
|
|
|
+// sc_code = ipAndPortBeans.get(position).getItemremark();
|
|
|
+// for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
+// ipAndPortBeans.get(i).setChecked(false);
|
|
|
+// }
|
|
|
+// ipAndPortBeans.get(position).setChecked(true);
|
|
|
+// ipAndResourcesPortAdapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// private void closeListPopupWindow() {
|
|
|
+// if (editPW != null) {
|
|
|
+// editPW.dismiss();
|
|
|
+// editPW = null;
|
|
|
+// CommonUtil.setBackgroundAlpha(mActivity, 1f);
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+//}
|