getCurrentNodeType.jsp
3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<%--
Created by IntelliJ IDEA.
User: zhaiyaqi
Date: 2020/3/15
Time: 7:34 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page import="com.alibaba.fastjson.JSON" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="org.apache.commons.logging.Log" %>
<%@ page import="org.apache.commons.logging.LogFactory" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.io.ByteArrayOutputStream" %>
<%@ page import="java.io.InputStream" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="com.alibaba.fastjson.JSONArray" %>
<%@ page import="weaver.conn.RecordSetDataSource" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="kry.sql.util.StringUtil" %>
<%@ page import="java.util.Collections" %>
<%@ page import="emo.macro.ob.OB" %>
<%@ page import="java.util.Vector" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
response.setContentType("application/json;charset=utf-8");
out.clear();
writeLog("【开始调用调拨获取当前节点接口】:");
JSONObject result = new JSONObject(true);
result.put("code", -1);
String nodeId = null;
try {
nodeId = request.getParameter("nodeId");
writeLog("接收参数: nodeId:"+nodeId);
if (nodeId.equals("")){
result.put("message", "传递参数为空");
out.print(result.toJSONString());
return ;
}
} catch (Exception e) {
e.printStackTrace();
result.put("message", "获取参数异常");
out.print(result.toJSONString());
return;
}
RecordSet rs = new RecordSet();
String sql= "";
sql = "select NODETYPE as nodeType from workflow_flownode where NODEID = '"+nodeId+"'";
rs.execute(sql);
while (rs.next()){
String nodeType = rs.getString("nodeType");
writeLog("节点信息 nodeType = "+nodeType);
result.put("code", 0);
result.put("message", "获取节点信息成功");
result.put("nodeType", nodeType);
out.print(result.toJSONString());
}
%>
<%!
private void writeLog(Object o) {
Log var3 = LogFactory.getLog(this.getClass().getName());
if(o instanceof Exception) {
var3.info(this.getClass().getName(), (Exception)o);
} else {
var3.info(o);
}
}
/**
* 组装完整对象
* @param columnNames
* @param array
* @return
*/
public JSONObject getCompleteObject(String[] columnNames,JSONArray array){
JSONObject object = new JSONObject();
for (int j=0;j<array.size();j++){
object.put(columnNames[j],array.get(j));
}
return object;
}
private String getGDZCKPH(String id) {
if (id.equals("")) {
return "";
}
RecordSetDataSource rsds = new RecordSetDataSource("HERP");
String sql;
sql = "select GDZCKPH from UF_GDZCB where id=" + id;
rsds.execute(sql);
rsds.next();
return Util.null2String(rsds.getString("GDZCKPH"));
}
private String getLastName(String id) {
RecordSet rs = new RecordSet();
String sql;
sql = "select lastname from hrmresource where id=" + id;
rs.execute(sql);
rs.next();
return Util.null2String(rs.getString(1));
}
private byte[] readInputStream(InputStream inStream) throws Exception {
ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
boolean var3 = false;
int len;
while((len = inStream.read(buffer)) != -1) {
outSteam.write(buffer, 0, len);
}
outSteam.close();
inStream.close();
return outSteam.toByteArray();
}
%>