mj94520
微笑向暖mj
采纳率0%
2019-09-06 16:14 阅读 256

已经得到pdf文件地址,怎么用java代码将其转换成压缩包格式,并传给前端?

@RequestMapping("/makeUserWB")
public Response<?> makeUserWB(@RequestParam("userIds")String userIds, @RequestParam("subjectId")int subjectId){

    try {
        String[] us=userIds.split(",");

        List<String> list = new ArrayList<String>();

        for(String userId : us) {
            Long userId1 = DataTypeUtil.toLong(userId);
            String path = wrongBookService.productDateRangPdfA4(userId1, subjectId, null, null, 1);
            list.add(path);
        }

        //如果分割后大于1,打成压缩包
        if(list.size()>1) {

        }else {
            Long userId1 = DataTypeUtil.toLong(userIds);
            String path = wrongBookService.productDateRangPdfA4(userId1, subjectId, null, null, 1);
            return Response.success("生成成功!", path);
        }       
    } catch (Exception e) {
        logger.error("", e);
        return Response.error(e);
    }
    return null;
}

问题已解决,已发表在我的博客中https://blog.csdn.net/mj94520/article/details/101201317

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

相关推荐