|
|
@@ -53,6 +53,7 @@ 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;
|
|
|
@@ -78,7 +79,10 @@ 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;
|
|
|
|
|
|
import razerdp.basepopup.BasePopupWindow;
|
|
|
|
|
|
@@ -126,7 +130,7 @@ public class ProduceMassageBindingFragment extends BaseFragment implements OnCol
|
|
|
private IpAndResourcesPortAdapter ipAndResourcesPortAdapter;
|
|
|
private String sc_code;
|
|
|
private List<ResourcesBean> resourcesBeanList;
|
|
|
- private ClearableEditText tv_dc_emcode;
|
|
|
+ private AutoCompleteTextView tv_dc_emcode;
|
|
|
private ImageView iv_dc_emcode;
|
|
|
private TextView tv_dc_emname;
|
|
|
private String substring;
|
|
|
@@ -137,7 +141,9 @@ public class ProduceMassageBindingFragment extends BaseFragment implements OnCol
|
|
|
private String maFunName = null;
|
|
|
private ImageView shaopwork_id;
|
|
|
private List<String> stringList;
|
|
|
- private HashSet<String> setstring;
|
|
|
+ private Set<String> setstring;
|
|
|
+ private ImageView tv_dc_emcode_delete;
|
|
|
+ private List<User> list;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -175,13 +181,14 @@ public class ProduceMassageBindingFragment extends BaseFragment implements OnCol
|
|
|
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);
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void initEvents() {
|
|
|
- storage_recharge_collect_et.requestFocus();
|
|
|
+ et_linecode_smts.requestFocus();
|
|
|
mFilterStorageInBeans = Collections.synchronizedList(new ArrayList<>());
|
|
|
}
|
|
|
|
|
|
@@ -391,6 +398,36 @@ public class ProduceMassageBindingFragment extends BaseFragment implements OnCol
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ 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) {
|
|
|
@@ -416,18 +453,46 @@ public class ProduceMassageBindingFragment extends BaseFragment implements OnCol
|
|
|
// 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",tv_dc_emcode.getText().toString().trim()+",")
|
|
|
+ .addParam("em_code",inputString)
|
|
|
.build(), new HttpCallback() {
|
|
|
@Override
|
|
|
public void onSuccess(int flag, Object o) throws Exception {//DeviceChange!Use
|
|
|
@@ -437,46 +502,57 @@ public class ProduceMassageBindingFragment extends BaseFragment implements OnCol
|
|
|
JSONObject dataObject = resultObject.getJSONObject("items");
|
|
|
String de_name = FastjsonUtil.getText(dataObject, "em_name");
|
|
|
tv_dc_emname.setText(de_name);
|
|
|
- stringList.clear();
|
|
|
- String[] split = input.split(",");
|
|
|
- for (int i=0;i<split.length;i++){
|
|
|
- if (!split[i].isEmpty()){
|
|
|
- stringList.add(split[i]);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-// stringList.addAll(Arrays.asList(split));
|
|
|
-// stringList.add(input+",");
|
|
|
-// for (int i=0;i<stringList.size();i++){
|
|
|
-// inputString=stringList.get(i)+",";
|
|
|
-// }
|
|
|
- Log.e("stringList1===",inputString+"");
|
|
|
- setstring.clear();
|
|
|
- setstring.addAll(stringList);
|
|
|
- for (int item = 0;item<setstring.size();item++){
|
|
|
- inputString = setstring+",";
|
|
|
- }
|
|
|
- Log.e("stringList2===",inputString+"");
|
|
|
-// String substring = inputString.toString().substring(0, inputString.toString().length() - 1);//去除尾部
|
|
|
-// String substring1 = substring.substring(1, substring.length());//去除首部
|
|
|
-
|
|
|
- String replace = inputString.replace("[", "");
|
|
|
- String replace1 = replace.replace("]", "");
|
|
|
- inputString=replace1;
|
|
|
-
|
|
|
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){
|
|
|
progressDialog.show();
|