wangting
2024-12-26 fa261e8c1220b31af54e8167e4de9c3320b1af27
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
package com.vci.client.framework.specialrole;
 
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
 
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
 
import org.apache.commons.lang3.StringUtils;
 
import com.vci.client.LogonApplication;
import com.vci.client.common.TransmitTreeObject;
import com.vci.client.common.VCIBasePanel;
import com.vci.client.common.objects.DeptObject;
import com.vci.client.common.objects.RoleObject;
import com.vci.client.common.objects.UserEntityObject;
import com.vci.client.common.objects.UserLogonObject;
import com.vci.client.common.objects.UserObject;
import com.vci.client.framework.delegate.RightManagementClientDelegate;
import com.vci.client.framework.rightConfig.object.FunctionObject;
import com.vci.client.framework.specialrole.ModuleInterface.IModuleShow;
import com.vci.client.framework.systemConfig.object.PasswordStrategyObject;
import com.vci.client.framework.util.RightControlUtil;
import com.vci.client.ui.exception.VCIException;
import com.vci.client.ui.locale.LocaleDisplay;
import com.vci.client.ui.swing.KJButton;
import com.vci.client.ui.swing.VCIOptionPane;
import com.vci.client.ui.swing.VCISwingUtil;
import com.vci.client.ui.swing.components.VCIJButton;
import com.vci.client.ui.swing.components.VCIJPanel;
import com.vci.client.ui.swing.components.table.AbstractVCIJTableDataProvider;
import com.vci.client.ui.swing.components.table.VCIJTableNode;
import com.vci.client.ui.swing.components.table.VCIJTablePanel;
 
/**
 * 成员管理界面,带Table页,便于客户查询
 * @author liud
 *
 */
public class UserTablePanel extends VCIBasePanel implements IModuleShow{
 
    private static final long serialVersionUID = 1L;
    private String userName = LogonApplication.getUserEntityObject().getUserName();
    private UserEntityObject userEntityObj = LogonApplication.getUserEntityObject();
    private TransmitTreeObject transmitTreeObject = null;
    Hashtable<String, String> hashTable = new Hashtable<String, String>();
    // 控件的坐标位置变量
    private int x = 10;
    private int y = 20;
    private int width = 50;
    private int height = 25;
    private int hspan = 5;
    
    private JLabel trueNameLabel = new JLabel(LocaleDisplay.getI18nString("rmip.stafforg.logal.firstname", "RMIPFramework", getLocale()));
    private JTextField trueNameText = new JTextField(); 
    private JLabel nameLabel = new JLabel(LocaleDisplay.getI18nString("rmip.stafforg.logal.username", "RMIPFramework", getLocale()));
    private JTextField userNameText = new JTextField();
    private JComboBox departmentComBox = new JComboBox(); 
    
    private KJButton searchButton = new KJButton("查询","search.png");
    
    private KJButton clearButton = new KJButton("清空","clear.gif");
    
    private VCIJButton addButton = VCISwingUtil.createVCIJButton("",LocaleDisplay.getI18nString("rmip.stafforg.operate.add", "RMIPFramework", getLocale()) , LocaleDisplay.getI18nString("rmip.stafforg.operate.add", "RMIPFramework", getLocale()),"create.gif",null);
    private VCIJButton editButton = VCISwingUtil.createVCIJButton("",LocaleDisplay.getI18nString("rmip.stafforg.operate.modify", "RMIPFramework", getLocale()) ,LocaleDisplay.getI18nString("rmip.stafforg.operate.modify", "RMIPFramework", getLocale()), "modify.gif",null);
    private VCIJButton deleteButton = VCISwingUtil.createVCIJButton("",LocaleDisplay.getI18nString("rmip.stafforg.operate.delete", "RMIPFramework", getLocale()) ,LocaleDisplay.getI18nString("rmip.stafforg.operate.delete", "RMIPFramework", getLocale()), "delete.gif",null);
    
    private VCIJButton rightButton = VCISwingUtil.createVCIJButton("", "分配成员","分配成员", "user.gif" ,null);
    
    //三员模块的角色id
    private String roleId = "";
    
    private String logonUserId = "",logonRoleId;
    private String moduleName = "成员管理";
    private String iconName,moduleShowInfo ;
    
    private SpecialRoleClientObject specialRoleObject = new SpecialRoleClientObject();
    public SpecialRoleClientObject getSpecialRoleObject() {
        return specialRoleObject;
    }
 
    public void setSpecialRoleObject(SpecialRoleClientObject specialRoleObject) {
        this.specialRoleObject = specialRoleObject;
    }
    public String getRoleId() {
        return roleId;
    }
    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }
    public String getLogonUserId() {
        return logonUserId;
    }
    public void setLogonUserId(String logonUserId) {
        this.logonUserId = logonUserId;
    }
    public String getLogonRoleId() {
        return logonRoleId;
    }
    public void setLogonRoleId(String logonRoleId) {
        this.logonRoleId = logonRoleId;
    }
    
    public String getModuleName() {
        if (this.getFuncObj() != null && this.getFuncObj().getName() != null)
            return this.getFuncObj().getName();
        else if (moduleName != null && !moduleName.isEmpty())
            return moduleName;
        else
            return this.getClass().getName();
    }
    
    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }
    public String getIconName() {
        return iconName;
    }
    public void setIconName(String iconName) {
        this.iconName = iconName;
    }
    public String getModuleShowInfo() {
        return moduleShowInfo;
    }
    public void setModuleShowInfo(String moduleShowInfo) {
        this.moduleShowInfo = moduleShowInfo;
    }
 
    private LinkedList<VCIJButton> selfCustomButtons = new LinkedList<VCIJButton>();
    private void setButtons(){
        if(RightControlUtil.isRoot(userName)){
            selfCustomButtons.add(addButton);
            selfCustomButtons.add(editButton);
            selfCustomButtons.add(deleteButton);
        }
//        SpecialRoleClientObject[] specialRoleList;
//        try {
//            specialRoleList = new SpecialRoleClientDelegate().getSpecialRoleList();
//            for(SpecialRoleClientObject o : specialRoleList){
//                boolean roleIdFlag = false;
//                RoleObject[] userRoleObjects = getUserRoleObjects(userName);
//                String logonRoleId = o.getLogonRoleId();
//                for(RoleObject roleObj : userRoleObjects){
//                    String id = roleObj.getId();
//                    if(logonRoleId.equals(id)){
//                        roleIdFlag = true;
//                    }
//                }
//                if(roleIdFlag){
//                    selfCustomButtons.add(rightButton);
//                }
//            }
//        } catch (VCIError e) {
//            e.printStackTrace();
//        }
    }
    
    public UserTablePanel(FunctionObject funcObj,String roleID){
        super(funcObj);
        this.roleId = roleID;
        init();
//        checkPermission();
    }
    private void init() {
        LogonApplication.getUserEntityObject().setModules(this.getModuleName());
        initComponents();
        initAction();//初始化按钮点击事件
    }
    private void initComponents() {
        setLayout(new BorderLayout());
        initDepartment();
        add(initTablePanel(), BorderLayout.CENTER);
    }
    /** 权限检查的模块标识 **/
    private void checkPermission(){
        checkRight(RightControlUtil.CREATE, addButton);
        checkRight(RightControlUtil.UPDATE, editButton);
        checkRight(RightControlUtil.DELETE, deleteButton);
    }
    
    
    class MyDataProvider extends AbstractVCIJTableDataProvider<UserObject> {
        private searchInfoClass searchInfos = new searchInfoClass();
 
        public searchInfoClass getSearchInfos() {
            return searchInfos;
        }
 
        public void setSearchInfos(searchInfoClass searchInfos) {
            this.searchInfos = searchInfos;
        }
 
        @Override
        public UserObject[] getDatas(int pageNo, int pageSize) {
            UserObject[] userObj = null;
            try {
                userObj = new RightManagementClientDelegate(userEntityObj).fetchUserInfoByCondition(
                        searchInfos.getName() ,searchInfos.getUserName() , searchInfos.getDeptId(),roleId,userName,pageNo,pageSize);
                
            } catch (VCIException e) {
                VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e);
                return null;
            }
            
            return userObj;
        }
 
        @Override
        public VCIJTableNode<UserObject> getNewRowNode(UserObject dataObj) {
            VCIJTableNode<UserObject> node = new VCIJTableNode<UserObject>(dataObj);    
            node.setPropertyValue(getSpecialColumns()[0], dataObj.getTrueName());
            node.setPropertyValue(getSpecialColumns()[1], dataObj.getUserName());
            node.setPropertyValue(getSpecialColumns()[2], dataObj.getStatus()==1 ? "停用":"启用");
            /********BEGIN***********/
            /**密码策略**/
            try {
                PasswordStrategyObject userPasswordStrategyObj = new RightManagementClientDelegate(LogonApplication.getUserEntityObject())
                .fetchPasswordStrategyByUserId(dataObj.getId());
                node.setPropertyValue(getSpecialColumns()[3], userPasswordStrategyObj == null ? "" : userPasswordStrategyObj);
            } catch (VCIException e) {
                VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e);
            }
            
            /**锁定状态**/
            try {
                UserLogonObject lockObj = new RightManagementClientDelegate().getUserLogonObj(dataObj.getId());
                if (!StringUtils.isEmpty(lockObj.getPluserOid()))
                    node.setPropertyValue(getSpecialColumns()[4], lockObj.getPlWrongNum() == 0 ? "未锁定" : "锁定");
                else
                    node.setPropertyValue(getSpecialColumns()[4], "未锁定");
            } catch (VCIException e) {
                VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e);
            }
            /********END***********/
            
//            CompanyObject companyObj = null;
            DeptObject obj = null;
            RoleObject[] roles = null;
            String deptName = "";
            try {
                obj = new RightManagementClientDelegate(LogonApplication.getUserEntityObject())
                              .fetchDeptByUserId(dataObj.getId());
                if (obj != null){
                    if(!hashTable.containsKey((obj.getId()))){
                        deptName = getDeptObjectAllByDeptId(obj);
                        hashTable.put(obj.getId(), deptName);
                    }else{
                        deptName = hashTable.get(obj.getId());
                    }
                }
                
                roles = new RightManagementClientDelegate(LogonApplication.getUserEntityObject())
                .fetchRoleInfoByUserId(dataObj.getId());
            } catch (VCIException e) {
                VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework",e);
            }
            
            node.setPropertyValue(getSpecialColumns()[5], deptName);
            String roleNames = "";
            if (roles.length != 0){
                for(int j = 0 ; j < roles.length ; j ++){
                    if (j < roles.length -1){
                        roleNames += roles[j].getName() + ",";
                    }else {
                        roleNames +=  roles[j].getName();
                    }
                }
            }
            node.setPropertyValue(getSpecialColumns()[6], roleNames);
            node.setPropertyValue(getSpecialColumns()[7], dataObj.getEmail());
            node.setPropertyValue(getSpecialColumns()[8], dataObj.getDesc());
            node.setPropertyValue(getSpecialColumns()[9], dataObj.getIsDeptLeader().equals("1") ? "是" : "否");
            return node;
        }
 
        @Override
        public String[] getSpecialColumns() {
            return "姓名, 账号, 状态,密码策略,锁定状态,  所属部门, 拥有角色, 电子邮件, 描述,是否是部门领导".split(",");
        }
        
        //根据子部门查询所属的父类部门,并拼接成字符串形式,返回
        public String getDeptObjectAllByDeptId(DeptObject obj){
            String fetchDepName = "";
            try{
                DeptObject[] depObjectAll = new RightManagementClientDelegate(LogonApplication.getUserEntityObject())
                    .fetchDepartmentInfosBySonId(obj.getId());
            
                for(int i=depObjectAll.length-1;i>=0; i--){
                    fetchDepName += depObjectAll[i].getName()+"/";
                }
                if(fetchDepName.length() != 0){
                    fetchDepName = fetchDepName.substring(0, fetchDepName.length() - 1);
                }
            }catch (VCIException e) {
                VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework", e);
            }
            
            return fetchDepName;
            
        }
 
        @Override
        public int getTotal() {
            try {
                total = new RightManagementClientDelegate(userEntityObj).getUserTotalByCondition(
                        searchInfos.getName() ,searchInfos.getUserName() , searchInfos.getDeptId(), roleId,userName);
            } catch (VCIException e) {
                e.printStackTrace();
                VCIOptionPane.showError(LogonApplication.frame, "RMIPFramework",e);
            }
            
            return this.total;
        }
    }
    MyDataProvider dataProvider = new MyDataProvider();
    VCIJTablePanel<UserObject> tablePanel = new VCIJTablePanel<UserObject>(dataProvider);
    private VCIJPanel tablePanel(){
        setButtons();
        int startIndex = dataProvider.getDataColumnStartIndex()+5;
        LinkedHashMap<Integer, Integer> widthMaps = new LinkedHashMap<Integer, Integer>();
        widthMaps.put(startIndex++, 250);widthMaps.put(startIndex++, 250);widthMaps.put(startIndex++, 250);
        widthMaps.put(startIndex++, 250);widthMaps.put(startIndex++, 250);
        tablePanel.setColumnWidthMaps(widthMaps);
        tablePanel.setCustomButtons(selfCustomButtons);
        tablePanel.setShowPaging(true);
        tablePanel.setCustomButtonFlowAlign(FlowLayout.CENTER);
        tablePanel.setPageButtonFlowAlign(FlowLayout.CENTER);
        tablePanel.setShowExport(false);
        tablePanel.buildTablePanel();
        tablePanel.refreshTableData();
        return tablePanel;
    }
    
    private JPanel initTablePanel(){
        JPanel pal = new JPanel();
        pal.setLayout(new BorderLayout());
        pal.setBorder(new TitledBorder("成员管理"));
        
        JPanel searchPal = new JPanel();
        searchPal.setLayout(null);
        searchPal.setPreferredSize(new Dimension(600, 40));
        
        
        
        x = 20; y = 7; width = 40; height = 23; 
        trueNameLabel.setBounds(x, y, width, height);
        
        x = trueNameLabel.getX() +  trueNameLabel.getWidth(); width = 120;
        trueNameText.setBounds(x, y, width, height);
        
        x = trueNameText.getX() + trueNameText.getWidth() + height;width = 40;
        nameLabel.setBounds(x, y, width, height);
        
        x = nameLabel.getX() + nameLabel.getWidth() ; width = 120;
        userNameText.setBounds(x, y, width, height);
        
        //x = 20; y = 50; width = 40; height = 25; 
        width=80;
        x += userNameText.getWidth() + hspan*3; 
        searchButton.setBounds(x, y, width, height);
        
        x += searchButton.getBounds().width + hspan;
        clearButton.setBounds(x, y, width, height);
        
        searchPal.add(trueNameLabel);
        searchPal.add(trueNameText);
        searchPal.add(nameLabel);
        searchPal.add(userNameText);
        searchPal.add(searchButton);
        searchPal.add(clearButton);
        
        pal.add(searchPal, BorderLayout.NORTH);
        pal.add(tablePanel(), BorderLayout.CENTER);
        pal.setVisible(true);
        return pal;
    }
    
    
    /**
     * 初始化部门
     *
     */
    private void initDepartment() {
        departmentComBox.addItem(new DeptObject());
    }
    
    private void initAction(){
        
        tablePanel.getTable().addMouseListener(new MouseAdapter() {
            public void mouseReleased(MouseEvent e) {
                mousePressed(e);
            }
            
            public void mousePressed(MouseEvent e) {
                Point p = e.getPoint();
                int row = tablePanel.getTable().rowAtPoint(p);
                if(row < 0)  return;
//                UserObject obj = tablePanel.getTableModel().getList().get(row).getObject();
                
                /**解锁状态是否启用**/
//                String lockName = (String) tablePanel.getTableModel().getList().get(row).getPropertyValue("锁定状态");
//                boolean lockFlag = lockName == "未锁定" ? true : false;
//                if(lockFlag) {
//                    deblockButton.setEnabled(false);
//                }else {
//                    deblockButton.setEnabled(true);
//                }
                
            }
        });
        searchButton.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                searchButton_actionPerformed();
            }
        });
        
        clearButton.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                clearButton_actionPerformed();
            }
        });
        addButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(ActionEvent e) {
                addButton_conform();
            }
        });
        editButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(ActionEvent e) {
                editButton_conform();
            }
        });
        deleteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(ActionEvent e) {
                deleteButton_actionPerformed();
            }
        });
        
        rightButton.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent arg0) {
                 rightButton_conform();
             }
         });
    }
    
    /**
     * 分配成员事件
     */
    private void rightButton_conform(){
        RoleObject  rightRoleObj = new RoleObject();
        rightRoleObj.setId(roleId);
        rightRoleObj.setType((short)1);
        SelectUserDialog dialog = new SelectUserDialog(rightRoleObj);
        dialog.setVisible(true);
        tablePanel.refreshTableData();
    }
    
    /**
     * 搜索事件
     */
    private void searchButton_actionPerformed(){
        searchInfoClass searchInfo = new searchInfoClass();
        searchInfo.setName(this.gettrueNameText().trim());
        searchInfo.setUserName(this.getUserNameText().trim());
        searchInfo.setDeptId(this.getDeptId());
        
        dataProvider.setSearchInfos(searchInfo);
        this.tablePanel.refreshTableData();
    }
    
    private void clearButton_actionPerformed(){
        
        this.userNameText.setText("");
        this.trueNameText.setText("");
        this.departmentComBox.setSelectedIndex(0);
        departmentComBox.setToolTipText("");
        
        searchInfoClass info = new searchInfoClass();
        dataProvider.setSearchInfos(info);
        tablePanel.refreshTableData();
    }
    /**
     * 添加事件
     */
    private void addButton_conform(){
        new UserDialog(this,transmitTreeObject,"add");
    }
    
    /**
     * 修改事件
     */
    private void editButton_conform(){
        
        int len = tablePanel.getSelectedRowIndexs().length;
        if(len == 0){
            VCIOptionPane.showMessage(this, 
                    "请选择人员再进行操作!");
            return;
        }
        if (len > 1){
            VCIOptionPane.showMessage(this, 
                    LocaleDisplay.getI18nString("rmip.stafforg.operate.useredit2", "RMIPFramework", getLocale()));
            return;
        }
        
        UserObject obj = tablePanel.getSelectedRowObjects().get(0);
        new UserDialog(this,transmitTreeObject , obj ,"edit");
    }
    
    /**
     * 删除事件
     */
    private void deleteButton_actionPerformed(){
        int len = tablePanel.getSelectedRowIndexs().length;
        if(len == 0){
            VCIOptionPane.showMessage(this, 
                    LocaleDisplay.getI18nString("rmip.stafforg.operate.userdelete1", "RMIPFramework", getLocale()));
            return;
        }
        List<UserObject> objList = tablePanel.getSelectedRowObjects();
        for(int i=0;i<objList.size();i++){
            String name = LogonApplication.getUserEntityObject().getUserName();
            String userName = objList.get(i).getUserName();
            if(name.equals(userName)){
                VCIOptionPane.showMessage(this, 
                        "不可以删除自己!");
                return;
            }
        }
        int ask = VCIOptionPane.showQuestion(this,
                    LocaleDisplay.getI18nString("rmip.stafforg.operate.userdelete2", "RMIPFramework", getLocale()));
        if(ask == 1) return;
        
        String[] puids = new String[len];
        for (int i = 0; i < len; i++) {
            UserObject obj = tablePanel.getSelectedRowObjects().get(i);
            puids[i] = obj.getId();
        }
        boolean rs=true;
        try {
            rs = new RightManagementClientDelegate(LogonApplication.getUserEntityObject()).deleteUser(puids);
        } catch (VCIException e) {
            VCIOptionPane.showError(LogonApplication.frame,"RMIPFramework", e);
            return;
        }
        if (!rs) {
            return;
        }
        tablePanel.refreshTableData();
    }
    
    public void deblockButton_actionPerformed(){
        
        int len = tablePanel.getSelectedRowIndexs().length;
        if(len == 0){
            VCIOptionPane.showMessage(this, 
                    "请选择要进行解锁操作的人员!");
            return;
        }
        String[] puids = new String[len];
        for (int i = 0; i < len; i++) {
            UserObject obj = tablePanel.getSelectedRowObjects().get(i);
            puids[i] = obj.getId();
        }
        try {
            new RightManagementClientDelegate(LogonApplication.getUserEntityObject()).deblock(puids);
        } catch (VCIException e) {
            VCIOptionPane.showError(LogonApplication.frame,"RMIPFramework",e);
            return;
        }
        VCIOptionPane.showMessageDialog(LogonApplication.frame, "解锁成功!");
        tablePanel.refreshTableData();
    }
    /**
     * 获取姓名
     * @return
     */
    public String gettrueNameText(){
        return trueNameText.getText().trim();
    }
    
    /**
     * 获取用户名
     * @return
     */
    public String getUserNameText(){
        return userNameText.getText().trim();
    }
    
    /**
     * 
     * <p>Description: 获取部门ID</p>
     * 
     * @author wangxl
     * @time 2012-5-14
     * @return
     */
    public String getDeptId(){
        String deptId = "";
        if ((DeptObject)departmentComBox.getSelectedItem() != null && ((DeptObject)departmentComBox.getSelectedItem()).getId() != null ){
            deptId = ((DeptObject)departmentComBox.getSelectedItem()).getId();
        }
        return deptId;
    }
    
    public class searchInfoClass {
        private String name = "";
        private String userName = "";
        private String roleId = "";
        private String deptId = "";
        
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getUserName() {
            return userName;
        }
        public void setUserName(String userName) {
            this.userName = userName;
        }
        public String getRoleId() {
            return roleId;
        }
        public void setRoleId(String roleId) {
            this.roleId = roleId;
        }
        public String getDeptId() {
            return deptId;
        }
        public void setDeptId(String deptId) {
            this.deptId = deptId;
        }
        
    }
    
    public static void main(String[] args){
//        UserEntityObject userEntityObject = new UserEntityObject();
//        userEntityObject.setUserName("admin");
//        LogonApplication.userEntityObject =userEntityObject;
//        UserObject userObject = new UserObject();
//        userObject.setUserName("admin");
//        LogonApplication.userObject = userObject;
//        VciFrame frame = new VciFrame(userObject);
//        LogonApplication.frame = frame;
//        funcObj= new FunctionObject();
//        UserTablePanel utp = new UserTablePanel(funcObj);
//        utp.init();
//        frame.add(utp);
//        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
//        frame.setFocusableWindowState(true);
//        frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
//        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
//        Dimension frameSize = frame.getPreferredSize();
//        frameSize.height = screenSize.height / 5 * 4;
//        frameSize.width = screenSize.width / 5 * 4 + 20;
//        frame.setSize(frameSize);
//        frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
//        frame.setVisible(true);
//        frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
    }
    
    private RoleObject[] getUserRoleObjects(String userName){
        RoleObject[] roles = {};
        try {
            UserObject userObject = LogonApplication.getUserObject();
            String userId = userObject.getId();
            roles = new RightManagementClientDelegate(LogonApplication.getUserEntityObject()).fetchRoleInfoByUserId(userId);
        } catch (VCIException e) {
            e.printStackTrace();
        }
        return roles;
    }
    
    @Override
    public String getUserID() {
        return logonUserId;
    }
    @Override
    public String getRoleID() {
        return logonRoleId;
    }
    @Override
    public JPanel getModuleComponent() {
        this.setButtons();
        tablePanel.setCustomButtons(selfCustomButtons);
        tablePanel.buildTablePanel();
        tablePanel.refreshTableData();
        return this;
    }
}