ComponentList.jsp
16.4 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<%@ page language="java" contentType="application/json" pageEncoding="UTF-8"%>
<%@ page import="java.net.*"%>
<%@ page import="net.sf.json.*"%>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.commons.lang.*" %>
<%@ page import="org.apache.commons.codec.binary.Base64"%>
<%@ page import="weaver.general.*" %>
<%@ page import="weaver.file.*" %>
<%@ page import="weaver.hrm.*" %>
<%@ page import="weaver.conn.*"%>
<%@ page import="weaver.docs.news.*"%>
<%@page import="weaver.workflow.workflow.WorkflowVersion"%>
<%@page import="weaver.mobile.plugin.ecology.service.AuthService"%>
<%@page import="weaver.mobile.plugin.ecology.service.DocumentService"%>
<%@ page import="weaver.systeminfo.SystemEnv" %>
<jsp:useBean id="ps" class="weaver.mobile.plugin.ecology.service.PluginServiceImpl" scope="page" />
<%
response.setContentType("application/json;charset=UTF-8");
FileUpload fu = new FileUpload(request);
String module = Util.null2String(fu.getParameter("module"));
String scope = Util.null2String(fu.getParameter("scope"));
String detailid = Util.null2String(fu.getParameter("detailid"));
String pageindex = Util.null2String(fu.getParameter("pageindex"));
String pagesize = Util.null2String(fu.getParameter("pagesize"));
String keywordurl = Util.null2String(fu.getParameter("keyword"));
String keyword = URLDecoder.decode(keywordurl, "UTF-8");
String sessionkey = Util.null2String(fu.getParameter("sessionkey"));
String setting = Util.null2String(fu.getParameter("setting"));
String mconfig = Util.null2String(fu.getParameter("config"));
int hrmorder = Util.getIntValue(fu.getParameter("_hrmorder_"), 0);
//-------------------------------------------
// mobile6.0新增接口参数 startr
//-------------------------------------------
//待办是否包含抄送(1)
int showcopy = Util.getIntValue(Util.null2String(fu.getParameter("showcopy")), 0);
//已办是否包含办结(1)
int showcompele = Util.getIntValue(Util.null2String(fu.getParameter("showcompele")), 0);
//流程时间排序规则:0:倒序, 1:正序
int wforder = Util.getIntValue(Util.null2String(fu.getParameter("wforder")), 0);
//是否需要获取流程类型集合
int isneedgetwfids = Util.getIntValue(Util.null2String(fu.getParameter("isneedgetwfids")), 0);
//流程ID
int workflowid = Util.getIntValue(Util.null2String(fu.getParameter("workflowid")), 0);
//流程类型ID
int workflowtypeid = Util.getIntValue(Util.null2String(fu.getParameter("workflowtypeid")), 0);
//流程归档状态:1:全部, 2:未归档, 3:已归档
int archivestatus = Util.getIntValue(Util.null2String(fu.getParameter("archivestatus")), 1);
//流程编号
String requestmark = Util.null2String(fu.getParameter("requestmark"));
//创建人ID
int createid = Util.getIntValue(Util.null2String(fu.getParameter("createid")), 0);
//创建人类型
int createtype = Util.getIntValue(Util.null2String(fu.getParameter("createtype")), 0);
//起始和结束创建日期, 格式:yyyy-MM-dd
String createdatestart = Util.null2String(fu.getParameter("createdatestart"));
String createdateend = Util.null2String(fu.getParameter("createdateend"));
//-------------------------------------------
// mobile6.0新增接口参数 end
//-------------------------------------------
// mobile6.0 新增接口:流程选择框 start
boolean isBrow = (1 == Util.getIntValue(Util.null2String(fu.getParameter("isbrow")), 0));
boolean isAllWf = (1 == Util.getIntValue(Util.null2String(fu.getParameter("isallwf")), 0));
if (isBrow) {
setting = "";
scope = "-1";
if (isAllWf) {
module = "-9";
}
}
//mobile6.0 新增接口:流程选择框 end
//因客户端使用GBK编码,故需要转码。
//keyword = new String(keyword.getBytes("iso8859-1"), "UTF-8");
if(ps.verify(sessionkey)) {
List conditions = new ArrayList();
String listtypeidcondition = "";
if(StringUtils.isNotEmpty(setting)) {
if(module.equals("1")||module.equals("7")||module.equals("8")||module.equals("9")||module.equals("10") || module.equals("-1004") || module.equals("-1005")) {
String condition = "";
String cfgstr = setting;
cfgstr = cfgstr.startsWith(",")?cfgstr.substring(1):cfgstr;
if(StringUtils.isNotEmpty(cfgstr)) {
String strSubClause = Util.getSubINClause(WorkflowVersion.getAllVersionStringByWFIDs(cfgstr), "t1.workflowid", "IN");
if("".equals(condition)){
condition += strSubClause;
} else {
condition += " or " + strSubClause;
}
if (condition != null && !"".equals(condition)) {
condition = " (" + condition + ") ";
}
//保存基础条件
listtypeidcondition = condition;
conditions.add(condition);
}
} else if(module.equals("2")||module.equals("3")) {
String where =DocumentService.getWheresBySettings(setting);
if(where!=null&&!where.trim().equals("")){
conditions.add(where);
}
}
}
Map result = new HashMap();
if(module.equals("1")||module.equals("7")||module.equals("8")||module.equals("9")||module.equals("10")||module.equals("-9")||module.equals("-1004")||module.equals("-1005")) {
if(StringUtils.isNotEmpty(keyword)) {
conditions.add(" (t1.requestnamenew like '%" + keyword + "%') ");
}
if(StringUtils.isNotEmpty(detailid)) {
conditions.add(" (t1.requestid = "+detailid+") ");
}
//-------------------------------------------
// mobile6.0新增查询条件 start
//-------------------------------------------
//添加工作流过滤
if (workflowid > 0) {
String strSubClause = Util.getSubINClause(WorkflowVersion.getAllVersionStringByWFIDs(workflowid + ""), "t1.workflowid", "IN");
conditions.add(strSubClause);
}else if(workflowid<0){
String strSubClause = " t1.workflowid ="+workflowid;
conditions.add(strSubClause);
}
//添加工作流类型过滤
if (workflowtypeid > 0) {
String strSubClause = " t1.workflowid in (select id from workflow_base where ";
//流程类型=
strSubClause += " workflowtype=" + workflowtypeid + ") ";
conditions.add(strSubClause);
}else if (workflowtypeid < 0){
String strSubClause = " t1.workflowid in (select workflowid from ofs_workflow where ";
//流程类型=
strSubClause += " sysid=" + workflowtypeid + ") ";
conditions.add(strSubClause);
}
//流程归档状态
if ((module.equals("8") || module.equals("9")) && archivestatus > 1) {
//未归档
if (archivestatus == 2) {
conditions.add(" t1.currentnodetype <> 3 ");
}
//已归档
if (archivestatus == 3) {
conditions.add(" t1.currentnodetype = 3 ");
}
}
//流程编号
if (!"".equals(requestmark)) {
conditions.add(" t1.requestmark like '%" + requestmark + "%' ");
}
//创建人
if (createid > 0) {
conditions.add(" t1.creater=" + createid + " and t1.creatertype=" + createtype + " ");
}
//创建起始日期
if (!"".equals(createdatestart)) {
conditions.add(" t1.createdate>='" + createdatestart + "' ");
}
//创建结束日期
if (!"".equals(createdateend)) {
conditions.add(" t1.createdate<='" + createdateend + "' ");
}
//-------------------------------------------
// mobile6.0新增查询条件 end
//-------------------------------------------
//-------------------------------------------------------
// mobile6.0新增接口(待办包含抄送,已办包含办结) start
//-------------------------------------------------------
Map<String, String> otherParaMap = new HashMap<String, String>();
otherParaMap.put("isshowcopy", String.valueOf(showcopy));
otherParaMap.put("isshowprocessed", String.valueOf(showcompele));
otherParaMap.put("isneedgetwfids", String.valueOf(isneedgetwfids));
otherParaMap.put("order", String.valueOf(wforder));
otherParaMap.put("listtypeidcondition", listtypeidcondition);
otherParaMap.put("isbrow", Util.null2String(Util.null2String(fu.getParameter("isbrow"))));
//-------------------------------------------------------
// mobile6.0新增接口(待办包含抄送,已办包含办结) end
//-------------------------------------------------------
//result = (Map) ps.getWorkflowList(Util.getIntValue(module), Util.getIntValue(scope), conditions, Util.getIntValue(pageindex), Util.getIntValue(pagesize), sessionkey);
result = (Map) ps.getWorkflowList(Util.getIntValue(module), Util.getIntValue(scope), conditions, Util.getIntValue(pageindex), Util.getIntValue(pagesize), sessionkey, otherParaMap);
}
if(module.equals("2")||module.equals("3")) {
if(StringUtils.isNotEmpty(keyword)) {
conditions.add(" (docsubject like '%"+keyword+"%') ");
}
if(StringUtils.isNotEmpty(detailid)) {
conditions.add(" (id = "+detailid+") ");
}
result = ps.getDocumentList(conditions, Util.getIntValue(pageindex), Util.getIntValue(pagesize), sessionkey);
}
if(module.equals("6")) {
if(StringUtils.isNotEmpty(keyword)) {
conditions.add(" (lastname like '%"+keyword+"%' or pinyinlastname like '%"+keyword+"%' or workcode like '%"+keyword+"%' or mobile like '%"+keyword+"%' or telephone like '%"+keyword+"%') ");
}
if(StringUtils.isNotEmpty(detailid)) {
conditions.add(" (id = "+detailid+") ");
}
result = ps.getUserList(conditions, Util.getIntValue(pageindex), Util.getIntValue(pagesize), hrmorder, sessionkey);
}
String key = "list";
if(result!=null&&result.get("list")!=null) {
List<Map<String,Object>> list = (List<Map<String,Object>>) result.get("list");
if(module.equals("1")||module.equals("7")||module.equals("8")||module.equals("9")||module.equals("10")||module.equals("-9") ||module.equals("-1004") ||module.equals("-1005")) {
List<Map<String,Object>> newlist = new ArrayList<Map<String,Object>>();
for(Map<String,Object> d:list) {
Map<String,Object> newdata = new HashMap<String,Object>();
String time = StringUtils.defaultIfEmpty((String) d.get("recivetime"),"");
String image = StringUtils.defaultIfEmpty((String) d.get("creatorpic"),"");
String id = StringUtils.defaultIfEmpty((String) d.get("wfid"),"");
String isnew = StringUtils.defaultIfEmpty((String) d.get("isnew"),"");
String subject = StringUtils.defaultIfEmpty((String) d.get("wftitle"),"").replace(""", "\"").replace("<B>", "").replace("</B>", "");
String description = "" +
"[" + StringUtils.defaultIfEmpty((String) d.get("wftype"),"") + "]" +
" 接收时间 : " + StringUtils.defaultIfEmpty((String) d.get("recivetime"),"") +
" 流程状态 : " + StringUtils.defaultIfEmpty((String) d.get("status"),"") +
" 创建人 : " + StringUtils.defaultIfEmpty((String) d.get("creator"),"") +
" 创建时间 : " + StringUtils.defaultIfEmpty((String) d.get("createtime"),"");
newdata.put("time", time);
newdata.put("image", image);
newdata.put("id", id);
newdata.put("isnew", isnew);
newdata.put("subject", Util.toHtmlMode(subject));
newdata.put("description", description);
//------------------------------------------
// mobile6.0 说明拆分为单个对象 start
//------------------------------------------
newdata.put("wftype", StringUtils.defaultIfEmpty((String) d.get("wftype"),""));
newdata.put("recivetime", StringUtils.defaultIfEmpty((String) d.get("recivetime"),""));
newdata.put("status", StringUtils.defaultIfEmpty((String) d.get("status"),""));
newdata.put("creator", StringUtils.defaultIfEmpty((String) d.get("creator"),""));
newdata.put("createtime", StringUtils.defaultIfEmpty((String) d.get("createtime"),""));
newdata.put("canmultisubmit", StringUtils.defaultIfEmpty((String) d.get("canMultiSubmit"),""));
//创建人ID
newdata.put("creatorid", StringUtils.defaultIfEmpty((String) d.get("creatorid"),""));
newdata.put("url", StringUtils.defaultIfEmpty((String) d.get("appurl"),""));//####
//------------------------------------------
// mobile6.0 说明拆分为单个对象 end
//------------------------------------------
//添加流程表单签名信息
newdata.put("formsignaturemd5", StringUtils.defaultIfEmpty((String) d.get("formsignaturemd5"), ""));
if(module.equals("-1004")){
newdata.put("isurge","1");
}
if(module.equals("-1005")){
newdata.put("ismonitor","1");
}
//手机签字意见的, 1 代表 不需要客户端显示 意见了,
newdata.put("hassign","1");
//主次账号统一显示
String f_weaver_belongto_userid = StringUtils.defaultIfEmpty((String) d.get("f_weaver_belongto_userid"),"");
newdata.put("f_weaver_belongto_userid", f_weaver_belongto_userid);
String f_weaver_belongto_usertype = StringUtils.defaultIfEmpty((String) d.get("f_weaver_belongto_usertype"),"");
newdata.put("f_weaver_belongto_usertype", f_weaver_belongto_usertype);
newlist.add(newdata);
}
result.put(key,newlist);
} else if(module.equals("2")||module.equals("3")) {
AuthService as = new AuthService();
User user = as.getCurrUser(sessionkey);
List<Map<String,Object>> newlist = new ArrayList<Map<String,Object>>();
for(Map<String,Object> d:list) {
Map<String,Object> newdata = new HashMap<String,Object>();
String time = StringUtils.defaultIfEmpty((String) d.get("modifytime"),"");
String image = StringUtils.defaultIfEmpty((String) d.get("docimg"),"");
String id = StringUtils.defaultIfEmpty((String) d.get("docid"),"");
String isnew = StringUtils.defaultIfEmpty((String) d.get("isnew"),"");
String subject = StringUtils.defaultIfEmpty((String) d.get("docsubject"),"");
String description = "" +
" "+SystemEnv.getHtmlLabelName(79,user.getLanguage())+" : " + StringUtils.defaultIfEmpty((String) d.get("owner"),"") +
" "+SystemEnv.getHtmlLabelName(1339,user.getLanguage())+" : " + StringUtils.defaultIfEmpty((String) d.get("createtime"),"") +
" "+SystemEnv.getHtmlLabelName(26805,user.getLanguage())+" : " + StringUtils.defaultIfEmpty((String) d.get("modifytime"),"");
newdata.put("time", time);
newdata.put("image", image);
newdata.put("id", id);
newdata.put("isnew", isnew);
newdata.put("subject", subject);
newdata.put("description", description);
//手机签字意见的, 1 代表 不需要客户端显示 意见了,
newdata.put("hassign","1");
//主次账号统一显示
String f_weaver_belongto_userid = StringUtils.defaultIfEmpty((String) d.get("f_weaver_belongto_userid"),"");
newdata.put("f_weaver_belongto_userid", f_weaver_belongto_userid);
String f_weaver_belongto_usertype = StringUtils.defaultIfEmpty((String) d.get("f_weaver_belongto_usertype"),"");
newdata.put("f_weaver_belongto_usertype", f_weaver_belongto_usertype);
newlist.add(newdata);
}
result.put(key,newlist);
} else if(module.equals("6")) {
List<Map<String,Object>> newlist = new ArrayList<Map<String,Object>>();
for(Map<String,Object> d:list) {
Map<String,Object> newdata = new HashMap<String,Object>();
String time = "";
String image = StringUtils.defaultIfEmpty((String) d.get("msgerurl"),"");
String id = StringUtils.defaultIfEmpty((String) d.get("id"),"");
String isnew = "";
String subject = StringUtils.defaultIfEmpty((String) d.get("lastname"),"");
String description = "" +
" [" + StringUtils.defaultIfEmpty((String) d.get("jobtitle"),"") + "]" +
" " + StringUtils.defaultIfEmpty((String) d.get("dept"),"") + " / " +
"" + StringUtils.defaultIfEmpty((String) d.get("subcom"),"");
newdata.put("time", time);
newdata.put("image", image);
newdata.put("id", id);
newdata.put("isnew", isnew);
newdata.put("subject", subject);
newdata.put("description", description);
//手机签字意见的, 1 代表 不需要客户端显示 意见了,
newdata.put("hassign","1");
//主次账号统一显示
String f_weaver_belongto_userid = StringUtils.defaultIfEmpty((String) d.get("f_weaver_belongto_userid"),"");
newdata.put("f_weaver_belongto_userid", f_weaver_belongto_userid);
String f_weaver_belongto_usertype = StringUtils.defaultIfEmpty((String) d.get("f_weaver_belongto_usertype"),"");
newdata.put("f_weaver_belongto_usertype", f_weaver_belongto_usertype);
newlist.add(newdata);
}
result.put(key,newlist);
}
}
JSONObject jo = JSONObject.fromObject(result);
out.println(jo);
}
%>