| | |
| | | response.setContentType("APPLICATION/OCTET-STREAM"); |
| | | response.setHeader("Content-Disposition","attachment; filename=" + URLEncoder.encode("二维码", "UTF-8") + ".zip"); |
| | | ZipOutputStream out = new ZipOutputStream(response.getOutputStream()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | for(Map<String, Object> map : list){ |
| | | String id = map.get("id").toString(); |
| | | String isStudent = map.get("isStudent").toString(); |
| | | String name = map.get("name").toString(); |
| | | QRCodeUtils.encode("{\"id\":" + id + ",\"isStudent\":" + isStudent + "}", name, "/usr/playpai/qrcode", false); |
| | | String name = map.get("name").toString() + sdf.format(new Date()); |
| | | String content = "{\"id\":" + id + ",\"isStudent\":" + isStudent + "}"; |
| | | QRCodeUtils.encode(content, name, "/usr/playpai/qrcode", false); |
| | | File file = new File("/usr/playpai/qrcode/" + name + ".jpg"); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | |