我刚进公司一个星期,然后丢了一个明细报表功能,还有导出execle功能给我做。
然后,现在我想请教下各位大神,这个明细表(统计报表)功能使用java怎么来实现,我实在是一头雾水,不知道该怎么开始做,数据表没有,只有一些基础资料的表,实体类更加没有,因为还没有数据表嘛。公司里的同事都说简单,可我才进来几天,和他们做了最少2年以上的怎么比,哎哟喂,现在我都不好意思问他们了。
业务就是(进销存系统):
        做饭堂管理系统的每日入库明细表,就是查询出每日饭堂的原料(配料)入库明细,就是购买了什么配料进仓库的明细功能。我不知道你们看懂了没,反正我是还没懂,我就连思路都没有,干坐了一个早上,不知道怎么做什么好!!处于一个异常尴尬的地位。有木有大神救救小菜菜啊~

解决方案 »

  1.   

    我是这么想的   不懂对不对.   首先前台要绘制一张execle表  供食堂录入数据,   然后你要在数据库建张与子对应的表,并用代码实现将前台表中数据自动录入你的数据库表中,,,接下来就是要能够查询输出表内容  
      

  2.   

    不涉及到nosql  就是一个sql查询展示列表的事   导出的话你们系统肯定有,没有就用poi,基本上是会有相关导出的功能,复制过来改改的事儿
      

  3.   

    我现在就在学poi。。因为只有这个还懂是什么,可能是我的基础比较差把,现在刚学这个poi导出有点吃力,毕竟我是半路出家的。
      

  4.   

    try {
    Map paramMap = (HashMap) ((HashMap)formMap).clone();
    pageSize = 1000000000;
    pageNo = (this.getPage()== 0 ? pageNo : this.getPage());
    HttpServletResponse response = ServletActionContext.getResponse();
    response.reset();
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    HSSFWorkbook wb =new HSSFWorkbook();
    HSSFSheet sheet= wb.createSheet("材料价格表");
    HSSFRow headRow = sheet.createRow(0);
    ExportUtils.setNormalRowContent(wb, headRow, "编码","名称","规格型号","单位","不含税价格","含税价格","税率","项目名字","项目所在地","供应商","报价日期","备注");
    ExportUtils.setRowStyle(wb,headRow,12,Font.BOLDWEIGHT_BOLD);
    HSSFRow row = sheet.createRow(1);
    int i=2;
    List<SatMaterialPriceDatabase> findAll = satMaterialPriceDatabaseMng.findByCondition(paramMap, pageNo, pageSize);
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");

    CellStyle cellStyle = wb.createCellStyle();
    cellStyle.setWrapText(true); //自动换行
    cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框  
    cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框  
    cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框  
    cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框  
    cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 水平居中  
    cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中
    for (SatMaterialPriceDatabase mPrice : findAll) {
    String format ="";
    try {
    format = simpleDateFormat.format(mPrice.getBjDate());
    } catch (Exception e) {
    }
     String province = mPrice.getProjPlaceProvince();
     String city = mPrice.getProjPlaceCity();
     String dd="";
     try {
     dd=sysDataMng.getNameByNode(province)+"-"+sysDataMng.getNameByNode(city);
    } catch (Exception e) {

    }
    ExportUtils.setNormalRowContentNoStyle(wb, row,cellStyle,mPrice.getMateCore()==null?"":mPrice.getMateCore(),mPrice.getMateName()==null?"":mPrice.getMateName(),
    mPrice.getMateModel()==null?"":mPrice.getMateModel(),mPrice.getUnit()==null?"":mPrice.getUnit(),
    mPrice.getBhsPrice()==null?"":mPrice.getBhsPrice(),mPrice.getHsPrice()==null?"":mPrice.getHsPrice()==null?"":mPrice.getHsPrice()==null?"":mPrice.getHsPrice(),mPrice.getTaxRate()==null?"":
    mPrice.getTaxRate(),mPrice.getProjName()==null?"":mPrice.getProjName(),dd==null?"":dd,mPrice.getSupplier()==null?"":mPrice.getSupplier(),format==null?"":format,mPrice.getMemo()==null?"":mPrice.getMemo()==null?"":mPrice.getMemo());
    row = sheet.createRow(i);
    i++;
    }
    sheet.autoSizeColumn((short)0); 
    sheet.autoSizeColumn((short)1); 
    sheet.autoSizeColumn((short)2); 
    sheet.autoSizeColumn((short)3); 
    sheet.autoSizeColumn((short)4); 
    sheet.autoSizeColumn((short)5); 
    sheet.autoSizeColumn((short)6); 
    sheet.autoSizeColumn((short)7); 
    sheet.autoSizeColumn((short)8); 
    sheet.autoSizeColumn((short)9); 
    sheet.autoSizeColumn((short)10); 
    sheet.autoSizeColumn((short)11); 
    sheet.autoSizeColumn((short)12); 
    //ExportUtils.setAllRowHeight(sheet);
    wb.write(output);
    byte[] ba = output.toByteArray();
    excelFile = new ByteArrayInputStream(ba);
    output.flush();
    output.close();
    String downloadFileName = new String("材料价格表.xls".getBytes(),"ISO8859-1");
    resultMap.put("fileName", downloadFileName);
    } catch (Exception e) {
    e.printStackTrace();
    }
    return SUCCESS;
      

  5.   

    看你用什么实现界面和功能了,现在都是分开的,界面不大用Java的。
      

  6.   

    我觉得是要问明白,明细表要保存什么信息。如果没有明细表就要自己根据需要设计一张表,然后在增加实体,和导出Excel功能
      

  7.   

    导出excel功能,项目有就仔细看看,没有的话去git上找拉个开源的,重点是自己研究下要产出那些数据字段,配置一下就行!