| | |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.RoleRepository; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import me.zhengjie.utils.ObjectUtil; |
| | | import me.zhengjie.utils.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.File; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | // 发起通信 |
| | | api.post(flowableUrl + "/api/common/next?processInstanceId=" + processInstanceId, paramsMap); |
| | | } |
| | | |
| | | /** |
| | | * 流程图 |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void processDiagram(HttpServletRequest request, HttpServletResponse response, String processInstanceId) throws Exception { |
| | | // 发起通信 |
| | | byte[] obj = api.postStream(flowableUrl + "/api/common/processDiagram?processInstanceId=" + processInstanceId, new HashMap<>()); |
| | | // 输入流 |
| | | InputStream in = new ByteArrayInputStream(obj); |
| | | // inputStream 转 File |
| | | File file = FileUtil.inputStreamToFile(in, "流程图-" + new Date().getTime() + ".jpeg"); |
| | | // 下载文件 |
| | | FileUtil.downloadFile(request, response, file, true); |
| | | } |
| | | } |