Example #1
0
 public void orderTest3() {
   Customer customer = customerDAO.getCustomerById(2);
   List list = orderService.getOrdersByUsername(customer.getUsername());
   System.out.println("List size :" + list.size());
   for (Object obj : list) {
     System.out.println(obj);
   }
 }
Example #2
0
 public void orderTest() {
   Customer customer = customerDAO.getCustomerById(3);
   List<Commodity> commodityList = commoDAO.getCommoditiesByIdString("2;3;4");
   List<OrderCommodityRel> relationLsit = CommodityListTools.commoToRel(commodityList);
   Order order = new Order(customer, relationLsit, 100);
   Map<Integer, Integer> map = new HashMap<Integer, Integer>();
   map.put(2, 2);
   map.put(3, 4);
   map.put(4, 4);
   order.setBuyNum(map);
   Date date = new Date();
   order.setOrderTime(new Timestamp(date.getTime()));
   orderDAO.createOrder(order);
   System.out.println(order.getOrderId());
 }
Example #3
0
 public void testGetCustomerById() {
   List list = (List) customerDAO.getCustomerById(1);
   Customer cus = (Customer) list.get(0);
   assertEquals("赵小明", cus.getUsername());
 }
Example #4
0
 public void partialObjectQuery3() {
   List<GenderStatDTO> dtoList = customerDAO.getGenderStat();
   for (GenderStatDTO purchaseDTO : dtoList) {
     System.out.println(purchaseDTO);
   }
 }
Example #5
0
 public void partialObjectQuery2() {
   List<CityStatDTO> dtoList = customerDAO.getCityStat();
   for (CityStatDTO purchaseDTO : dtoList) {
     System.out.println(purchaseDTO);
   }
 }