泛微E9-流程附件、签字意见、请求工具类 节点 Action 获取流程信息StringstrRequestIDrequest.getRequestid();StringstrTableNamerequest.getRequestManager().getBillTableName();intstrFormidrequest.getRequestManager().getFormid();RecordSetrsnewRecordSet();if(strTableNamenull||.equals(strTableName)){rs.executeQuery(select tablename from workflow_bill where id strFormid);if(rs.next()){strTableNameUtil.null2String(rs.getString(tablename));}log.error(非手动提交,通过formid获取表单idstrFormid表单名称strTableName);}获取流程附件基本信息RecordSetrsFilenewRecordSet();Stringsql SELECT t1.imagefilename,t1.imagefileid FROM ImageFile t1 LEFT JOIN DocImageFile t2 ON t1.imagefileid t2.imagefileid WHERE t2.docid IN (fj) AND t2.versionId ( SELECT MAX( t3.versionId ) FROM DocImageFile t3 WHERE t3.id t2.id );rsFile.executeQuery(sql);while(rsFile.next()){StringimagefilenameUtil.null2String(rsFile.getString(imagefilename));if(!.equals(imagefilename)){String[]splitimagefilename.split(\\.);Stringfilenamesplit[0];Stringfiletypesplit[split.length-1];StringimagefileidUtil.null2String(rsFile.getString(imagefileid));if(!imagefileid.equals()){InputStreamfileStreamgetInputStreamById(Integer.parseInt(imagefileid));ByteArrayOutputStreambyteArrayOutputStreamnewByteArrayOutputStream();byte[]buffernewbyte[1024];intlength;while((lengthfileStream.read(buffer))!-1){byteArrayOutputStream.write(buffer,0,length);}byte[]fileBytesbyteArrayOutputStream.toByteArray();Stringbase64StringBase64.getEncoder().encodeToString(fileBytes);JSONObjectfilenewJSONObject();file.put(fileType,filetype);file.put(fileName,filename);file.put(file,base64String);files.add(file);}}}获取签字意见信息RecordSetrsqzyjnewRecordSet();rsqzyj.executeQuery( select t2.nodename, t3.lastname, t3.workcode, t1.operatedate, t1.operatetime, t1.remark from workflow_requestlog t1, workflow_nodebase t2, hrmresource t3 where t1.requestid ? and t1.nodeid t2.id and t1.operator t3.id order by t1.operatedate, t1.operatetime desc,strRequestID);while(rsqzyj.next()){StringnodenameUtil.null2String(rsqzyj.getString(nodename));StringworkcodeUtil.null2String(rsqzyj.getString(workcode));StringlastnameUtil.null2String(rsqzyj.getString(lastname));StringoperatedateUtil.null2String(rsqzyj.getString(operatedate));StringremarkUtil.null2String(rsqzyj.getString(remark));JSONObjecttempnewJSONObject();temp.put(signName,nodename);temp.put(userid,workcode);temp.put(userName,lastname);temp.put(signDate,operatedate);temp.put(signRemark,remark);signInfo.add(temp);}获取流程下拉框的显示内容/** * 获取下拉框的显示内容 * * param fieldName 字段数据库名 * param fieldValue 字段值 * return 显示的内容 */publicstaticStringgetShowName(StringfieldName,StringfieldValue){RecordSetrecordSetnewRecordSet();recordSet.executeQuery(SELECT selectname FROM workflow_selectitem s,workflow_billfield b WHERE b.id s.fieldid and b.billid -1470 AND b.fieldname fieldName AND s.selectvalue fieldValue);recordSet.next();returnUtil.null2String(recordSet.getString(1));}常用发送请求工具类packagecom.weavernorth.xxg.utils;importorg.apache.commons.logging.Log;importorg.apache.commons.logging.LogFactory;importorg.apache.http.HttpEntity;importorg.apache.http.HttpResponse;importorg.apache.http.NameValuePair;importorg.apache.http.client.HttpClient;importorg.apache.http.client.entity.UrlEncodedFormEntity;importorg.apache.http.client.methods.HttpGet;importorg.apache.http.client.methods.HttpPost;importorg.apache.http.entity.StringEntity;importorg.apache.http.impl.client.HttpClients;importorg.apache.http.message.BasicNameValuePair;importorg.apache.http.util.EntityUtils;importjava.io.*;importjava.net.HttpURLConnection;importjava.net.URL;importjava.nio.charset.StandardCharsets;importjava.util.ArrayList;importjava.util.List;importjava.util.Map;SuppressWarnings(all)publicclassHttpRequestUtil{privatefinalstaticLoglogLogFactory.getLog(HttpRequestUtil.class);// 发送 GET 请求publicstaticStringsendGetRequest(Stringurl)throwsIOException{HttpClienthttpClientHttpClients.createDefault();HttpGethttpGetnewHttpGet(url);HttpResponseresponsehttpClient.execute(httpGet);HttpEntityentityresponse.getEntity();returnEntityUtils.toString(entity);}// 发送 POST 请求表单数据格式application/x-www-form-urlencodedpublicstaticStringsendPostFormUrlEncodedRequest(Stringurl,MapString,Stringparams)throwsIOException{HttpClienthttpClientHttpClients.createDefault();HttpPosthttpPostnewHttpPost(url);httpPost.setHeader(Content-Type,application/x-www-form-urlencoded);ListNameValuePairformParamsnewArrayList();for(Map.EntryString,Stringentry:params.entrySet()){formParams.add(newBasicNameValuePair(entry.getKey(),entry.getValue()));}httpPost.setEntity(newUrlEncodedFormEntity(formParams));HttpResponseresponsehttpClient.execute(httpPost);HttpEntityentityresponse.getEntity();returnEntityUtils.toString(entity);}// 发送 POST 请求JSON 数据格式publicstaticStringsendPostJsonRequest(Stringurl,StringjsonData)throwsIOException{HttpClienthttpClientHttpClients.createDefault();HttpPosthttpPostnewHttpPost(url);httpPost.setHeader(Content-Type,application/json);httpPost.setEntity(newStringEntity(jsonData));HttpResponseresponsehttpClient.execute(httpPost);HttpEntityentityresponse.getEntity();returnEntityUtils.toString(entity);}}