| | |
| | | import java.awt.*; |
| | | import java.awt.event.ActionEvent; |
| | | import java.awt.event.ActionListener; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public class TestIntegrateFrame { |
| | | public static JButton apply = new JButton(); |
| | | public static JTextField text = new JTextField(); |
| | | public static void main(String[] args) { |
| | | |
| | | List<Integer> list=new ArrayList<>(); |
| | | list.add(1); |
| | | list.add(5); |
| | | list.add(6); |
| | | list.add(3); |
| | | list.add(2); |
| | | list.add(4); |
| | | List<Integer> classifyVOS =list.stream().sorted(((o1, o2) -> o2.compareTo(o1))).collect(Collectors.toList()); |
| | | int level=1; |
| | | int tt=1; |
| | | if (classifyVOS.size() >= level && level > 0) { |
| | | tt = classifyVOS.get(level - 1); |
| | | } |
| | | |
| | | final JFrame j = new JFrame(); |
| | | j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
| | | JPanel p = new JPanel(); |
| | |
| | | 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 clsfName = "交付产品"; |
| | | String deptName = ""; |
| | | CodeApplyFor410Dialog dialog = new CodeApplyFor410Dialog(j, clsfName,deptName); |
| | | String code = dialog.getCodeValue(); |
| | | dialog.getAttributeValue("mi"); |
| | | 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+"---"); |
| | | } |