为了账号安全,请及时绑定邮箱和手机立即绑定

The return type is incompatible with ImanagerDao.findOrderInfo(int)错误

The return type is incompatible with ImanagerDao.findOrderInfo(int)错误

Rogerl 2015-11-01 11:48:49
       public Map<Order,Items[]> findOrderInfo(int id){  //将多表查询信息的一记录封装到一个map中      CustomerDaoImp cdi =new CustomerDaoImp();      Map<Order,Items[]> map = new HashMap<Order,Items[]>(20);      Order order =new Order();   //封装订单的头信息      Items[] its  = new Items[20];     //数组装有多个商品,及对应数量。Items有fg,和count属性对应商品和数量      try { PreparedStatement pst =   DbConn.getConnection().prepareStatement("select * from order_info o join Order_goods_1 g on o.id=g.id where o.id=?");     pst.setInt(1, id);     ResultSet rs =pst.executeQuery();     if(rs.next()){     order.setOnum(rs.getString("onum"));     order.setOname(rs.getString("oname"));     order.setOcardnum(rs.getString("ocardnum"));     order.setOaddr(rs.getString("oaddr"));     order.setOphone(rs.getString("ophone"));     order.setCost(rs.getInt("cost"));     order.setTime(rs.getTimestamp("crea_at"));     order.setInfo(rs.getString("oinfo"));     for (int i = 1; i < its.length+1; i++) { //此循环获取数量不是0的商品 Items it =new Items(); byte m =rs.getByte("goods"+i); it.setCount(m); if(m>0){ int j =0; it.getFg().setName(cdi.findNameById(i)); it.getFg().setPrice(cdi.findPriceById(i)); it.getFg().setSpec(cdi.findSpecById(i)); its[j]=it; j++; } }     map.put(order, its);      }      } catch (SQLException e) { System.out.println("com.jdc.dao.ManagerDao.java"); }      return map;       }}
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 5570 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信