xiejun
2023-09-18 8ef555ab552cbf5945be1ccc51e3d5d419587866
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
package com.vci.rmip.code.client.codeapply.Apply410;
 
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.Map;
 
public class TestIntegrateFrame {
    public static JButton apply = new JButton();
    public static JTextField text = new JTextField();
    public static void main(String[] args) {
        final JFrame j = new JFrame();
        j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel p = new JPanel();
        j.setSize(200, 200);
        apply.setText("test");
        apply.setSize(80, 25);
        text.setPreferredSize(new Dimension(100,25));
        p.add(text);
        p.add(apply);
        j.add(p);
        j.setLocation(new Point(500,300));
        j.setVisible(true);
        apply.addActionListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e) {
                Map<String, String> map = new HashMap<String, String>();
//                map.put("原材料替换件", "YUANCAILIAOTIHUANJIAN");
//                map.put("原材料部件", "1");
//                map.put("简易示波器", "");
                map.put("", "YCL");
                String clsfName = "交付产品";
                String deptName = "";
                String [] fields=new String[]{"groupcode"};//属性内部字段
                String [] values=new String[]{"000002"};//属性值
                //CodeApplyFor410Dialog dialog = new CodeApplyFor410Dialog(j, clsfName,deptName);
                CodeApplyFor410Dialog dialog = new CodeApplyFor410Dialog(j, clsfName,deptName,fields,values);
                String code = dialog.getCodeValue();// 获取集团码/企业码
                dialog.getAttributeValue("mi");//获取相关返回属性
                text.setText(code + "_" + dialog.getAttributeValue("name"));
                System.out.println("code:---"+code+"---");
            }
        });
    }
}