ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
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
package com.vci.client.omd.btm.ui;
 
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JOptionPane;
 
import com.vci.corba.common.VCIError;
 
public class ConsistencyCheckListener implements ActionListener{
    
    @Override
    public void actionPerformed(ActionEvent e) {
        checkBtm();
    }
    
    private void checkBtm(){
        try {
            String[] result = BtmClient.getService().btmConsistencyCheck();
            Map<String, String> map = new HashMap<String, String>();
            for(int i = 0; i < result.length; i++){
                String info = result[i];
                if(info.equals("")){
                    continue;
                }
                String[] infos = info.split("/DML");
                String typeName = infos[0];
                String dml = infos[1];
                map.put(typeName, dml);
            }
            if(map.size() < 1){
                JOptionPane.showMessageDialog(BtmPanel.getInstance(), "数据库中的表结构与类型一致", "无需修复", JOptionPane.INFORMATION_MESSAGE);
                return;
            }else{
                ConsistencyCheckDialog dialog = new ConsistencyCheckDialog(map);
                dialog.setVisible(true);
            }
        } catch (VCIError e) {
            e.printStackTrace();
        }
    }
}