public Boolean adduserorder(UserOrder userorder, String orderid) { List<UserOrder> list = userorderDao.queryByOrderid(orderid); if (list.size() < 1) { userorderDao.insert(userorder); } else { } return true; }
@SuppressWarnings({"rawtypes", "unchecked"}) @Override public Base queryOrder(String user_id, Integer startIndex, Integer requestAmount) { // Integer userid = userDao.selectByUid(user_id); List<String> list = userorderDao.queryOrderid(user_id); List<OrderListA> prolist = new ArrayList<OrderListA>(); for (int i = 0; i < list.size(); i++) { OrderListA orderlista = new OrderListA(); String subOrderid = list.get(i); orderlista.setOrderid(subOrderid); List<OrderListB> prelist = ordersDao.queryOrder(user_id, subOrderid); orderlista.setState(prelist.get(0).getState()); orderlista.setAddressid(prelist.get(0).getAddressid()); orderlista.setData(prelist.get(0).getData()); orderlista.setOrderitem(prelist); prolist.add(orderlista); } Base base = new Base(); A a = new A(); a.setSubbranchs(prolist); base.setContent(a); base.setCode(101); base.setResult("Ok"); return base; }
@Override public void changeOrderStatus(String order_no, String pay_time) { List<Orders> ss = ordersDao.checkByOrderid(order_no); for (Orders orders : ss) { String state = "已支付"; ordersDao.updateOrderType(state, orders.getOrderid()); } if (ss.size() == 1) { userorderDao.insertPayTime(pay_time, order_no); } }