studyKeyWords.jsp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%@ page import ="com.sysmodel.datamodel.xmlmodel.impl.*"
  3. %>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <title>根据配置文件获得需要统一的字段</title>
  8. </head>
  9. <body topmargin="0">
  10. <br>
  11. <%
  12. ArrayList arrMdpClasses = SysModelImpl.getInstance().getMdpClasses();
  13. MdpClassImpl imp = null;
  14. Map<String, Vector<String>> FieldKeysMap = new HashMap<String, Vector<String>>();
  15. Vector classesVec = new Vector();
  16. for (int i = 0 ; i< arrMdpClasses.size() ; i++ ){
  17. imp = (MdpClassImpl)arrMdpClasses.get(i);
  18. List mdpAttributes = imp.getAllMdpAttributes();
  19. MdpAttributeImpl mdpAttribute = null;
  20. classesVec = new Vector();
  21. for (int j = 0 ; j<mdpAttributes.size() ; j++ ){
  22. mdpAttribute = (MdpAttributeImpl)mdpAttributes.get(j);
  23. String CNname = mdpAttribute.getDescription().trim();
  24. if(FieldKeysMap.get(CNname) == null){
  25. classesVec = new Vector();
  26. classesVec.add(imp.getClassid() + "." + mdpAttribute.getName());
  27. FieldKeysMap.put(CNname,classesVec);
  28. } else {
  29. classesVec = new Vector();
  30. classesVec = FieldKeysMap.get(CNname);
  31. classesVec.add(imp.getClassid() + "." + mdpAttribute.getName());
  32. FieldKeysMap.put(CNname,classesVec);
  33. }
  34. }
  35. }
  36. Set set = FieldKeysMap.entrySet();
  37. Iterator iterator = set.iterator();
  38. %>
  39. <table align="center" width="80%" border="1" class="ltab2">
  40. <tr>
  41. <td><b>中文名称</b></td>
  42. <td><b>出现次数</b></td>
  43. <td><b>英文名命名分析</b></td>
  44. </tr>
  45. <%
  46. while (iterator.hasNext()) {
  47. Map.Entry mapentry = (Map.Entry)iterator.next();
  48. classesVec = (Vector)mapentry.getValue();
  49. String sUseCondion = "";
  50. String EnName = (String)classesVec.firstElement();
  51. EnName = EnName.substring(EnName.indexOf(".") + 1);
  52. boolean bAllEquals = true;
  53. StringBuffer sb = new StringBuffer();
  54. for (int j = 0 ; j < classesVec.size() ; j ++ ){
  55. String tempStr = (String)classesVec.get(j);
  56. sb.append( tempStr + "<br>");
  57. if(bAllEquals == true && tempStr.indexOf(EnName) == -1){
  58. bAllEquals = false;
  59. }
  60. }
  61. if(bAllEquals){
  62. sUseCondion = "字段一致翻译为:" + EnName;
  63. } else {
  64. sUseCondion = "<b>字段翻译没有保持一致,具体情况:<br>"+sb.toString()+"</b>";
  65. }
  66. if(classesVec.size() > 1){
  67. %>
  68. <tr>
  69. <td><%= (String)mapentry.getKey()%></td>
  70. <td><%= classesVec.size()%></td>
  71. <td><%= sUseCondion%></td>
  72. </tr>
  73. <%
  74. }
  75. }
  76. %>
  77. </table>
  78. </body>
  79. </html>