|
|
@@ -0,0 +1,1059 @@
|
|
|
+package com.uas.rd_equipment.fragment;
|
|
|
+
|
|
|
+import android.annotation.SuppressLint;
|
|
|
+import android.app.Activity;
|
|
|
+import android.content.Intent;
|
|
|
+import android.graphics.Color;
|
|
|
+import android.os.Bundle;
|
|
|
+import android.support.annotation.Nullable;
|
|
|
+import android.support.v4.app.Fragment;
|
|
|
+import android.support.v4.content.ContextCompat;
|
|
|
+import android.text.Editable;
|
|
|
+import android.text.TextWatcher;
|
|
|
+import android.util.Log;
|
|
|
+import android.view.KeyEvent;
|
|
|
+import android.view.View;
|
|
|
+import android.view.WindowManager;
|
|
|
+import android.view.inputmethod.EditorInfo;
|
|
|
+import android.widget.AdapterView;
|
|
|
+import android.widget.ArrayAdapter;
|
|
|
+import android.widget.AutoCompleteTextView;
|
|
|
+import android.widget.Button;
|
|
|
+import android.widget.ImageView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
+import android.widget.PopupWindow;
|
|
|
+import android.widget.RadioButton;
|
|
|
+import android.widget.RadioGroup;
|
|
|
+import android.widget.Spinner;
|
|
|
+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.bin.david.form.core.SmartTable;
|
|
|
+import com.bin.david.form.core.TableConfig;
|
|
|
+import com.bin.david.form.data.CellInfo;
|
|
|
+import com.bin.david.form.data.column.Column;
|
|
|
+import com.bin.david.form.data.format.bg.BaseCellBackgroundFormat;
|
|
|
+import com.bin.david.form.data.style.FontStyle;
|
|
|
+import com.bin.david.form.data.table.TableData;
|
|
|
+import com.bin.david.form.listener.OnColumnItemClickListener;
|
|
|
+import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
+import com.chad.library.adapter.base.BaseViewHolder;
|
|
|
+import com.uas.rd_equipment.R;
|
|
|
+import com.uas.rd_equipment.activity.FunctionActivity;
|
|
|
+import com.uas.rd_equipment.bean.LinecodeBean;
|
|
|
+import com.uas.rd_equipment.bean.MakerecordBean;
|
|
|
+import com.uas.rd_equipment.bean.ResourcesBean;
|
|
|
+import com.uas.rd_equipment.bean.User;
|
|
|
+import com.uas.rd_equipment.camera.CaptureActivity;
|
|
|
+import com.uas.rd_equipment.global.GloableParams;
|
|
|
+import com.uas.rd_equipment.tools.SharedPreUtil;
|
|
|
+import com.uas.rd_equipment.util.CameraUtil;
|
|
|
+import com.uas.rd_equipment.util.CommonUtil;
|
|
|
+import com.uas.rd_equipment.util.Constants;
|
|
|
+import com.uas.rd_equipment.util.FastjsonUtil;
|
|
|
+import com.uas.rd_equipment.util.HttpCallback;
|
|
|
+import com.uas.rd_equipment.util.HttpParams;
|
|
|
+import com.uas.rd_equipment.util.LogUtil;
|
|
|
+import com.uas.rd_equipment.util.StringUtil;
|
|
|
+import com.uas.rd_equipment.util.VolleyRequest;
|
|
|
+import com.uas.rd_equipment.util.VollyRequest;
|
|
|
+import com.uas.rd_equipment.view.ClearableEditText;
|
|
|
+import com.uuzuche.lib_zxing.activity.CodeUtils;
|
|
|
+
|
|
|
+import org.json.JSONException;
|
|
|
+
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Calendar;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.Iterator;
|
|
|
+import java.util.LinkedHashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Created by cjh on 2023-05-31
|
|
|
+ * cjh生产信息绑定
|
|
|
+ */
|
|
|
+public class AddEquipmentGrantFragment extends BaseFragment implements OnColumnItemClickListener<String>, View.OnClickListener ,AdapterView.OnItemSelectedListener{
|
|
|
+
|
|
|
+ private AutoCompleteTextView storage_recharge_collect_et;
|
|
|
+ private PopupWindow mMenuPopupWindow;
|
|
|
+ private Fragment mFragment;
|
|
|
+ private SmartTable mSmartTable;
|
|
|
+ private Column<String> va_classColumn,va_codeColumn,va_vendnameColumn,va_vendcodeColumn,va_inmancolumn,va_DELETEColumn;
|
|
|
+ private TableData<MakerecordBean> mTableData;
|
|
|
+ private List<MakerecordBean> mFilterStorageInBeans;
|
|
|
+ private ImageView mScanImageView;
|
|
|
+ private static final int SCAN_BARCODE_CODE = 111;
|
|
|
+ private static final int SCAN_ID_BARCODE_CODE = 890;
|
|
|
+ private static final int SCAN_BARCODE_CODESD = 925;
|
|
|
+ private int mFocusId;
|
|
|
+ private Button bt_add;
|
|
|
+ private AutoCompleteTextView et_linecode_smts;
|
|
|
+ private ImageView iocout_smts;
|
|
|
+ private TextView tv_pr_code;
|
|
|
+ private TextView tv_pr_detail;
|
|
|
+ private TextView tv_save;
|
|
|
+ private RadioGroup rg_change;
|
|
|
+ private RadioButton rb_equipment;
|
|
|
+ private RadioButton rb_fixture;
|
|
|
+ private RadioButton rb_ingredients;
|
|
|
+ private String rb_changetext = null;
|
|
|
+ private IpAndlinecodePortAdapter ipAndlinecodePortAdapter;
|
|
|
+ private String ma_code;
|
|
|
+ private List<LinecodeBean> linecodeBeanList;
|
|
|
+ private ClearableEditText edit_et;
|
|
|
+ private PopupWindow editPW;
|
|
|
+ private String adapterpr_code;
|
|
|
+ private String adapterpr_detail;
|
|
|
+ private IpAndResourcesPortAdapter ipAndResourcesPortAdapter;
|
|
|
+ private String sc_code;
|
|
|
+ private List<ResourcesBean> resourcesBeanList;
|
|
|
+ private AutoCompleteTextView tv_dc_emcode;
|
|
|
+ private ImageView iv_dc_emcode;
|
|
|
+ private TextView tv_dc_emname;
|
|
|
+ private String substring;
|
|
|
+ private TextView work_code_code;
|
|
|
+ Spinner masterSpinner;
|
|
|
+ static ArrayAdapter adapter;
|
|
|
+ private List<String> masterFuncList;
|
|
|
+ private String maFunName = null;
|
|
|
+ private ImageView shaopwork_id;
|
|
|
+ private List<String> stringList;
|
|
|
+ private Set<String> setstring;
|
|
|
+ private ImageView tv_dc_emcode_delete;
|
|
|
+ private List<User> list;
|
|
|
+ private TextView tv_grantcode;
|
|
|
+ private TextView tv_prompt;
|
|
|
+ private TextView tv_confirm_receipt;
|
|
|
+ private String dc_code;
|
|
|
+ private String dc_status;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected int getLayout() {
|
|
|
+ return R.layout.addeqipmentgrant_fragment;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initViews() {
|
|
|
+ FunctionActivity.setTitle(getString(R.string.addequipmentgrant));
|
|
|
+ storage_recharge_collect_et = root.findViewById(R.id.storage_recharge_collect_et);
|
|
|
+ mSmartTable = root.findViewById(R.id.addgrant);
|
|
|
+ mScanImageView = (ImageView) root.findViewById(R.id.storage_recharge_scan_iv);
|
|
|
+ et_linecode_smts = root.findViewById(R.id.et_linecode_smts);
|
|
|
+ et_linecode_smts.setThreshold(1);
|
|
|
+ iocout_smts = root.findViewById(R.id.iocout_smts);
|
|
|
+ et_linecode_smts.setThreshold(1);
|
|
|
+ tv_pr_code = root.findViewById(R.id.tv_pr_code);
|
|
|
+ tv_pr_detail = root.findViewById(R.id.tv_pr_detail);
|
|
|
+ tv_save = root.findViewById(R.id.tv_save);
|
|
|
+ rg_change = root.findViewById(R.id.rg_change);
|
|
|
+ rb_equipment = root.findViewById(R.id.rb_equipment);
|
|
|
+ rb_fixture = root.findViewById(R.id.rb_fixture);
|
|
|
+ rb_ingredients = root.findViewById(R.id.rb_ingredients);
|
|
|
+ tv_dc_emcode = root.findViewById(R.id.tv_dc_emcode);
|
|
|
+ iv_dc_emcode = root.findViewById(R.id.iv_dc_emcode);
|
|
|
+ tv_dc_emname = root.findViewById(R.id.tv_dc_emname);
|
|
|
+ work_code_code = root.findViewById(R.id.work_code_code);
|
|
|
+ masterSpinner = (Spinner) root.findViewById(R.id.sp_login);
|
|
|
+ shaopwork_id = root.findViewById(R.id.shaopwork_id);
|
|
|
+ tv_dc_emcode_delete = root.findViewById(R.id.tv_dc_emcode_delete);
|
|
|
+ tv_grantcode = root.findViewById(R.id.tv_grantcode);
|
|
|
+ tv_prompt = root.findViewById(R.id.tv_prompt);
|
|
|
+ tv_confirm_receipt = root.findViewById(R.id.tv_confirm_receipt);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initEvents() {
|
|
|
+ et_linecode_smts.requestFocus();
|
|
|
+ mFilterStorageInBeans = Collections.synchronizedList(new ArrayList<>());
|
|
|
+
|
|
|
+ Bundle arguments = getArguments();
|
|
|
+ if (arguments != null){
|
|
|
+ dc_code = arguments.getString("dc_code");
|
|
|
+ dc_status = arguments.getString("dc_status");
|
|
|
+ if (!StringUtil.isEmpty(dc_status)){
|
|
|
+ if (!dc_status.equals("在录入")){
|
|
|
+ tv_save.setEnabled(false);
|
|
|
+ tv_confirm_receipt.setEnabled(false);
|
|
|
+ //扫码框
|
|
|
+ storage_recharge_collect_et.setEnabled(false);
|
|
|
+ storage_recharge_collect_et.setFocusable(false);
|
|
|
+ storage_recharge_collect_et.setKeyListener(null);//重点
|
|
|
+ //工单ID
|
|
|
+ et_linecode_smts.setEnabled(false);
|
|
|
+ et_linecode_smts.setFocusable(false);
|
|
|
+ et_linecode_smts.setKeyListener(null);//重点
|
|
|
+ // 人员编号
|
|
|
+ tv_dc_emcode.setEnabled(false);
|
|
|
+ tv_dc_emcode.setFocusable(false);
|
|
|
+ tv_dc_emcode.setKeyListener(null);//重点
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ tv_grantcode.setText(dc_code);
|
|
|
+ getDatalistCodes("",work_code_code.getText().toString().trim());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void initDatas() {
|
|
|
+ WindowManager wm = mActivity.getWindowManager();
|
|
|
+ int screenWith = wm.getDefaultDisplay().getWidth();
|
|
|
+ mSmartTable.getConfig().setMinTableWidth(screenWith)
|
|
|
+ .setShowXSequence(false)
|
|
|
+ .setShowYSequence(false)
|
|
|
+ .setShowTableTitle(false)
|
|
|
+ .setFixedTitle(true)
|
|
|
+ .setVerticalPadding(CommonUtil.dip2px(mActivity, 12))
|
|
|
+ .setColumnTitleVerticalPadding(CommonUtil.dip2px(mActivity, 12))
|
|
|
+ .setHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
|
|
|
+ .setSequenceHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
|
|
|
+ .setColumnTitleHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
|
|
|
+ .setColumnTitleStyle(new FontStyle(CommonUtil.sp2px(mActivity, 15), Color.parseColor("#000000")))
|
|
|
+ .setContentCellBackgroundFormat(new BaseCellBackgroundFormat<CellInfo>() {
|
|
|
+ @Override
|
|
|
+ public int getBackGroundColor(CellInfo cellInfo) {
|
|
|
+ if (cellInfo.row % 2 == 0) {
|
|
|
+ return ContextCompat.getColor(mActivity, R.color.blue_50);
|
|
|
+ }
|
|
|
+ return TableConfig.INVALID_COLOR;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ va_vendnameColumn = new Column<String>("设备编号", "MBR_BARCODE");
|
|
|
+ va_vendnameColumn.setFixed(true);
|
|
|
+ va_vendcodeColumn = new Column<String>("名称", "PR_DETAIL");
|
|
|
+ va_codeColumn = new Column<String>("日期", "MBR_INDATE");
|
|
|
+ va_inmancolumn = new Column<String>("操作员", "MBR_INMAN");
|
|
|
+ va_classColumn = new Column<String>("单据编号", "MBR_MAKECODE");
|
|
|
+ va_DELETEColumn = new Column<String>("操作", "MBR_DELETE");
|
|
|
+ va_DELETEColumn.setOnColumnItemClickListener(this);
|
|
|
+ mScanImageView.setOnClickListener(this);
|
|
|
+ shaopwork_id.setOnClickListener(this);
|
|
|
+ masterSpinner.setOnItemSelectedListener(this);
|
|
|
+ /**----------------------------------扫码框------------------------------**/
|
|
|
+ storage_recharge_collect_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)) {
|
|
|
+ getsaVeData();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ linecodeBeanList = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
+ /**----------------------------------工单ID------------------------------**/
|
|
|
+ ipAndlinecodePortAdapter=new IpAndlinecodePortAdapter(linecodeBeanList);
|
|
|
+ et_linecode_smts.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 va_code = et_linecode_smts.getText().toString().trim();
|
|
|
+ getfuzzySearchData(va_code,"");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ et_linecode_smts.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 (s == null || s.length() == 0) {
|
|
|
+ iocout_smts.setVisibility(View.GONE);
|
|
|
+ } else {
|
|
|
+ iocout_smts.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ iocout_smts.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ et_linecode_smts.setText("");
|
|
|
+ et_linecode_smts.requestFocus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ rg_change.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
|
|
+ @SuppressLint("NonConstantResourceId")
|
|
|
+ @Override
|
|
|
+ public void onCheckedChanged(RadioGroup radioGroup, int checkid) {
|
|
|
+ switch (checkid){
|
|
|
+ case R.id.rb_equipment:
|
|
|
+ rb_changetext = "设备";
|
|
|
+ getDatalistCodes("",work_code_code.getText().toString().trim());
|
|
|
+ break;
|
|
|
+ case R.id.rb_fixture:
|
|
|
+ rb_changetext = "夹具";
|
|
|
+ getDatalistCodes("",work_code_code.getText().toString().trim());
|
|
|
+ break;
|
|
|
+ case R.id.rb_ingredients:
|
|
|
+ rb_changetext = "辅料";
|
|
|
+ getDatalistCodes("",work_code_code.getText().toString().trim());
|
|
|
+ break;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ tv_save.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+
|
|
|
+
|
|
|
+// getDatalistCodes(ce_resources.getText().toString().trim(),work_code_code.getText().toString().trim());
|
|
|
+ getNewCommitData();
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ tv_confirm_receipt.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ getOKTconfirmReceipt();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ stringList = new ArrayList<>();
|
|
|
+ setstring = new HashSet<>();
|
|
|
+ //人员编号
|
|
|
+ tv_dc_emcode.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 dc_emcode = tv_dc_emcode.getText().toString().trim();
|
|
|
+ getNewdc_emcodeData(dc_emcode);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ tv_dc_emcode.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 (s == null || s.length() == 0) {
|
|
|
+ tv_dc_emcode_delete.setVisibility(View.GONE);
|
|
|
+ } else {
|
|
|
+ tv_dc_emcode_delete.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ tv_dc_emcode_delete.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ tv_dc_emcode.setText("");
|
|
|
+ tv_dc_emcode.requestFocus();
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ iv_dc_emcode.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ tv_dc_emcode.requestFocus();
|
|
|
+ if (CameraUtil.hasCamera()) {
|
|
|
+ if (root.findFocus() != null) {
|
|
|
+ mFocusId = root.findFocus().getId();
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.setClass(mActivity, CaptureActivity.class);
|
|
|
+ startActivityForResult(intent, SCAN_BARCODE_CODESD);
|
|
|
+ SharedPreUtil.saveString(mActivity, Constants.STORAGEERECHADD, "NO");
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请选择您要操作的输入框");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ masterFuncList = new ArrayList<String>();
|
|
|
+ getworkshopData();
|
|
|
+// ceshiData();
|
|
|
+ }
|
|
|
+
|
|
|
+ String inputString ="" ;
|
|
|
+ public void getNewdc_emcodeData(String input){
|
|
|
+
|
|
|
+ if (input.isEmpty()){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请输入人员编号");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ list = new ArrayList<>();
|
|
|
+ list.clear();
|
|
|
+ String[] split = input.split(",");
|
|
|
+
|
|
|
+ for (String value : split) {
|
|
|
+ User user=new User();
|
|
|
+ if (!value.isEmpty()) {
|
|
|
+ user.setName(value + ",");
|
|
|
+ list.add(user);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < list.size(); i++) //外循环是循环的次数
|
|
|
+ {
|
|
|
+ for (int j = list.size() - 1; j > i; j--) //内循环是 外循环一次比较的次数
|
|
|
+ {
|
|
|
+ if (list.get(i).getName().equals(list.get(j).getName()))
|
|
|
+ {
|
|
|
+ list.remove(j);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int s = 0; s < list.size(); s++) {
|
|
|
+ inputString+= list.get(s).getName();
|
|
|
+ }
|
|
|
+ progressDialog.show();
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_SELECT_GETEMNAME)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("em_code",inputString)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {//DeviceChange!Use
|
|
|
+ progressDialog.dismiss();
|
|
|
+ String result = o.toString();
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ JSONObject dataObject = resultObject.getJSONObject("items");
|
|
|
+ String de_name = FastjsonUtil.getText(dataObject, "em_name");
|
|
|
+ tv_dc_emname.setText(de_name);
|
|
|
+ tv_dc_emcode.setText(inputString+"");
|
|
|
+ tv_dc_emcode.setSelection(tv_dc_emcode.getText().toString().length());
|
|
|
+ inputString="";
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ inputString="";
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ for (int s = 0; s < list.size(); s++) {
|
|
|
+ if (failStr.contains(list.get(s).getName().replace(",",""))){
|
|
|
+ list.remove(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (int s = 0; s < list.size(); s++) {
|
|
|
+ inputString+= list.get(s).getName();
|
|
|
+ }
|
|
|
+ tv_dc_emcode.setText(inputString+"");
|
|
|
+ tv_dc_emcode.setSelection(tv_dc_emcode.getText().toString().length());
|
|
|
+ inputString="";
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static List<String> removeDuplicate(List<String> list)
|
|
|
+
|
|
|
+ {
|
|
|
+ Set set = new LinkedHashSet<String>();
|
|
|
+ set.addAll(list);
|
|
|
+ list.clear();
|
|
|
+ list.addAll(set);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 得到去除重复后的集合
|
|
|
+ * @param list
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private static List<User> getRemoveList(List<User> list){
|
|
|
+ Set set = new HashSet();
|
|
|
+ List<User> newList = new ArrayList<>();
|
|
|
+ for (Iterator iter = list.iterator(); iter.hasNext();){
|
|
|
+ User object = (User) iter.next();
|
|
|
+ if(set.add(object))
|
|
|
+ newList.add(object);
|
|
|
+ }
|
|
|
+ return newList;
|
|
|
+ }
|
|
|
+ //工单ID
|
|
|
+ public void getfuzzySearchData(String inoutNo,String stop){
|
|
|
+ progressDialog.show();
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_SMT_FUZZY_SEARCH)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("inoutNo", inoutNo)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ String s = o.toString();
|
|
|
+ List<String> mAutoStrings = new ArrayList<String>();
|
|
|
+ try {
|
|
|
+ mAutoStrings.clear();
|
|
|
+ linecodeBeanList.clear();
|
|
|
+ org.json.JSONObject resultObject = new org.json.JSONObject(s);
|
|
|
+ org.json.JSONArray dataArray = resultObject.optJSONArray("data");
|
|
|
+ JSONArray dataArrayone = FastjsonUtil.getJSONArray(o.toString(),"data");
|
|
|
+ if (dataArrayone == null|| dataArrayone.size() == 0){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity,"未搜索到匹配数据");
|
|
|
+ }
|
|
|
+ for(Object index:dataArrayone){
|
|
|
+ JSONObject data = (JSONObject) index;
|
|
|
+ LinecodeBean bean = new LinecodeBean();
|
|
|
+ bean.setMA_CODE(data.getString("MA_CODE"));
|
|
|
+ bean.setPR_CODE(data.getString("PR_CODE"));
|
|
|
+ bean.setPR_DETAIL(data.getString("PR_DETAIL"));
|
|
|
+ bean.setMA_WCCODE(data.getString("MA_WCCODE"));
|
|
|
+ tv_pr_code.setText(""+data.getString("PR_CODE"));
|
|
|
+ tv_pr_detail.setText("产品名称 "+data.getString("PR_DETAIL"));
|
|
|
+ work_code_code.setText(""+data.getString("MA_CODE"));
|
|
|
+ linecodeBeanList.add(bean);
|
|
|
+ CommonUtil.setSpinnerItemSelectedByValue(masterSpinner, data.getString("MA_WCCODE"));
|
|
|
+ }
|
|
|
+ ipAndlinecodePortAdapter.setmList(linecodeBeanList);
|
|
|
+ ipAndlinecodePortAdapter.notifyDataSetChanged();
|
|
|
+ if (!stop.equals("stop")){
|
|
|
+ getDatalistCodes("",work_code_code.getText().toString().trim());
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (JSONException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ public void getworkshopData(){
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_SELECT_GETWORKCENTER)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+
|
|
|
+ try {
|
|
|
+ masterFuncList.clear();
|
|
|
+ JSONArray dataArrayone = FastjsonUtil.getJSONArray(o.toString(),"items");
|
|
|
+ if (dataArrayone == null|| dataArrayone.size() == 0){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity,"未搜索到匹配数据");
|
|
|
+ }
|
|
|
+ for(Object index:dataArrayone){
|
|
|
+ JSONObject data = (JSONObject) index;
|
|
|
+ masterFuncList.add(data.getString("WC_NAME"));
|
|
|
+ }
|
|
|
+
|
|
|
+ adapter = new ArrayAdapter(mActivity, R.layout.item_spinner, R.id.text_spinner, masterFuncList);
|
|
|
+ masterSpinner.setAdapter(adapter);
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ //获得master的name
|
|
|
+ maFunName = masterFuncList.get(position);
|
|
|
+ LogUtil.i("maname",maFunName);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onNothingSelected(AdapterView<?> parent) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private void getDatalistCodes(String decode,String macode){
|
|
|
+ if (rb_equipment.isChecked()){
|
|
|
+ rb_changetext="设备";
|
|
|
+ }
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_SELECT_GRANt)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .tag(TAG + "getindatalist")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("macode", macode)
|
|
|
+ .addParam("dc_code", tv_grantcode.getText().toString().trim())
|
|
|
+ .addParam("type", rb_changetext)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ try {
|
|
|
+ mFilterStorageInBeans.clear();
|
|
|
+ String result = o.toString();
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ JSONArray dataArray = resultObject.getJSONArray("success");
|
|
|
+ List<MakerecordBean> list=new ArrayList<>();
|
|
|
+ list.clear();
|
|
|
+ if (dataArray != null && dataArray.size() > 0) {
|
|
|
+ for (int i = 0; i < dataArray.size(); i++) {
|
|
|
+ JSONObject dataObject = dataArray.getJSONObject(i);
|
|
|
+ if (dataObject != null) {
|
|
|
+ MakerecordBean jltStorageInBean = new MakerecordBean();
|
|
|
+ jltStorageInBean.setMBR_ID(FastjsonUtil.getText(dataObject, "MBR_ID"));
|
|
|
+ jltStorageInBean.setMBR_BARCODE(FastjsonUtil.getText(dataObject, "MBR_BARCODE"));
|
|
|
+ jltStorageInBean.setMBR_PRODCODE(FastjsonUtil.getText(dataObject, "MBR_PRODCODE"));
|
|
|
+ jltStorageInBean.setMBR_MAKECODE(FastjsonUtil.getText(dataObject, "MBR_MAKECODE"));
|
|
|
+ jltStorageInBean.setMBR_SOURCECODE(FastjsonUtil.getText(dataObject, "MBR_SOURCECODE"));
|
|
|
+ jltStorageInBean.setMBR_TYPE(FastjsonUtil.getText(dataObject, "MBR_TYPE"));
|
|
|
+ if (!StringUtil.isEmpty(FastjsonUtil.getText(dataObject, "MBR_INDATE"))){
|
|
|
+ String mbr_indate = timetodate(FastjsonUtil.getText(dataObject, "MBR_INDATE"));
|
|
|
+ jltStorageInBean.setMBR_INDATE(mbr_indate);
|
|
|
+ }else {
|
|
|
+ jltStorageInBean.setMBR_INDATE("");
|
|
|
+ }
|
|
|
+ if (!StringUtil.isEmpty(FastjsonUtil.getText(dataObject, "MBR_MAKECODE"))){
|
|
|
+ getfuzzySearchData(FastjsonUtil.getText(dataObject, "MBR_MAKECODE"),"stop");
|
|
|
+ }
|
|
|
+
|
|
|
+ jltStorageInBean.setPR_DETAIL(FastjsonUtil.getText(dataObject, "PR_DETAIL"));
|
|
|
+ jltStorageInBean.setMBR_INMAN(FastjsonUtil.getText(dataObject, "MBR_INMAN"));
|
|
|
+ jltStorageInBean.setMBR_DELETE("删除");
|
|
|
+ list.add(jltStorageInBean);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ mFilterStorageInBeans = list;//PI_INOUTNO
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
+ progressDialog.dismiss();
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ progressDialog.dismiss();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
+ progressDialog.dismiss();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String timetodate(String time) {
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTimeInMillis(Long.valueOf(time));
|
|
|
+ SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//这里的格式可换"yyyy年-MM月dd日-HH时mm分ss秒"等等格式
|
|
|
+
|
|
|
+ String date = sf.format(calendar.getTime());
|
|
|
+ return date;
|
|
|
+
|
|
|
+ }
|
|
|
+ public void geDeleteData(String mbr_id){
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_SELECT_DELETEMAKERECORD)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("mbr_id", mbr_id)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "删除成功");
|
|
|
+ getDatalistCodes("",work_code_code.getText().toString().trim());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ public void getsaVeData(){
|
|
|
+ if (rb_equipment.isChecked()){
|
|
|
+ rb_changetext="设备";
|
|
|
+ }
|
|
|
+ if (rb_fixture.isChecked()){
|
|
|
+ rb_changetext="夹具";
|
|
|
+ }
|
|
|
+ if (rb_ingredients.isChecked()){
|
|
|
+ rb_changetext="辅料";
|
|
|
+ }
|
|
|
+ String tv_grantcodetrim = tv_grantcode.getText().toString().trim();
|
|
|
+ if (tv_grantcodetrim.isEmpty()){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "单据编号为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ String ce_work_codetrim = work_code_code.getText().toString().trim();
|
|
|
+ if (ce_work_codetrim.isEmpty()){
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请选择工单号");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ JSONObject object_1 = new JSONObject();
|
|
|
+ object_1.put("MBR_MAKECODE", ce_work_codetrim);//工单号
|
|
|
+ object_1.put("MBR_TYPE", rb_changetext);//设备\夹具\辅料
|
|
|
+ object_1.put("MBR_PRODCODE", tv_pr_code.getText());//产品编号
|
|
|
+ object_1.put("MBR_INMAN", tv_dc_emname.getText());//人员名称
|
|
|
+ object_1.put("MBR_BARCODE", storage_recharge_collect_et.getText().toString().trim());
|
|
|
+ object_1.put("MBR_DCCODE", tv_grantcode.getText().toString().trim());
|
|
|
+ object_1.put("MBR_WCCODE", maFunName);
|
|
|
+ jsonArray.add(object_1);
|
|
|
+ String substring = jsonArray.toString().substring(0, jsonArray.toString().length() - 1);//去除尾部
|
|
|
+ String substring1 = substring.substring(1, substring.length());//去除首部
|
|
|
+ Log.e("jsonArray===",substring1);
|
|
|
+
|
|
|
+
|
|
|
+ progressDialog.show();
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_SELECT_SAVEMAKERECORD)//ASTATIONTHE_COMMIT_MAINITEM
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("datainto", substring1)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ getDatalistCodes("",work_code_code.getText().toString().trim());
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "保存成功");
|
|
|
+ storage_recharge_collect_et.setText("");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ storage_recharge_collect_et.setText("");
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public void getNewCommitData(){
|
|
|
+ progressDialog.show();
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_COMMIT_MAINITEM)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("caller","DeviceChange!Release")
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ tv_prompt.setVisibility(View.VISIBLE);
|
|
|
+ tv_prompt.setTextColor(Color.GREEN);
|
|
|
+ tv_prompt.setText("提交成功");
|
|
|
+ String result = o.toString();
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ JSONObject dataObject = resultObject.getJSONObject("items");
|
|
|
+ String de_name = FastjsonUtil.getText(dataObject, "dc_code");
|
|
|
+ tv_grantcode.setText(de_name);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ tv_prompt.setVisibility(View.VISIBLE);
|
|
|
+ tv_prompt.setTextColor(Color.RED);
|
|
|
+ tv_prompt.setText(failStr);
|
|
|
+// CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //确认领用
|
|
|
+ public void getOKTconfirmReceipt(){
|
|
|
+ progressDialog.show();
|
|
|
+ VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ASTATIONTHE_SELECT_CONFIRMUSE)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .addParam("caller","DeviceChange!Release")
|
|
|
+ .addParam("dc_code",tv_grantcode.getText().toString().trim())
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ tv_prompt.setVisibility(View.VISIBLE);
|
|
|
+ tv_prompt.setTextColor(Color.GREEN);
|
|
|
+ tv_prompt.setText("领用成功");
|
|
|
+ String result = o.toString();
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ JSONObject dataObject = resultObject.getJSONObject("items");
|
|
|
+ String de_name = FastjsonUtil.getText(dataObject, "dc_code");
|
|
|
+ tv_grantcode.setText(de_name);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ tv_prompt.setVisibility(View.VISIBLE);
|
|
|
+ tv_prompt.setTextColor(Color.RED);
|
|
|
+ tv_prompt.setText(failStr);
|
|
|
+// CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private void setFilterTableData(List<MakerecordBean> filterTableData) {
|
|
|
+ mTableData = new TableData<MakerecordBean>("收料单列表", filterTableData,
|
|
|
+ va_vendnameColumn,va_vendcodeColumn,va_codeColumn,va_inmancolumn,va_classColumn,va_DELETEColumn);
|
|
|
+ mSmartTable.setTableData(mTableData);
|
|
|
+// mSmartTable.requestLayout();
|
|
|
+ mSmartTable.postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ mSmartTable.postInvalidate();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private class IpAndlinecodePortAdapter extends BaseQuickAdapter<LinecodeBean, BaseViewHolder> {
|
|
|
+ private List<LinecodeBean> mmmmList;
|
|
|
+
|
|
|
+ public List<LinecodeBean> getmList() {
|
|
|
+ return mmmmList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setmList(List<LinecodeBean> mList) {
|
|
|
+ this.mmmmList = mList;
|
|
|
+ }
|
|
|
+ public LinecodeBean getBeanByPositon(int position){
|
|
|
+ return mmmmList.get(position);
|
|
|
+ }
|
|
|
+
|
|
|
+ private IpAndlinecodePortAdapter(@Nullable List<LinecodeBean> data) {
|
|
|
+ super(R.layout.fuzzy_ipandport_item, data);
|
|
|
+ this.mmmmList = data;
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ protected void convert(BaseViewHolder helper, LinecodeBean item) {
|
|
|
+ helper.setText(R.id.macode_ip__Tv,item.getMA_CODE()+"-"+item.getPR_CODE()+"-"+item.getPR_DETAIL());
|
|
|
+ LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
|
|
|
+ if (item.getChecked()) {
|
|
|
+ line_true.setSelected(true);
|
|
|
+ } else {
|
|
|
+ line_true.setSelected(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private class IpAndResourcesPortAdapter extends BaseQuickAdapter<ResourcesBean, BaseViewHolder> {
|
|
|
+ private List<ResourcesBean> mmmmList;
|
|
|
+
|
|
|
+ public List<ResourcesBean> getmList() {
|
|
|
+ return mmmmList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setmList(List<ResourcesBean> mList) {
|
|
|
+ this.mmmmList = mList;
|
|
|
+ }
|
|
|
+ public ResourcesBean getBeanByPositon(int position){
|
|
|
+ return mmmmList.get(position);
|
|
|
+ }
|
|
|
+
|
|
|
+ private IpAndResourcesPortAdapter(@Nullable List<ResourcesBean> data) {
|
|
|
+ super(R.layout.fuzzy_ipandport_item, data);
|
|
|
+ this.mmmmList = data;
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ protected void convert(BaseViewHolder helper, ResourcesBean item) {
|
|
|
+ helper.setText(R.id.macode_ip__Tv,item.getSC_CODE());
|
|
|
+ LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
|
|
|
+ if (item.getChecked()) {
|
|
|
+ line_true.setSelected(true);
|
|
|
+ } else {
|
|
|
+ line_true.setSelected(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean onFragmentBackPressed() {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void onHiddenChanged(boolean hidden) {
|
|
|
+ super.onHiddenChanged(hidden);
|
|
|
+ if (hidden) {
|
|
|
+ ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
|
|
|
+ ((FunctionActivity) getActivity()).setListIconIvVisible(false);
|
|
|
+ } else {
|
|
|
+ FunctionActivity.setTitle(getString(R.string.addequipmentgrant));
|
|
|
+ ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
|
|
|
+ ((FunctionActivity) getActivity()).setListIconIvVisible(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onClick(Column<String> column, String value, String s, int position) {
|
|
|
+ String dc_id = mFilterStorageInBeans.get(position).getMBR_ID();
|
|
|
+ geDeleteData(dc_id);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onDestroyView() {
|
|
|
+ super.onDestroyView();
|
|
|
+ ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
|
|
|
+ ((FunctionActivity) getActivity()).setListIconIvVisible(false);
|
|
|
+ CommonUtil.closeKeybord(storage_recharge_collect_et, mActivity);
|
|
|
+ ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.addequipmentgrant));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ switch (v.getId()) {
|
|
|
+ case R.id.storage_recharge_scan_iv:
|
|
|
+ storage_recharge_collect_et.requestFocus();
|
|
|
+ if (CameraUtil.hasCamera()) {
|
|
|
+ if (root.findFocus() != null) {
|
|
|
+ mFocusId = root.findFocus().getId();
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.setClass(mActivity, CaptureActivity.class);
|
|
|
+ startActivityForResult(intent, SCAN_BARCODE_CODE);
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请选择您要操作的输入框");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case R.id.shaopwork_id:
|
|
|
+ et_linecode_smts.requestFocus();
|
|
|
+ if (CameraUtil.hasCamera()) {
|
|
|
+ if (root.findFocus() != null) {
|
|
|
+ mFocusId = root.findFocus().getId();
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.setClass(mActivity, CaptureActivity.class);
|
|
|
+ startActivityForResult(intent, SCAN_ID_BARCODE_CODE);
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请选择您要操作的输入框");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
+ super.onActivityResult(requestCode, resultCode, data);
|
|
|
+ if (resultCode != Activity.RESULT_OK) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (requestCode == SCAN_BARCODE_CODE && data != null) {
|
|
|
+ if (data.getExtras() != null) {
|
|
|
+ String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
|
+ if (mFocusId == R.id.storage_recharge_collect_et) {
|
|
|
+ storage_recharge_collect_et.setText(result);
|
|
|
+ storage_recharge_collect_et.setSelection(result.length());
|
|
|
+ getsaVeData();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (requestCode == SCAN_ID_BARCODE_CODE && data != null) {
|
|
|
+ if (data.getExtras() != null) {
|
|
|
+ String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
|
+ if (mFocusId == R.id.et_linecode_smts) {
|
|
|
+ et_linecode_smts.setText(result);
|
|
|
+ et_linecode_smts.setSelection(result.length());
|
|
|
+ getfuzzySearchData(result,"");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (requestCode == SCAN_BARCODE_CODESD && data != null) {
|
|
|
+ if (data.getExtras() != null) {
|
|
|
+ String result = data.getExtras().getString(com.uas.rd_equipment.camera.CodeUtils.RESULT_STRING);
|
|
|
+ if (mFocusId == R.id.tv_dc_emcode) {
|
|
|
+// tv_dc_emcode.setText(result);
|
|
|
+
|
|
|
+ getNewdc_emcodeData(result);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onDestroy() {
|
|
|
+ super.onDestroy();;
|
|
|
+ }
|
|
|
+}
|