OutterSysOperation.jsp
27.8 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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
<%@ page import="weaver.general.*" %>
<%@ page import="weaver.hrm.*" %>
<%@ page import="java.util.*" %>
<%@ page import="weaver.file.FileUpload" %>
<%@ page import="weaver.conn.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.integration.logging.Logger"%>
<%@ page import="weaver.integration.logging.LoggerFactory"%>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="log" class="weaver.systeminfo.SysMaintenanceLog" scope="page"/>
<%
User user = HrmUserVarify.getUser (request , response) ;
if(user == null) return ;
if(!HrmUserVarify.checkUserRight("intergration:outtersyssetting", user)){
response.sendRedirect("/notice/noright.jsp");
return;
}
String dbtype=RecordSet.getDBType(); //qc308742 [90]集成登录-Mysql集成模块问题列表 数据源无法保存
Logger newlog = LoggerFactory.getLogger();
FileUpload fu = new FileUpload(request);
String urllinkimagid = "";
String urlencodeflag = Util.fromScreen(fu.getParameter("urlencodeflag"),user.getLanguage());// 地址是否编码
String operation = Util.fromScreen(fu.getParameter("operation"),user.getLanguage());
String sysid = Util.fromScreen(fu.getParameter("sysid"),user.getLanguage());// 标识
String name = Util.fromScreen(fu.getParameter("name"),user.getLanguage());// 名称
String iurl = Util.fromScreen(fu.getParameter("iurl"),user.getLanguage());// 内网地址
String ourl = Util.fromScreen(fu.getParameter("ourl"),user.getLanguage());// 外网地址
String backto = Util.null2String(fu.getParameter("backto"));// 返回类型
String isDialog = Util.null2String(fu.getParameter("isdialog"));
if(isDialog.equals("")) {
isDialog = Util.null2String(request.getParameter("isdialog"));
}
String typename = Util.fromScreen(fu.getParameter("typename"),user.getLanguage());// 单点登录的类型
String requesttype = Util.fromScreen(fu.getParameter("requesttype"),user.getLanguage());// 请求类型
if(requesttype.equals("")) {
requesttype = "POST";
}
String accountcode = Util.fromScreen(fu.getParameter("accountcode"),user.getLanguage());// NC账套
// 是否需要密钥或向量
String isneedpwd = Util.fromScreen(fu.getParameter("isneedpwd"),user.getLanguage());
String isneediv = Util.fromScreen(fu.getParameter("isneediv"),user.getLanguage());
// 账号参数名
String baseparam1 = Util.fromScreen(fu.getParameter("baseparam1"),user.getLanguage());
String basetype1 = Util.fromScreen(fu.getParameter("basetype1"),user.getLanguage());
String urlparaencrypt1 = Util.fromScreen(fu.getParameter("urlparaencrypt1"),user.getLanguage());
String encryptcode1 = Util.fromScreen(fu.getParameter("encryptcode1"),user.getLanguage());
String encryptiv1 = Util.fromScreen(fu.getParameter("encryptiv1"),user.getLanguage());
if(!urlparaencrypt1.equals("1")) {
encryptcode1 = "";
encryptiv1 = "";
} else {
if(!"1".equals(isneedpwd)) {
encryptcode1 = "";
}
if(!"1".equals(isneediv)) {
encryptiv1 = "";
}
}
// 密码参数名
String baseparam2 = Util.fromScreen(fu.getParameter("baseparam2"),user.getLanguage());
String basetype2 = Util.fromScreen(fu.getParameter("basetype2"),user.getLanguage());
String urlparaencrypt2 = Util.fromScreen(fu.getParameter("urlparaencrypt2"),user.getLanguage());
String encryptcode2 = Util.fromScreen(fu.getParameter("encryptcode2"),user.getLanguage());
String encryptiv2 = Util.fromScreen(fu.getParameter("encryptiv2"),user.getLanguage());
if(!urlparaencrypt2.equals("1")) {
encryptcode2 = "";
encryptiv2 = "";
} else {
if(!"1".equals(isneedpwd)) {
encryptcode2 = "";
}
if(!"1".equals(isneediv)) {
encryptiv2 = "";
}
}
String urlparaencrypt = Util.fromScreen(fu.getParameter("urlparaencrypt"),user.getLanguage());// 已经废弃
String encryptcode = Util.fromScreen(fu.getParameter("encryptcode"),user.getLanguage());// 已经废弃
if(!urlparaencrypt.equals("1")) {
encryptcode = "";
}
String encryptclass = Util.fromScreen(fu.getParameter("encryptclass"),user.getLanguage());// 已经废弃
String encryptmethod = Util.fromScreen(fu.getParameter("encryptmethod"),user.getLanguage());// 已经废弃
String encrypttype = Util.fromScreen(fu.getParameter("encrypttype"),user.getLanguage());// 加密算法
String autologin = Util.fromScreen(fu.getParameter("autologinflag"),user.getLanguage());// 内外网自动登录
String encryptclassId = Util.fromScreen(fu.getParameter("encryptclassId"),user.getLanguage());// 自定义加密类ID
if(!"2".equals(encrypttype)) {
encryptclassId = "";
}
//qc308742 [90]集成登录-Mysql集成模块问题列表 数据源无法保存----START
if("".equals(encryptclassId)){
if(dbtype.equalsIgnoreCase("mysql")){
encryptclassId=null;
}
}
//qc308742 [90]集成登录-Mysql集成模块问题列表 数据源无法保存 -----END
String imagewidth = Util.fromScreen(fu.getParameter("imagewidth"),user.getLanguage());// 宽度
String imageheight = Util.fromScreen(fu.getParameter("imageheight"),user.getLanguage());// 高度
String encodeflag = Util.fromScreen(fu.getParameter("encodeflag"),user.getLanguage());// 登录系统编码方式
String client_id = Util.fromScreen(fu.getParameter("client_id"),user.getLanguage());
String client_secret = Util.fromScreen(fu.getParameter("client_secret"),user.getLanguage());
//263邮箱参数
String email263_domain = Util.fromScreen(fu.getParameter("email263_domain"),user.getLanguage());
String email263_cid = Util.fromScreen(fu.getParameter("email263_cid"),user.getLanguage());
String email263_key = Util.fromScreen(fu.getParameter("email263_key"),user.getLanguage());
// 其他参数
String paramnames[] = fu.getParameterValues("paramnames");
String paramtypes[] = fu.getParameterValues("paramtypes");
String paramvalues[] = fu.getParameterValues("paramvalues");
String labelnames[] = fu.getParameterValues("labelnames");
String paraencrypts[] = fu.getParameterValues("paraencrypts");
String encryptcodes[] = fu.getParameterValues("encryptcodes");
String encryptivs[] = fu.getParameterValues("encryptivs");
String outternetworks[] = fu.getParameterValues("outternetworks");
// 单点登录地址
String entranceurl = Util.fromScreen(fu.getParameter("entranceurl"),user.getLanguage());
// 显示顺序
String showorder = Util.fromScreen(fu.getParameter("showorder"),user.getLanguage());
// 加密后的密文处理,原值、加密后小写、加密后大写
String result = Util.fromScreen(fu.getParameter("result"),user.getLanguage());
String dateStr = "";
String timeStr = "";
if(operation.equals("add")) {
boolean flag = true;
urllinkimagid = Util.null2String(fu.uploadFiles("urllinkimagid"));
//qc308742 [90]集成登录-Mysql集成模块问题列表 数据源无法保存----START
if("".equals(urllinkimagid)){
if(dbtype.equalsIgnoreCase("mysql")){
urllinkimagid=null;
}
}
RecordSet.executeSql("select * from outter_sys where sysid='"+sysid+"'");
if(RecordSet.next()){
response.sendRedirect("OutterSysAdd.jsp?isDouble=1&isdialog=1");
return;
//response.sendRedirect("OutterSysAdd.jsp?msgid=21011&isdialog=1&typename="+typename);
//return;
}
dateStr = TimeUtil.getCurrentDateString();
timeStr = TimeUtil.getOnlyCurrentTimeString();
String addsql="insert into outter_sys(sysid,name,iurl,ourl,baseparam1,baseparam2,basetype1,basetype2,typename,ncaccountcode,requesttype,urlparaencrypt1,encryptcode1,urlparaencrypt2,encryptcode2,urlparaencrypt,encryptcode,encrypttype,encryptclass,encryptmethod,urlencodeflag,urllinkimagid,autologin,encryptclassId,imagewidth,imageheight,encodeflag,client_id,client_secret"+
",email263_domain"+
",email263_cid"+
",email263_key"+
",entranceurl"+
",showorder"+
",result"+
",encryptiv1"+
",encryptiv2"+
",createdate"+
",createtime"+
",modifydate"+
",modifytime"+
") "+
"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
flag = RecordSet.executeUpdate(addsql,sysid,name,iurl,ourl,baseparam1,baseparam2,basetype1,basetype2,typename,accountcode,requesttype,urlparaencrypt1,encryptcode1,urlparaencrypt2,encryptcode2,urlparaencrypt,encryptcode,encrypttype,encryptclass,encryptmethod,urlencodeflag,urllinkimagid,autologin,encryptclassId,imagewidth,imageheight,encodeflag,client_id,client_secret
,email263_domain
,email263_cid
,email263_key
,entranceurl
,showorder
,result
,encryptiv1
,encryptiv2
,dateStr
,timeStr
,dateStr
,timeStr);
//qc308742 [90]集成登录-Mysql集成模块问题列表 数据源无法保存----END
if(paramnames != null) {
for(int i = 0; i < paramnames.length; i++) {
String paramname = paramnames[i];
String paramvalue = paramvalues[i];
String paramtype = paramtypes[i];
String labelname = labelnames[i];
String tparaencrypt = "";
String tencryptcode = "";
String tencryptiv = "";
try {
tparaencrypt = paraencrypts[i];
tencryptcode = encryptcodes[i];
tencryptiv = encryptivs[i];
} catch(Exception e) {
newlog.error(e);
}
if("5".equals(paramtype)) {// 表达式参数不需要加密
tparaencrypt = "0";
tencryptcode = "";
tencryptiv = "";
} else {
if(!tparaencrypt.equals("1")) {
tencryptcode = "";
tencryptiv = "";
} else {
if(!"1".equals(isneedpwd)) {
tencryptcode = "";
}
if(!"1".equals(isneediv)) {
tencryptiv = "";
}
}
}
if(!paramname.equals("")) {
ConnStatement statement = null;
try {
statement = new ConnStatement();
String sql = "";
sql = "insert into outter_sysparam("+
"sysid,"+
"paramname,"+
"paramvalue,"+
"labelname,"+
"paramtype,"+
"indexid,"+
"paraencrypt,"+
"encryptcode,"+
"encryptiv"+
") values("+
"?,?,?,?,?,?,?,?,?"+
")";
statement.setStatementSql(sql);
statement.setString(1, sysid);
statement.setString(2, paramname);
statement.setString(3, paramvalue);
statement.setString(4, labelname);
statement.setInt(5,Util.getIntValue(paramtype,0));
statement.setInt(6, i);
statement.setString(7, tparaencrypt);
statement.setString(8, tencryptcode);
statement.setString(9, tencryptiv);
statement.executeUpdate();
//RecordSet.executeSql("insert into outter_sysparam(sysid,paramname,paramvalue,labelname,paramtype,indexid,paraencrypt,encryptcode) values('"+sysid+"','"+paramname+"','"+paramvalue+"','"+labelname+"',"+paramtype+","+i+",'"+tparaencrypt+"','"+tencryptcode+"')");
} catch(Exception e) {
newlog.error(e);
} finally {
try {
statement.close();
} catch(Exception e) {
newlog.error(e);
}
}
}
}
}
if("1".equals(typename)||"5".equals(typename)) { //如果类型是NC,则新增公司名称
String paramnames_nc = Util.null2String(fu.getParameter("paramnames_nc"));
String paramtypes_nc = Util.null2String(fu.getParameter("paramtypes_nc"));
String labelnames_nc = Util.null2String(fu.getParameter("labelnames_nc"));
String paraencrypt_nc = Util.null2String(fu.getParameter("paraencrypt_nc"));
String encryptcode_nc = Util.null2String(fu.getParameter("encryptcode_nc"));
String encryptiv_nc = Util.null2String(fu.getParameter("encryptiv_nc"));
String paramvalues_nc = Util.null2String(fu.getParameter("paramvalues_nc"));
if(!paraencrypt_nc.equals("1")) {
encryptcode_nc = "";
encryptiv_nc = "";
} else {
if(!"1".equals(isneedpwd)) {
encryptcode_nc = "";
}
if(!"1".equals(isneediv)) {
encryptiv_nc = "";
}
}
RecordSet.executeSql("insert into outter_sysparam(sysid,paramname,paramvalue,labelname,paramtype,indexid,paraencrypt,encryptcode,encryptiv) values('"+sysid+"','"+paramnames_nc+"','"+paramvalues_nc+"','"+labelnames_nc+"',"+paramtypes_nc+",-1,'"+paraencrypt_nc+"','"+encryptcode_nc+"','"+encryptiv_nc+"')");
//保存共享权限
RecordSet.executeSql("update shareoutter set sysid='"+sysid+"' where sysid='-1'");
}
//保存网络
if(autologin.equals("1")) {
if(outternetworks != null && outternetworks.length > 0) {
for(int i = 0; i < outternetworks.length; i++) {
String[] temp = outternetworks[i].split("~");
String inceptipaddress = "";
String endipaddress = "";
if(temp != null) {
inceptipaddress = temp[0];
endipaddress = temp[1];
RecordSet.executeSql("insert into outter_network(inceptipaddress,endipaddress,sysid) values('"+inceptipaddress+"','"+endipaddress+"','"+sysid+"')");
}
}
}
}
//设置默认共享权限为所有人
String sql = "insert into shareoutter (sysid,type,content,seclevel,seclevelmax,sharelevel,jobtitlelevel,jobtitlesharevalue) values ('"+sysid+"','3','-1','0','100','-1','','')";
RecordSet.executeSql(sql);
if(flag) {
// 操作日志
String id = "";
RecordSet.executeSql("select id from outter_sys where sysid = '" + sysid + "' ");
if(RecordSet.next()) {
id = Util.null2String(RecordSet.getString("id"));
}
log.resetParameter();
log.setRelatedId(Util.getIntValue(id));
log.setRelatedName(sysid);
log.setOperateType("1");
log.setOperateDesc("outter_sys_insert");
log.setOperateItem("382");
log.setOperateUserid(user.getUID());
log.setClientAddress(request.getRemoteAddr());
log.setSysLogInfo();
}
if("1".equals(isDialog)) {
%>
<script language=javascript >
try {
//var parentWin = parent.getParentWindow(window);
var parentWin = parent.parent.getParentWindow(parent);
parentWin.location.href="OutterSys.jsp?backto=<%=backto%>";
parentWin.closeDialog();
} catch(e) {
}
</script>
<%
} else {
response.sendRedirect("OutterSys.jsp?backto="+backto);
}
return;
}
else if(operation.equals("edit")) {
boolean flag = true;
urllinkimagid = Util.null2String(fu.uploadFiles("urllinkimagid"));
String oldurllinkimagid = Util.null2String(fu.getParameter("oldurllinkimagid"));
if(urllinkimagid.equals("")) {
urllinkimagid = oldurllinkimagid ;
}
//qc308742 [90]集成登录-Mysql集成模块问题列表 数据源无法保存----START
if("".equals(urllinkimagid)){
if(dbtype.equalsIgnoreCase("mysql")){
urllinkimagid=null;
}
}
dateStr = TimeUtil.getCurrentDateString();
timeStr = TimeUtil.getOnlyCurrentTimeString();
String editsql="update outter_sys set sysid=?,name=?,iurl=?,ourl=?,baseparam1=?,baseparam2=?,basetype1=?,basetype2=?,ncaccountcode=?,requesttype=?,urlparaencrypt1=?,encryptcode1=?,urlparaencrypt2=?,encryptcode2=?,urlparaencrypt=?,encryptcode=?,encrypttype=?,encryptclass=?,encryptmethod=?,urlencodeflag=?,urllinkimagid=?,autologin=?,encryptclassId=?,imagewidth=?,imageheight=?,encodeflag=?,client_id=?,client_secret=?"+
",email263_domain=?"+
",email263_cid=?"+
",email263_key=?"+
",entranceurl=?"+
",showorder=?"+
",result=?"+
",encryptiv1=?"+
",encryptiv2=?"+
",modifydate=?"+
",modifytime=?"+
" where sysid=?";
flag = RecordSet.executeUpdate(editsql,sysid,name,iurl,ourl,baseparam1,baseparam2,basetype1,basetype2,accountcode,requesttype,urlparaencrypt1,encryptcode1,urlparaencrypt2,encryptcode2,urlparaencrypt,encryptcode,encrypttype,encryptclass,encryptmethod,urlencodeflag,urllinkimagid,autologin,encryptclassId,imagewidth,imageheight,encodeflag,client_id,client_secret,email263_domain,
email263_cid,email263_key,entranceurl,showorder,result,encryptiv1,encryptiv2,dateStr,timeStr,sysid);
//qc308742 [90]集成登录-Mysql集成模块问题列表 数据源无法保存----END
RecordSet.executeSql("delete from outter_sysparam where sysid='"+sysid+"' and paramtype<>1");
if(paramnames!=null && !"".equals(paramnames)){
ArrayList<String> paramnameList = new ArrayList<String>();//页面上获得的用户录入其他参数
for(int i = 0; i < paramnames.length; i++) {
String paramname = paramnames[i];
String paramvalue = paramvalues[i];
String paramtype = paramtypes[i];
String labelname = labelnames[i];
String tparaencrypt = "";
String tencryptcode = "";
String tencryptiv = "";
if("1".equals(paramtype)){ //用户录入的其他参数
paramnameList.add(Util.null2String(paramname));
continue;
}
try {
tparaencrypt = paraencrypts[i];
tencryptcode = encryptcodes[i];
tencryptiv = encryptivs[i];
} catch(Exception e) {
newlog.error(e);
}
if("5".equals(paramtype)) {// 表达式参数不需要加密
tparaencrypt = "0";
tencryptcode = "";
tencryptiv = "";
} else {
if(!tparaencrypt.equals("1")) {
tencryptcode = "";
tencryptiv = "";
} else {
if(!"1".equals(isneedpwd)) {
tencryptcode = "";
}
if(!"1".equals(isneediv)) {
tencryptiv = "";
}
}
}
if(!paramname.equals("")) {
ConnStatement statement = null;
try {
statement = new ConnStatement();
String sql = "";
sql = "insert into outter_sysparam("+
"sysid,"+
"paramname,"+
"paramvalue,"+
"labelname,"+
"paramtype,"+
"indexid,"+
"paraencrypt,"+
"encryptcode,"+
"encryptiv"+
") values("+
"?,?,?,?,?,?,?,?,?"+
")";
statement.setStatementSql(sql);
statement.setString(1, sysid);
statement.setString(2, paramname);
statement.setString(3, paramvalue);
statement.setString(4, labelname);
statement.setInt(5,Util.getIntValue(paramtype,0));
statement.setInt(6, i);
statement.setString(7, tparaencrypt);
statement.setString(8, tencryptcode);
statement.setString(9, tencryptiv);
statement.executeUpdate();
//RecordSet.executeSql("insert into outter_sysparam(sysid,paramname,paramvalue,labelname,paramtype,indexid,paraencrypt,encryptcode) values('"+sysid+"','"+paramname+"','"+paramvalue+"','"+labelname+"',"+paramtype+","+i+",'"+tparaencrypt+"','"+tencryptcode+"')");
//System.out.println("insert into outter_sysparam(sysid,paramname,paramvalue,labelname,paramtype,indexid,paraencrypt,encryptcode) values('"+sysid+"','"+paramname+"','"+paramvalue+"','"+labelname+"',"+paramtype+","+i+",'"+tparaencrypt+"','"+tencryptcode+"')");
} catch(Exception e) {
newlog.error(e);
} finally {
try {
statement.close();
} catch(Exception e) {
newlog.error(e);
}
}
}
}
/*用户录入的其他参数单独处理 start*/
if(paramnameList.size() != 0){
ArrayList<String> paramname_oldList = new ArrayList<String>(); //数据库中原有的用户录入参数
RecordSet.executeSql("select * from outter_sysparam where sysid='"+sysid+"' and paramtype=1");
while(RecordSet.next()){
newlog.error("数据库中原有参数:"+RecordSet.getString("paramname"));
paramname_oldList.add(Util.null2String(RecordSet.getString("paramname")));
}
String param = null;
ArrayList<String> paramname_sameList = new ArrayList<String>();//二者相同的用户录入参数
for(int i=0; i<paramnameList.size(); i++){
param = Util.null2String(paramnameList.get(i));
for(String p : paramname_oldList){
if(p.equals(param)){
paramname_sameList.add(param);
}
}
}//end for outter
//页面上的用户录入参数与二者相同的用户录入参数进行对比,一致的不处理,不一致的添加
Iterator<String> itAdd = paramnameList.iterator();
while(itAdd.hasNext()){
param = Util.null2String(itAdd.next());
if(paramname_sameList.size() == 0){
break;
}else{
for(String p : paramname_sameList){
if(p.equals(param)){//将不需要处理的参数从添加列表中删除
itAdd.remove();
}
}
}
}
for (String p : paramnameList){//添加参数
param = Util.null2String(p);
for(int j = 0; j < paramnames.length; j++) {
String paramname = paramnames[j];
String paramvalue = paramvalues[j];
String paramtype = paramtypes[j];
String labelname = labelnames[j];
String tparaencrypt = "";
String tencryptcode = "";
String tencryptiv = "";
if("1".equals(paramtype) && param.equals(paramname)){ //用户录入的其他参数
newlog.error("添加参数:"+param);
try {
tparaencrypt = paraencrypts[j];
tencryptcode = encryptcodes[j];
tencryptiv = encryptivs[j];
} catch(Exception e) {
newlog.error(e);
}
if("5".equals(paramtype)) {// 表达式参数不需要加密
tparaencrypt = "0";
tencryptcode = "";
tencryptiv = "";
} else {
if(!tparaencrypt.equals("1")) {
tencryptcode = "";
tencryptiv = "";
} else {
if(!"1".equals(isneedpwd)) {
tencryptcode = "";
}
if(!"1".equals(isneediv)) {
tencryptiv = "";
}
}
}
if(!paramname.equals("")) {
ConnStatement statement = null;
try {
statement = new ConnStatement();
String sql = "";
sql = "insert into outter_sysparam("+
"sysid,"+
"paramname,"+
"paramvalue,"+
"labelname,"+
"paramtype,"+
"indexid,"+
"paraencrypt,"+
"encryptcode,"+
"encryptiv"+
") values("+
"?,?,?,?,?,?,?,?,?"+
")";
statement.setStatementSql(sql);
statement.setString(1, sysid);
statement.setString(2, paramname);
statement.setString(3, paramvalue);
statement.setString(4, labelname);
statement.setInt(5,Util.getIntValue(paramtype,0));
statement.setInt(6, j);
statement.setString(7, tparaencrypt);
statement.setString(8, tencryptcode);
statement.setString(9, tencryptiv);
statement.executeUpdate();
//RecordSet.executeSql("insert into outter_sysparam(sysid,paramname,paramvalue,labelname,paramtype,indexid,paraencrypt,encryptcode) values('"+sysid+"','"+paramname+"','"+paramvalue+"','"+labelname+"',"+paramtype+","+i+",'"+tparaencrypt+"','"+tencryptcode+"')");
//System.out.println("insert into outter_sysparam(sysid,paramname,paramvalue,labelname,paramtype,indexid,paraencrypt,encryptcode) values('"+sysid+"','"+paramname+"','"+paramvalue+"','"+labelname+"',"+paramtype+","+i+",'"+tparaencrypt+"','"+tencryptcode+"')");
} catch(Exception e) {
newlog.error(e);
} finally {
try {
statement.close();
} catch(Exception e) {
newlog.error(e);
}
}
}//end if inner
}//end if outter
}//end for inner
}//end for outter
//原有的用户录入参数与二者相同的用户录入参数进行对比,一致的不处理,不一致的删除
Iterator<String> itdel = paramname_oldList.iterator();
while(itdel.hasNext()){
param = Util.null2String(itdel.next());
if(paramname_sameList.size() == 0){
break;
}else{
for(String p : paramname_sameList){
if(p.equals(param)){//将不需要处理的参数从添加列表中删除
itdel.remove();
}
}
}
}
for (String p : paramname_oldList){//删除参数
newlog.error("删除参数:"+p);
RecordSet.executeSql("delete from outter_sysparam where sysid='"+sysid+"' and paramtype=1 and paramname='"+p+"'");
RecordSet.executeSql("delete from outter_params where sysid='"+sysid+"' and paramname='"+p+"'");
}
}else{
newlog.error("删除所有用户录入参数inner");
RecordSet.executeSql("delete from outter_sysparam where sysid='"+sysid+"' and paramtype=1");
RecordSet.executeSql("delete from outter_params where sysid='"+sysid+"'");
}
}else{
newlog.error("删除所有用户录入参数outter");
RecordSet.executeSql("delete from outter_sysparam where sysid='"+sysid+"' and paramtype=1");
RecordSet.executeSql("delete from outter_params where sysid='"+sysid+"'");
}
/*用户录入的其他参数单独处理 end*/
//保存网络
RecordSet.executeSql("delete from outter_network where sysid='"+sysid+"'");//QC308742 [90]集成登录-Mysql集成模块问题列表
if(autologin.equals("1")) {
if(outternetworks != null && outternetworks.length > 0) {
for(int i = 0; i < outternetworks.length; i++) {
String[] temp = outternetworks[i].split("~");
String inceptipaddress = "";
String endipaddress = "";
if(temp != null) {
inceptipaddress = temp[0];
endipaddress = temp[1];
RecordSet.executeSql("insert into outter_network(inceptipaddress,endipaddress,sysid) values('"+inceptipaddress+"','"+endipaddress+"','"+sysid+"')");
}
}
}
}
if(flag) {
// 操作日志
String id = "";
RecordSet.executeSql("select id from outter_sys where sysid = '" + sysid + "' ");
if(RecordSet.next()) {
id = Util.null2String(RecordSet.getString("id"));
}
log.resetParameter();
log.setRelatedId(Util.getIntValue(id));
log.setRelatedName(sysid);
log.setOperateType("2");
log.setOperateDesc("outter_sys_update");
log.setOperateItem("382");
log.setOperateUserid(user.getUID());
log.setClientAddress(request.getRemoteAddr());
log.setSysLogInfo();
}
if("1".equals(isDialog)) {
%>
<script language=javascript >
try {
//var parentWin = parent.getParentWindow(window);
var parentWin = parent.parent.parent.getParentWindow(parent);
parentWin.location.href="OutterSys.jsp?backto=<%=backto%>";
parentWin.closeDialog();
} catch(e) {
}
</script>
<%
} else {
response.sendRedirect("OutterSys.jsp?backto="+backto);
}
}
else if(operation.equals("delete")) {
List ids = Util.TokenizerString(sysid,",");
if(null != ids && ids.size() > 0) {
for(int i = 0; i < ids.size(); i++) {
boolean flag = true;
String tempsysid = Util.null2String((String)ids.get(i));
if(!"".equals(tempsysid)) {
String id = "";
RecordSet.executeSql("select id from outter_sys where sysid = '" + sysid + "' ");
if(RecordSet.next()) {
id = Util.null2String(RecordSet.getString("id"));
}
flag = RecordSet.executeSql("delete from outter_sys where sysid='"+tempsysid+"'");
flag = RecordSet.executeSql("delete from outter_sysparam where sysid='"+tempsysid+"'");
flag = RecordSet.executeSql("delete from outter_account where sysid='"+tempsysid+"'");//QC309904 [80][90][缺陷]集成登录-删除集成登录,并没有删除OUTTER_ACCOUNT表相关记录
flag = RecordSet.executeSql("delete from outter_params where sysid='"+tempsysid+"'");//QC340678 [80][90][建议]集成登录-删除集成登录时,未删除outter_params表中的数据
//删除共享权限
flag = RecordSet.executeSql("delete from shareoutter where sysid='"+tempsysid+"'");
flag = RecordSet.executeSql("delete from outter_network where sysid='"+tempsysid+"'");
if(flag) {
// 操作日志
log.resetParameter();
log.setRelatedId(Util.getIntValue(id));
log.setRelatedName(tempsysid);
log.setOperateType("3");
log.setOperateDesc("outter_sys_delete");
log.setOperateItem("382");
log.setOperateUserid(user.getUID());
log.setClientAddress(request.getRemoteAddr());
log.setSysLogInfo();
}
}
}
}
if("1".equals(isDialog)) { %>
<script language=javascript >
try {
var parentWin = parent.parent.getParentWindow(parent);
parentWin.location.href="OutterSys.jsp?backto=<%=backto%>";
parentWin.closeDialog();
} catch(e) {
}
</script>
<%
} else {
response.sendRedirect("OutterSys.jsp?backto="+backto);
}
}
else if(operation.equalsIgnoreCase("delpic")) {
urllinkimagid=Util.null2String(fu.uploadFiles("urllinkimagid"));
if(dbtype.toLowerCase().indexOf("mysql")>-1){
RecordSet.executeSql("update outter_sys set urllinkimagid=null where sysid='"+sysid+"'");
}else{
RecordSet.executeSql("update outter_sys set urllinkimagid='' where sysid='"+sysid+"'");
}
response.sendRedirect("/interface/outter/OutterSysEdit.jsp?id="+sysid);
return ;
}
else if(operation.equalsIgnoreCase("getEntranceUrl")) {
String defaultentranceurl = "";
String typeId = Util.fromScreen(fu.getParameter("typeId"),user.getLanguage());
RecordSet.executeSql("select * from outter_type where id = "+typeId);
if(RecordSet.next()) {
defaultentranceurl = Util.null2String(RecordSet.getString("defaultentranceurl"));
}
out.print(defaultentranceurl);
}
%>