|
|
@@ -136,6 +136,12 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
private RecyclerView rv_datapassqty;
|
|
|
private ArrayList<StorageRechargeAloneBean> passFeededListQty;
|
|
|
private SelectAdapterQty selectAdapterQty;
|
|
|
+ private String sc_codecolleone;
|
|
|
+ private String ma_id;
|
|
|
+ private TextView tv_macode;
|
|
|
+ private String va_codechushihua;
|
|
|
+ private String st_remarkce;
|
|
|
+ private List<String> listce;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -177,6 +183,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
iv_dc_emcode = root.findViewById(R.id.iv_dc_emcode);
|
|
|
rv_datachange = root.findViewById(R.id.rv_datachange);
|
|
|
rv_datapassqty = root.findViewById(R.id.rv_datapassqty);
|
|
|
+ tv_macode = root.findViewById(R.id.tv_macode);
|
|
|
|
|
|
mFilterStorageInBeans = Collections.synchronizedList(new ArrayList<>());
|
|
|
|
|
|
@@ -186,13 +193,14 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
myAdapter = new ComListAdapter(mList);
|
|
|
myAdapter.setmList(mList);
|
|
|
rv_data.setAdapter(myAdapter);
|
|
|
- em_name = SharedPreUtil.getString(mActivity, Constants.FLAG.CACHE_USER_EMNAME,null);
|
|
|
- tv_em_name.setText("人员名称:"+ em_name);
|
|
|
+ em_name = SharedPreUtil.getString(mActivity, Constants.FLAG.CACHE_USER_EMCODE,null);
|
|
|
+ tv_em_name.setText("人员编号:"+ em_name);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void initDatas() {
|
|
|
+ resourcesBeanList = new ArrayList<>();
|
|
|
WindowManager wm = mActivity.getWindowManager();
|
|
|
int screenWith = wm.getDefaultDisplay().getWidth()/3;
|
|
|
mSmartTable.getConfig().setMinTableWidth(screenWith)
|
|
|
@@ -271,6 +279,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
et_linecode_smts.requestFocus();
|
|
|
}
|
|
|
});
|
|
|
+ linecodeBeanList = new ArrayList<>();
|
|
|
iv_popuwindow.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
@@ -322,6 +331,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
|
|
|
}
|
|
|
});
|
|
|
+ ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(resourcesBeanList);
|
|
|
iv_resources.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
@@ -390,7 +400,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
getNewData();
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+ ipAndunhealthyPortAdapter = new IpAndunhealthyPortAdapter(resourcesBeanList);
|
|
|
tv_dc_emcode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
@Override
|
|
|
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
@@ -424,6 +434,23 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+ sc_codecolleone = SharedPreUtil.getString(mActivity, "sc_codecolleone", null);
|
|
|
+ ce_resources.setText(sc_codecolleone);
|
|
|
+ tv_station.setText(sc_codecolleone);
|
|
|
+ va_codechushihua = ce_resources.getText().toString().trim();
|
|
|
+ listce = new ArrayList<>();
|
|
|
+ getfuzzySearchSourceData(va_codechushihua,"不良");
|
|
|
+// for (int i=0;i<resourcesBeanList.size();i++){
|
|
|
+// st_remarkce = resourcesBeanList.get(i).getST_REMARK();
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
private void handleFeededDataTwo(JSONArray dataArray) {
|
|
|
StorageRechargeAloneBean bean;
|
|
|
@@ -516,6 +543,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
LogUtil.i("mList", JSON.toJSONString(mList));
|
|
|
selectAdapter = new SelectAdapter(mList);
|
|
|
rv_datachange.setAdapter(selectAdapter);
|
|
|
+ selectAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
|
|
|
private class ComDataBean{
|
|
|
@@ -661,7 +689,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
}
|
|
|
@Override
|
|
|
protected void convert(BaseViewHolder helper, LinecodeBean item) {
|
|
|
- helper.setText(R.id.macode_ip__Tv,item.getMA_CODE()+"-"+item.getPR_CODE()+"-"+item.getPR_DETAIL());
|
|
|
+ helper.setText(R.id.macode_ip__Tv,item.getMA_ID()+"-"+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);
|
|
|
@@ -768,6 +796,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
bean.setMA_CODE(data.getString("MA_CODE"));
|
|
|
bean.setPR_CODE(data.getString("PR_CODE"));
|
|
|
bean.setPR_DETAIL(data.getString("PR_DETAIL"));
|
|
|
+ bean.setMA_ID(data.getString("MA_ID"));
|
|
|
|
|
|
linecodeBeanList.add(bean);
|
|
|
}
|
|
|
@@ -846,16 +875,32 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
for(Object index:dataArrayone){
|
|
|
JSONObject data = (JSONObject) index;
|
|
|
String st_remark = data.getString("ST_REMARK");
|
|
|
- if (st_remark.contains("|")){
|
|
|
- String[] split = st_remark.split("\\|");
|
|
|
- for (int i=0;i<split.length;i++){
|
|
|
- ResourcesBean bean = new ResourcesBean();
|
|
|
- bean.setST_REMARK(split[i]);
|
|
|
- resourcesBeanList.add(bean);
|
|
|
- }
|
|
|
+ if (!StringUtil.isEmpty(st_remark)){
|
|
|
+ if (st_remark.contains("|")){
|
|
|
+ String[] split = st_remark.split("\\|");
|
|
|
+ for (int i=0;i<split.length;i++){
|
|
|
+ ResourcesBean bean = new ResourcesBean();
|
|
|
+ bean.setST_REMARK(split[i]);
|
|
|
+ resourcesBeanList.add(bean);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
+ JSONObject jsonObjectce = new JSONObject();
|
|
|
+ JSONArray jsonArrayce = new JSONArray();
|
|
|
+ JSONObject object_1ce = new JSONObject();
|
|
|
+ for (int i = 0; i< resourcesBeanList.size(); i++){
|
|
|
+ StorageRechargeAloneBean bean=new StorageRechargeAloneBean(resourcesBeanList.get(i).getST_REMARK());
|
|
|
+ object_1ce.put("alone", resourcesBeanList.get(i).getST_REMARK());
|
|
|
+ Log.e("listce===",resourcesBeanList.get(i).getST_REMARK()+"!");
|
|
|
+ jsonArrayce.add(bean);
|
|
|
}
|
|
|
+
|
|
|
+ jsonObjectce.put("formStore", jsonArrayce);
|
|
|
+ JSONArray dataArrayce = FastjsonUtil.getJSONArray(jsonObjectce.toString(), "formStore");
|
|
|
+ handleFeededData(dataArrayce);
|
|
|
ipAndunhealthyPortAdapter.setmList(resourcesBeanList);
|
|
|
ipAndunhealthyPortAdapter.notifyDataSetChanged();
|
|
|
}else {
|
|
|
@@ -960,7 +1005,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
}
|
|
|
String ec_passqtytrim;
|
|
|
public void getNewData(){
|
|
|
- String ce_work_codetrim = et_linecode_smts.getText().toString().trim();
|
|
|
+ String ce_work_codetrim = tv_macode.getText().toString().trim();
|
|
|
String at_stationtrim = ce_resources.getText().toString().trim();
|
|
|
String ce_bit_numbertrim = ce_bit_number.getText().toString().trim();
|
|
|
if (ce_bit_numbertrim.isEmpty()){
|
|
|
@@ -1010,7 +1055,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
public void onSuccess(int flag, Object o) throws Exception {
|
|
|
progressDialog.dismiss();
|
|
|
CommonUtil.toastYESRepeat(mActivity, "保存成功");
|
|
|
- getTestcollectdata(et_linecode_smts.getText().toString().trim(),ce_resources.getText().toString().trim());
|
|
|
+ getTestcollectdata(tv_macode.getText().toString().trim(),ce_resources.getText().toString().trim());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -1027,7 +1072,7 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
* 关于工单号弹框
|
|
|
*/
|
|
|
private void initlinecodePopupWindow() {
|
|
|
- linecodeBeanList = new ArrayList<>();
|
|
|
+
|
|
|
ipAndlinecodePortAdapter = new IpAndlinecodePortAdapter(linecodeBeanList);
|
|
|
View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_edit_pup, null);
|
|
|
edit_et = (ClearableEditText) contView.findViewById(R.id.edit_et);
|
|
|
@@ -1062,12 +1107,15 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
});
|
|
|
|
|
|
ipAndlinecodePortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
List<LinecodeBean> ipAndPortBeans = ipAndlinecodePortAdapter.getmList();
|
|
|
ma_code = ipAndPortBeans.get(position).getMA_CODE();
|
|
|
pr_code = ipAndPortBeans.get(position).getPR_CODE();
|
|
|
pr_detail = ipAndPortBeans.get(position).getPR_DETAIL();
|
|
|
+ ma_id = ipAndPortBeans.get(position).getMA_ID();
|
|
|
for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
ipAndPortBeans.get(i).setChecked(false);
|
|
|
}
|
|
|
@@ -1081,9 +1129,10 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
sure_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- et_linecode_smts.setText(ma_code);
|
|
|
+ et_linecode_smts.setText(ma_id);
|
|
|
tv_pr_code.setText("产品编号 "+pr_code);
|
|
|
tv_pr_detail.setText("产品名称 "+pr_detail);
|
|
|
+ tv_macode.setText(""+ma_code);
|
|
|
closeListPopupWindow();
|
|
|
}
|
|
|
});
|
|
|
@@ -1153,8 +1202,8 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
* 关于岗位资源弹框
|
|
|
*/
|
|
|
private void initresourcesPopupWindow() {
|
|
|
- resourcesBeanList = new ArrayList<>();
|
|
|
- ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(resourcesBeanList);
|
|
|
+
|
|
|
+
|
|
|
View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_edit_pup, null);
|
|
|
edit_et = (ClearableEditText) contView.findViewById(R.id.edit_et);
|
|
|
TextView sure_tv = (TextView) contView.findViewById(R.id.sure_tv);
|
|
|
@@ -1209,6 +1258,10 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
public void onClick(View v) {
|
|
|
list.clear();
|
|
|
ce_resources.setText(sc_code);
|
|
|
+ if (!StringUtil.isEmpty(sc_code)){
|
|
|
+ SharedPreUtil.saveString(mActivity,"sc_codecolleone",sc_code);
|
|
|
+ }
|
|
|
+
|
|
|
tv_station.setText("当前岗位:"+sc_code);
|
|
|
if (!StringUtil.isEmpty(st_remark)){
|
|
|
if (st_remark.contains("|")){
|
|
|
@@ -1217,22 +1270,19 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
}else {
|
|
|
list.add(st_remark);
|
|
|
}
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- JSONArray jsonArray = new JSONArray();
|
|
|
- JSONObject object_1 = new JSONObject();
|
|
|
- for (int i=0;i<list.size();i++){
|
|
|
- StorageRechargeAloneBean bean=new StorageRechargeAloneBean(list.get(i));
|
|
|
- object_1.put("alone", list.get(i));
|
|
|
- jsonArray.add(bean);
|
|
|
- }
|
|
|
-
|
|
|
- jsonObject.put("formStore", jsonArray);
|
|
|
- Log.e("alone===2",jsonObject.toString());
|
|
|
-
|
|
|
- JSONArray dataArray = FastjsonUtil.getJSONArray(jsonObject.toString(), "formStore");
|
|
|
- handleFeededData(dataArray);
|
|
|
+ }
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ JSONObject object_1 = new JSONObject();
|
|
|
+ for (int i=0;i<list.size();i++){
|
|
|
+ StorageRechargeAloneBean bean=new StorageRechargeAloneBean(list.get(i));
|
|
|
+ object_1.put("alone", list.get(i));
|
|
|
+ jsonArray.add(bean);
|
|
|
}
|
|
|
|
|
|
+ jsonObject.put("formStore", jsonArray);
|
|
|
+ JSONArray dataArray = FastjsonUtil.getJSONArray(jsonObject.toString(), "formStore");
|
|
|
+ handleFeededData(dataArray);
|
|
|
|
|
|
|
|
|
closeListPopupWindow();
|
|
|
@@ -1301,134 +1351,6 @@ public class DataCollectionFragment extends BaseFragment implements View.OnClick
|
|
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 关于不良现象弹框
|
|
|
- */
|
|
|
- private void initunhealthyPopupWindow() {
|
|
|
- resourcesBeanList = new ArrayList<>();
|
|
|
- ipAndunhealthyPortAdapter = new IpAndunhealthyPortAdapter(resourcesBeanList);
|
|
|
- View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_edit_pup, 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);
|
|
|
-
|
|
|
- RecyclerView rv_ip_port_data = contView.findViewById(R.id.rv_ip_port_data);
|
|
|
- rv_ip_port_data.addItemDecoration(new DividerItemDecoration(mActivity, LinearLayout.VERTICAL));
|
|
|
- rv_ip_port_data.setLayoutManager(new LinearLayoutManager(mActivity));
|
|
|
- ipAndunhealthyPortAdapter.setmList(resourcesBeanList);
|
|
|
- rv_ip_port_data.setAdapter(ipAndunhealthyPortAdapter);
|
|
|
- getfuzzySearchSourceData(ce_resources.getText().toString().trim(),"不良");
|
|
|
-
|
|
|
- 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);
|
|
|
- search_im.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- getfuzzySearchSourceData(ce_resources.getText().toString().trim(),"不良");
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- ipAndunhealthyPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
- List<ResourcesBean> ipAndPortBeans = ipAndunhealthyPortAdapter.getmList();
|
|
|
- st_remark = ipAndPortBeans.get(position).getST_REMARK();
|
|
|
-
|
|
|
- for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
- ipAndPortBeans.get(i).setChecked(false);
|
|
|
- }
|
|
|
- ipAndPortBeans.get(position).setChecked(true);
|
|
|
- ipAndunhealthyPortAdapter.notifyDataSetChanged();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- //确定
|
|
|
- sure_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- closeListPopupWindow();
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- //取消
|
|
|
- cancle_tv.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
-
|
|
|
- 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 (resourcesBeanList.isEmpty()){
|
|
|
- getfuzzySearchSourceData(ce_resources.getText().toString().trim(),"不良");
|
|
|
- }
|
|
|
- if (s.length() >= 0) {
|
|
|
- String mSearchStr = s.toString().trim();
|
|
|
- LogUtil.i("mSearchStr",mSearchStr);
|
|
|
- List<ResourcesBean> thisList = new ArrayList<>();
|
|
|
- for(int i=0;i<resourcesBeanList.size();i++){
|
|
|
- if (!StringUtil.isEmpty(resourcesBeanList.get(i).getST_REMARK())){
|
|
|
- if(resourcesBeanList.get(i).getST_REMARK().contains(mSearchStr)){
|
|
|
- thisList.add(resourcesBeanList.get(i));
|
|
|
- }
|
|
|
- if(i == resourcesBeanList.size() -1){
|
|
|
- ipAndunhealthyPortAdapter = new IpAndunhealthyPortAdapter(thisList);
|
|
|
- rv_ip_port_data.setAdapter(ipAndunhealthyPortAdapter);
|
|
|
- LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- ipAndunhealthyPortAdapter.notifyDataSetChanged();
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- ipAndunhealthyPortAdapter = new IpAndunhealthyPortAdapter(resourcesBeanList);
|
|
|
- rv_ip_port_data.setAdapter(ipAndunhealthyPortAdapter);
|
|
|
-
|
|
|
- }
|
|
|
- ipAndunhealthyPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
|
|
- @Override
|
|
|
- public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
|
|
- List<ResourcesBean> ipAndPortBeans = ipAndunhealthyPortAdapter.getmList();
|
|
|
- for (int i = 0; i < ipAndPortBeans.size(); i++) {
|
|
|
- ipAndPortBeans.get(i).setChecked(false);
|
|
|
- }
|
|
|
- ipAndPortBeans.get(position).setChecked(true);
|
|
|
- ipAndunhealthyPortAdapter.notifyDataSetChanged();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public class SelectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
|
|
private int checkedPosition = -1;
|
|
|
private boolean onBind;
|