| | |
| | | } |
| | | @RequestMapping(value = "/img/{modelId}", method = RequestMethod.GET) |
| | | public void image(@PathVariable String modelId, HttpServletResponse response) { |
| | | String filePath = basePath + modelId +"/"+ modelId + ".png"; |
| | | File file = new File(filePath); |
| | | FileInputStream fileInputStream = null; |
| | | InputStream is = repositoryService.getModelImg(modelId); |
| | | |
| | | response.setHeader("Content-Type", "image/png"); |
| | | try{ |
| | | fileInputStream = new FileInputStream(file); |
| | | OutputStream outputStream = response.getOutputStream(); |
| | | byte[] b = new byte[1024]; |
| | | int len; |
| | | while ((len = fileInputStream.read(b, 0, 1024)) != -1) { |
| | | while ((len = is.read(b, 0, 1024)) != -1) { |
| | | outputStream.write(b, 0, len); |
| | | } |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | finally { |
| | | if (fileInputStream != null) { |
| | | if (is != null) { |
| | | try { |
| | | fileInputStream.close(); |
| | | is.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | } |
| | | HttpSession session = request.getSession(); |
| | | //todo 判断当前task是否是当前人能审批的 |
| | | |
| | | taskService.setSession(session); |
| | | ActivitiStatus status = flows.getStatus(); |