田源
2025-01-09 8a166a60cfd1a2e593ffa103d10c0dc224fc8628
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
package com.vci.client.workflow.task;
 
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
 
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
 
import com.vci.client.LogonApplication;
import com.vci.client.framework.rightConfig.object.FunctionObject;
import com.vci.client.ui.exception.VCIException;
import com.vci.client.ui.swing.components.VCIJDialog;
import com.vci.client.workflow.commom.ClientHelper;
import com.vci.client.workflow.delegate.ProcessCustomClientDelegate;
import com.vci.corba.common.VCIError;
import com.vci.corba.workflow.data.FlowApproveHistoryInfo;
 
/**
 * 查看流程历史
 * 
 * @author Administrator
 * 
 */
public class ViewWorkfolwHistoryByPlatformDialog extends VCIJDialog {
 
    private static final long serialVersionUID = 1461586100225135416L;
 
    
    private JTable historyTable;
 
    private HistoryTableModelByPlatform historyTableModel;
    
    FunctionObject funcObject = new FunctionObject();
 
    private String[] executionIds;
 
    private JButton commit;
    private JButton cancel;
    private JComboBox outComeComb;
 
 
    private String outCome;
    private String desc;
    private String[] taskId;
 
 
    private String[] taskName;
    
    private boolean saveFlag = false;
 
 
    private JTextArea descTextArea;
 
 
    private String[] status;
    
    public boolean isSaveFlag() {
        return saveFlag;
    }
 
    public void setSaveFlag(boolean saveFlag) {
        this.saveFlag = saveFlag;
    }
 
    public String getOutCome() {
        return outCome;
    }
 
    public void setOutCome(String outCome) {
        this.outCome = outCome;
    }
 
    public String getDesc() {
        return desc;
    }
 
    public void setDesc(String desc) {
        this.desc = desc;
    }
 
    public ViewWorkfolwHistoryByPlatformDialog(String[] executionIds) {
        super(LogonApplication.frame, true);
        this.executionIds = executionIds;
        
        initUI();
        initData();
//        this.setLocationRelativeTo(null);
    }
 
    private void initData() {
        ProcessCustomClientDelegate processCustomClientDelegate = new ProcessCustomClientDelegate();
//        FlowApproveHistoryInfo[] historyActivity = null;
        List<FlowApproveHistoryInfo> historyActivity = new ArrayList<FlowApproveHistoryInfo>();
        try {
            for(String executionId : executionIds){
                FlowApproveHistoryInfo[] historyActivityByProInsId = processCustomClientDelegate.getHistoryActivityByProInsId(executionId);
                for(FlowApproveHistoryInfo flowApproveHistoryInfo : historyActivityByProInsId){
                    historyActivity.add(flowApproveHistoryInfo);
                }
            }
            historyTableModel.setData(historyActivity.toArray(new FlowApproveHistoryInfo[]{}));
        } catch (VCIError e) {
            e.printStackTrace();
        }
 
    }
 
    private void initUI() {
        setSize(780, 600);
        centerToScreen();
 
        JPanel panel = new JPanel();
        getContentPane().add(panel, BorderLayout.CENTER);
        panel.setLayout(new BorderLayout(0, 0));
 
        JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
        panel.add(tabbedPane, BorderLayout.CENTER);
        
        JPanel panel_2 = new JPanel();
        panel_2.setLayout(null);
        
        JLabel label = new JLabel("审批:");
        label.setBounds(72, 33, 36, 15);
        panel_2.add(label);
        
        outComeComb = new JComboBox();
        outComeComb.setBounds(155, 30, 453, 21);
        panel_2.add(outComeComb);
        
        JLabel label_1 = new JLabel("审批意见:");
        label_1.setBounds(61, 124, 60, 74);
        panel_2.add(label_1);
        
        JScrollPane scrollPane_1 = new JScrollPane();
        scrollPane_1.setBounds(155, 86, 453, 143);
        panel_2.add(scrollPane_1);
        
        descTextArea = new JTextArea();
        scrollPane_1.setViewportView(descTextArea);
        
        JPanel historyPanel = new JPanel();
        tabbedPane.addTab("流程历史", null, historyPanel, null);
        historyPanel.setLayout(new BorderLayout(0, 0));
 
        JScrollPane scrollPane = new JScrollPane();
        historyPanel.add(scrollPane, BorderLayout.CENTER);
 
        historyTableModel = new HistoryTableModelByPlatform();
        historyTable = new JTable(historyTableModel);
        historyTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        scrollPane.setViewportView(historyTable);
        historyTable.setRowHeight(25);
 
 
    }
 
    /**
     * 居中屏幕
     */
    private void centerToScreen() {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension componentSize = getSize();
        if (componentSize.height > screenSize.height) {
            componentSize.height = screenSize.height;
        }
 
        if (componentSize.width > screenSize.width) {
            componentSize.width = screenSize.width;
        }
 
        setLocation((screenSize.width - componentSize.width) / 2, (screenSize.height - componentSize.height) / 2);
    }
 
    private String getI18nString(String spCode) {
        return ClientHelper.getI18nStringForWorkflow(this.getClass().getName() + "." + spCode, this.getLocale());
    }
 
    private String getI18nStringByCode(String spCode) {
        return ClientHelper.getI18nStringForWorkflow(spCode, this.getLocale());
    }
}