예제 #1
0
 // 处理用户点击的搜索到的列表,SearchItem
 private void disposeSearchListItemClick(int position) {
   // 获取点击的备料单/制造单/产线ID
   Mpcode.Message searchSelectedItem = searchItemList.get(position);
   switch (searchType) {
       // 备料单
     case SEARCH_TYPE_PREPARE:
       searchSelectedItemId = searchSelectedItem.getMp_code();
       break;
       // 制造单
     case SEARCH_TYPE_MAKECODE:
       searchSelectedItemId = searchSelectedItem.getMp_makecode();
       break;
       // 产线
     case SEARCH_TYPE_LINECODE:
       searchSelectedItemId = searchSelectedItem.getMp_linecode();
       break;
   }
   searchEditText.setText(searchSelectedItemId);
   // 跳转到采集页面
   gotoCollectPrepareFragment(searchSelectedItem);
 }
예제 #2
0
 // 查找本地备料单
 private void findPrepareInvoice(String aimStr, int size) {
   Log.e("SCMake:find", "findtype:" + searchType);
   Log.e("SCMake:find", "size:" + size);
   searchItemList.removeAll(searchItemList);
   String tmpSourceMp;
   switch (searchType) {
       // 根据备料单号搜索
     case SEARCH_TYPE_PREPARE:
       for (Mpcode.Message m : prepareDataList) {
         // 转换成小写比对
         tmpSourceMp = m.getMp_code().substring(0, size).toLowerCase();
         Log.e("SCMake:find", "substring:" + tmpSourceMp);
         if (tmpSourceMp.equals(aimStr)) {
           Log.e("SCMake:find", "find:" + aimStr);
           searchItemList.add(m);
         }
       }
       break;
       // 根据制造单号搜索
     case SEARCH_TYPE_MAKECODE:
       for (Mpcode.Message m : prepareDataList) {
         // 转换成小写比对
         // 源数据字符串长度<查找长度?
         String tmpMC = m.getMp_makecode();
         if (tmpMC.length() < size) {
           Log.e("SCMake:find", "源数据字符串长度<查找长度?");
           continue;
         }
         tmpSourceMp = tmpMC.substring(0, size).toLowerCase();
         Log.e("SCMake:find", "substring:" + tmpSourceMp);
         if (tmpSourceMp.equals(aimStr)) {
           Log.e("SCMake:find", "find:" + aimStr);
           searchItemList.add(m);
         }
       }
       break;
       // 根据产线线别搜索
     case SEARCH_TYPE_LINECODE:
       for (Mpcode.Message m : prepareDataList) {
         // 转换成小写比对
         tmpSourceMp = m.getMp_linecode().substring(0, size).toLowerCase();
         Log.e("SCMake:find", "substring:" + tmpSourceMp);
         if (tmpSourceMp.equals(aimStr)) {
           Log.e("SCMake:find", "find:" + aimStr);
           searchItemList.add(m);
         }
       }
       break;
   }
   // 通知数据源发生变化
   NotifyDataChanged(NOTICE_SEARCH_ADAPTER);
 }