// 过滤精准未支付订单 private void installData(List<OrdrDetail> list) { if (group != null) group.clear(); else group = new ArrayList<>(); if (null != list) { for (int i = 0; i < list.size(); i++) { OrdrDetail od = list.get(i); // 只获取 精准订单 if ("0".equals(od.getOrderType()) && OrderStateEnum.notPay.getCode().equals(od.getStatus())) { group.add(od); } } } if (group.size() > 0) { initToolBar(); } else { rl_tools.setVisibility(View.GONE); DbUtils db = Ioc.getIoc().getDb("/sdcard/MTM/", Constants.APP_DATABASE); db.deleteAll(SubmittedOrderEntity.class); // 获取当前未支付订单数量 postMsgCount(group.size()); } oca.notifyDataSetChanged(); }
/** 未支付订单 */ 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(); } }