123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
- <%@ page import ="com.sysmodel.datamodel.xmlmodel.impl.*"
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>根据配置文件获得需要统一的字段</title>
- </head>
- <body topmargin="0">
- <br>
- <%
- ArrayList arrMdpClasses = SysModelImpl.getInstance().getMdpClasses();
- MdpClassImpl imp = null;
- Map<String, Vector<String>> FieldKeysMap = new HashMap<String, Vector<String>>();
- Vector classesVec = new Vector();
- for (int i = 0 ; i< arrMdpClasses.size() ; i++ ){
-
- imp = (MdpClassImpl)arrMdpClasses.get(i);
- List mdpAttributes = imp.getAllMdpAttributes();
- MdpAttributeImpl mdpAttribute = null;
- classesVec = new Vector();
-
- for (int j = 0 ; j<mdpAttributes.size() ; j++ ){
- mdpAttribute = (MdpAttributeImpl)mdpAttributes.get(j);
-
- String CNname = mdpAttribute.getDescription().trim();
- if(FieldKeysMap.get(CNname) == null){
-
- classesVec = new Vector();
- classesVec.add(imp.getClassid() + "." + mdpAttribute.getName());
- FieldKeysMap.put(CNname,classesVec);
- } else {
-
- classesVec = new Vector();
- classesVec = FieldKeysMap.get(CNname);
- classesVec.add(imp.getClassid() + "." + mdpAttribute.getName());
- FieldKeysMap.put(CNname,classesVec);
-
- }
- }
- }
-
-
- Set set = FieldKeysMap.entrySet();
- Iterator iterator = set.iterator();
- %>
- <table align="center" width="80%" border="1" class="ltab2">
- <tr>
- <td><b>中文名称</b></td>
- <td><b>出现次数</b></td>
- <td><b>英文名命名分析</b></td>
- </tr>
- <%
- while (iterator.hasNext()) {
-
- Map.Entry mapentry = (Map.Entry)iterator.next();
- classesVec = (Vector)mapentry.getValue();
-
-
- String sUseCondion = "";
- String EnName = (String)classesVec.firstElement();
- EnName = EnName.substring(EnName.indexOf(".") + 1);
-
- boolean bAllEquals = true;
- StringBuffer sb = new StringBuffer();
- for (int j = 0 ; j < classesVec.size() ; j ++ ){
- String tempStr = (String)classesVec.get(j);
- sb.append( tempStr + "<br>");
- if(bAllEquals == true && tempStr.indexOf(EnName) == -1){
- bAllEquals = false;
- }
- }
-
- if(bAllEquals){
- sUseCondion = "字段一致翻译为:" + EnName;
- } else {
- sUseCondion = "<b>字段翻译没有保持一致,具体情况:<br>"+sb.toString()+"</b>";
- }
- if(classesVec.size() > 1){
- %>
- <tr>
- <td><%= (String)mapentry.getKey()%></td>
- <td><%= classesVec.size()%></td>
- <td><%= sUseCondion%></td>
- </tr>
- <%
- }
- }
- %>
-
-
- </table>
- </body>
- </html>
|