/** 未支付订单 */ private void getNoLoginOrder() { Selector selector = Selector.from(SubmittedOrderEntity.class); selector.select(" * "); List<SubmittedOrderEntity> list = Ioc.getIoc().getDb("/sdcard/MTM/", Constants.APP_DATABASE).findAll(selector); if (list != null && list.size() > 0) { initToolBar(); OrdrDetail orderDetail = new OrdrDetail(); Long time = DateUtil.getStartAndEndToTimes( DateUtil.formatDateTime(new Date(), "yyyy-MM-dd HH:mm:ss"), list.get(0).getCreateTime()); orderDetail.setFailureTime(DateUtil.timer(time)); String orderGroupId = ""; String orderGroupNo = ""; for (int i = 0; i < list.size(); i++) { if (Handler_String.isBlank(orderGroupId) || i != (list.size() - 1)) { orderGroupNo += list.get(i).getOrderNo() + ","; orderGroupId += list.get(i).getOrderId() + ","; } else { orderGroupId += list.get(i).getOrderId(); orderGroupNo += list.get(i).getOrderNo(); } } Ioc.getIoc().getLogger().d("订单组id:" + orderGroupId); orderDetail.setOrderIdGroup(orderGroupId); group.add(orderDetail); oca.notifyDataSetChanged(); } }
@Override public View getGroupView( final int groupPosition, boolean isExpanded, View convertView, ViewGroup viewGroup) { if (convertView == null) { viewHolder = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(context); convertView = inflater.inflate(layout_id, null); viewHolder.hotel_order_payState = (TextView) convertView.findViewById(R.id.hotel_order_payState); viewHolder.create_order_date = (TextView) convertView.findViewById(R.id.create_order_date); viewHolder.del_img = (ImageView) convertView.findViewById(R.id.del_img); viewHolder.hotel_order_payState = (TextView) convertView.findViewById(R.id.hotel_order_payState); viewHolder.relative_layout5 = (RelativeLayout) convertView.findViewById(R.id.relative_layout5); viewHolder.hotel_order_detail_down = (ImageView) convertView.findViewById(R.id.hotel_order_detail_down); viewHolder.order_checkBox = (CheckBox) convertView.findViewById(R.id.order_checkBox); viewHolder.order_check_in_date = (TextView) convertView.findViewById(R.id.order_check_in_date); viewHolder.order_heard_show = (TextView) convertView.findViewById(R.id.order_heard_show); viewHolder.hotel_room_type = (TextView) convertView.findViewById(R.id.hotel_room_type); viewHolder.img_footer = (ImageView) convertView.findViewById(R.id.img_footer); viewHolder.order_checkBox.setFocusable(false); viewHolder.order_checkBox.setClickable(true); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } viewHolder.order_checkBox.setButtonDrawable(R.drawable.radio_style); if (isExpanded) { viewHolder.order_checkBox.setChecked(true); viewHolder.img_footer.setVisibility(View.GONE); } else { viewHolder.img_footer.setVisibility(View.VISIBLE); } guestInfos = getNotSubOrderGuest(group.get(groupPosition).getId()); group.get(groupPosition).setGuestInfo(guestInfos); viewHolder.order_checkBox.setTag(group.get(groupPosition)); viewHolder.order_checkBox.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { Ioc.getIoc().getLogger().d("当前选择状态" + viewHolder.order_checkBox.isChecked()); if (!viewHolder.order_checkBox.isChecked()) listView.collapseGroup(groupPosition); } }); viewHolder.order_checkBox.setOnCheckedChangeListener( new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { // 异步传递信息 Message msg = new Message(); Bundle build = new Bundle(); build.putInt("groupPosition", groupPosition); build.putBoolean("isChecked", b); msg.setData(build); handler.sendMessage(msg); } }); viewHolder.del_img.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { cancelOrderConfrim(groupPosition); notifyDataSetChanged(); } }); viewHolder.hotel_order_payState.setText( OrderStateEnum.getOrderStateEnumName(group.get(groupPosition).getOrderState())); viewHolder.hotel_order_payState.setBackgroundResource(R.drawable.order_cancel); viewHolder.create_order_date.setText(DateUtil.formatDateTime(new Date(), "yyyy-MM-dd HH:mm")); // viewHolder.order_check_in_date.setText(group.get(groupPosition).getStartDate() + "至" + // group.get(groupPosition).getEndDate()); // // viewHolder.create_order_date.setText(DateUtil.formatDateTime(group.get(groupPosition).getCreateDateTime(),"yyyy-MM-dd")); System.out.println(group.get(groupPosition).getHotelName()); viewHolder.order_heard_show.setText(group.get(groupPosition).getHotelName()); viewHolder.hotel_room_type.setText(group.get(groupPosition).getRoomName()); return convertView; }