activiti绘制历史流程图

activiti绘制历史流程图

示例

@ResponseBody
@RequestMapping(value = "trace2/photo/{procDefId}/{execId}")
public AjaxJson tracePhoto2(@PathVariable("procDefId") String procDefId, @PathVariable("execId") String execId, HttpServletResponse response) throws Exception {
    
    
	AjaxJson j = new AjaxJson();
	LinkedHashMap<String,Object> mapMode = new LinkedHashMap<String, Object>();
	
	InputStream imageStream = actTaskService.tracePhoto(procDefId, execId);
	byte[] b = new byte[1024];
	int len = -1;
	
	ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();        
	while ((len = imageStream.read(b, 0, 1024)) != -1) {
    
    			
		byteArrayOutputStream.write(b, 0, len);
	}
	byte[] b2 = byteArrayOutputStream.toByteArray();		

	mapMode.put("src", "data:image/png;base64," + EncodeUtil.encodeBase64(b2));
	
	j.setBody(mapMode);
	
	j.setMsg("OK");
	
	return j;
}

SELECT * FROM onsiteptw_todo_view;

http://localhost:8080/apsweb/a/act/task/trace2/photo/onsiteptw:5:573740db4e2b4a148073b9c05854225f/cb194ff53f314e10a9f7d8638ea3b4f6

猜你喜欢

转载自blog.csdn.net/mylearnbox/article/details/114082444
今日推荐