产品手册优化平台的设计毕业设计说明书(编辑修改稿)内容摘要:

字段名 字段说明 类型 长度 是否可以为空 id id long 18 (主键)否 admin_id 处理管理员 id int 10 否 user_id 提出问题用户 id int 10 否 document_id 文档 id int 10 否 product_series 产品类型 varchart 100 否 error_type 问题类型 varchart 100 否 status 问题状态 varchart 100 否 time 提出时间 time 30 否 accept 是否接受 varchart 10 否 solve_time 解决时间 time 10 是 remarks 标记 varchart 100 是 福建农林大学本科毕业设计说明书 12 5 技术要点与难点 设计思想及分层结构 本项目开发采用的是 MVC 的分层结构方法。 MVC 模式是一种复合设计模式,一种在特定场合用于解决某种实际问题来得出的可 以反复实践的解决方案。 巧合的是他也有三个事物组成,于是乎人们就有了一种想当然的对应关系:展示层 View;业务逻辑层 Control;持久层 Model。 首先 MVC 中的三个事物之间并不存在明显的层次结构,没有明显的向下依赖关系,相反的, View 和 Model 往往是比较独立的,而 Control 是连接两者的桥梁,他们更像是横向的切分。 这样一来就出现一个结果, MVC 中每个块都是可以独立测试的,而三层结构中,上层模块的运行测试势必要提供下层代码或者提供相同接口的桩。 相对来说, MVC 复杂得多,但是结构更清晰,耦合性更低。 图 51 代码结构分层 主要分层的 介绍 : 1. DB 对链接数据库的封装,主要实现数据库的链接和释放。 2. filter 过滤器,主要进行权限管理。 3. json 主要是进行对象封装成 json 或 json 转换成对象 4. pojo 表对应的对象,有助于封装数据库。 5. SystemData 系统初始化数据的获取,封装了界面上选项的动态配置 福建农林大学本科毕业设计说明书 13 6. Tool 工具层,提供各种工具类。 可以进行快速开发,减少重复代码。 7. dao 对象数据操作层 word 转换成 html 把 word 转换成 html,在转换的过程中很容易造成格式 发生变化的问题。 我们看到 word会看到 word 另存为中有转换成 html 的选项。 因此最好是可以通过代码调动系统的 word转换 html 的实现的方法。 可以保证转换的结果是简洁的,不会有格式上的问题。 上网查找,发现 Jacob 可能符合该要求。 JACOB is a JAVACOM Bridge that allows you to call COM Automation ponents from Java. It uses JNI to make native calls into the COM and Win32 libraries. The JACOB project started in 1999 and is being actively used by thousands of developers worldwide. As an opensource project, it has benefitted from the bined experience of these users, many of whom have made modifications to the code and submitted them back for inclusion in the project. 上面官网介绍可知, jacob 调用的就是本地安装的 word,这样就要求服务器也要安装word,否则系统无法正常运行。 抓取 word 的文档结构 在浏览的时候用户肯定希望有文档的结构图,可以方便定位。 可能想到的方案就两个 : 1. 直接解析 word,获得文档结构图。 2. 解析转换成 html 后的文件,在获得文档结构图。 在方案 2 中就需要对 html 进行解析的工具,网上提供的开源工具主要有一下几个,到时候可以根据需求进行筛选 : 1. htmlparser : HTML Parser is a Java library used to parse HTML in either a linear or nested fashion. Primarily used for transformation or extraction, it features filters, visitors, custom tags and easy to use JavaBeans. It is a fast, robust and well tested package. 2. html4j: HTMLDoc is an encapsulation of an HTML document, with a simple permissive parser which can handle even most of the bad, nonpliant HTML documents of the real world. 数据库动态配置 为了方便对数据库的管理,把链接数据库的必要信息全部都写到配置文件中,后期对项目的发布有重大意义。 可以方便管理员修改数据库的密码。 package。 import。 import。 福建农林大学本科毕业设计说明书 14 import。 import。 import。 import。 import。 import。 import。 import。 public class DBMessage { private static String JDBC =。 private static String url = jdbc: private static String user = root。 private static String password = root。 /** * private static String JDBC。 private static String url。 private static String user。 private static String password。 */ static { (类初始化 )。 InputStream in = ().getResourceAsStream()。 Properties pro = new Properties()。 try { (in)。 JDBC = (JDBC)。 url = (url)。 user = (user)。 password = (password)。 } catch (FileNotFoundException e) { ()。 } catch (IOException e) { ()。 } } 福建农林大学本科毕业设计说明书 15 public static String getMessage(String key){ (key = + key)。 String value = null。 InputStream in = ().getResourceAsStream()。 Properties pro = new Properties()。 try { (in)。 value = (key)。 } catch (FileNotFoundException e) { ()。 } catch (IOException e) { ()。 } return ()。 } public static String getUser() { if ( == null) { = getMessage(user)。 } return。 } public static String getPassword() { if ( == null) { = getMessage(password)。 } return。 } public static String getJDBC() { if ( == null) { = getMessage(JDBC)。 } return。 } public static String getUrl() { 福建农林大学本科毕业设计说明书 16 if ( == null) { = getMessage(url)。 } return。 } public static Connection getConnection () { Connection connection = null。 try { (getJDBC()).newInstance()。 connection = (getUrl(), getUser(), getPassword())。 } catch (Exception e) { connection = null。 ()。 } return connection。 } /** * 关闭数据库 * @param connection * @param rreparedStatement * @param resultSet */ public static void closeAll(Connection connection, PreparedStatement rreparedStatement,ResultSet resultSet) { try { if (resultSet != null) { ()。 resultSet = null。 } if (rreparedStatement != null) { ()。 rreparedStatement = null。 } 福建农林大学本科毕业设计说明书 17 if (connection != null) { ()。 connection = null。 } } catch (SQLException e) { ()。 } } /** * 关闭数据库 * @param connection * @param rreparedStatement * @param resultSet */ public static void closeAll(Connection connection, Statement statement,ResultSet resultSet) { try { if (resultSet != null) { ()。 resultSet = null。 } if (statement != null) { ()。 statement = null。 } if (connection != null) { ()。 connection = null。 } } catch (SQLException e) { ()。 } } 福建农林大学本科毕业设计说明书 18 public static void main(String[] args) { InputStream in = ().getResourceAsStream()。 } } 每次修改数据库的密码,只要对应修改配置文件 就可以。 而且对数据库的链接和释放都进行了必要的封装。 福建农林大学本科毕业设计说明书 19 6 编码实现 主页的实现 图 61 主页的实现效果图 主要源代码 : /*! * Ext JS Library *定义主页整体布局 */ FeedViewer = {}。 (function(){ ()。 // 针对应用程序配置默认 的 state provider (new ({s。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。