你的位置:首页 > 软件开发 > Java > springMVC导入excel案例poi

springMVC导入excel案例poi

发布时间:2016-02-03 16:00:15
直接上代码:第一步,controller 引入 private static final String CHECK_FILE = "checkExceFile";/** * 对账文件导入 * * file 对账excel文件 * provid ...

直接上代码:

第一步,controller 引入

  private static final String CHECK_FILE = "checkExceFile";/**   * 对账文件导入   *   * file 对账excel文件   * providerCode 编号参数   * type 支付类型   *   */  @RequestMapping("preview")  @ResponseBody  public JsonResult preview(@RequestParam("checkFile") MultipartFile file, String providerCode, String type, HttpSession session) {    try {      MandoAssert.notNull(type, "对账类型错误");      MandoAssert.notNull(providerCode, "对账方式未选择");            List<CheckAccount> accountorders = CheckAccountUtil.checkAccount(file, providerCode, type);            JsonResult result = JsonResult.buildSuccessResult(accountorders);      session.setAttribute(CHECK_FILE, accountorders);      return result.setModel("file", session.getId());    } catch (Exception e) {      String mgs = "对账文件解析失败";      return ResponseExceptionMessage.getResponseExceptionMessage(logger, mgs, e);    }  }        List<E> tmpdata = items;        if (items == null) {        CollectionJsonResult result = new CollectionJsonResult();        return result;

原标题:springMVC导入excel案例poi

关键词:Spring

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录