1. 项目分析
1.1. 产品和项目区别?
产品 先投资 ,做出产品, 再去销售 (QQ、 360 )
项目 投标 ,分为甲方 (项目应用方)和乙方 (项目开发方), 甲方先给乙方 项目前期款, 交付项目后,收取尾款 。
1.2. BOS项目规模
项目周期 : 1年多
纯编码时间 : 3个多月 , 项目组开发人员 :20多人
1.3. 系统分类
OA 自动化办公
CRM 客户关系管理
ERP 是针对物资资源管理(物流)、人力资源管理(人流)、财务资源管理(财流)、信息资源管理(信息流)集成一体化的企业管理软件
BOS 是 ERP 一个部分,在需求中需要和财务系统 、CRM系统 对接
1.4. 软件开发流程
需求调研 (分析) —- 系统设计 — 编码 — 测试 — 实施和运维
1.5. BOS 业务分析
开发任务 : 三个业务模块
基础设置模块(基础数据模块 ) —物流基础数据 (取派人员信息、 区域信息 、 区域分配信息 、 线路信息 …. ) 对应 需求 2.6 章节
取派模块 对应需求 2.7 业务受理 2.8 调度 —– 接收客户业务诉求 ,将业务数据录入到系统
中转模块 (物流中数据管理) —- 2.9 以后
两个系统功能模块 : 用户 和 权限
时间安排 : JBPM 4天 、搭建环境2天 、权限管理 1天
1.6. 项目开发环境
开发环境 : window + tomcat6/7 + myeclipse + mysql
产品环境 : linux (企业服务器版) + Oracle + WebLogic/JBOSS
2. 项目导入
将 bos 项目代码导入 myeclipse 开发工具
建议新建web项目, 将代码对应部分复制到项目中 !
(MyEclipse、Eclipse、 Maven )
通常三个 source folder
src 存放源码
resources、config 存放配置文件
test 存放测试用例
struts2 约定要求,将JSP页面 放入WEB-INF 下 !!!!
struts2 拦截器,拦截 Action的访问 !!!
问题: Filter 和 Interceptor 有何区别?
Filter 可以拦截所有web 资源
Interceptor 只能拦截Action
问题: 将很多JSP都放入WEB-INF 不能直接访问,通过Action访问,需要为每一个JSP配置一个Action吗?
<!-- 需要进行权限控制的页面访问 -->
<action name="page_*_*">
<result type="dispatcher">
/WEB-INF/pages/{1}/{2}.jsp
</result>
</action>
访问 page_a_b.action 映射到 /WEB-INF/pages/a/b.jsp
/page_common_index.action 主页 /WEB-INF/pages/common/index.jsp
<jsp:forward page="/page_common_index.action"></jsp:forward>
问题: 主页Action 也需要走struts的Filter ,Filter 默认只在请求方式下拦截
如果没有配置 dispatcher : forward 不会在转发情况下执行Filter
3. 使用maven进行项目构建
MyEclipse 自带maven 插件
Eclipse 需要单独安装maven插件
3.1. Maven 在企业中怎么用的 ?
Maven : 项目构建工具 ,进行项目编译、测试、打包、运行、发布 ….
使用 maven将工程进行组件化 ,项目分为 表现层、业务层、 数据层 属于maven创建 三个项目 ,分别进行三层开发
Maven 和 Jenkins (hudson) 对项目进行持续集成
企业中搭建私服
3.2. 建立maven骨架的项目,运行bos
1、 下载和解压 maven 的zip包
2、 在myeclipse 配置外部 maven
3、 配置仓库setting文件 和 仓库位置
默认位置 C:\Documents and Settings\seawind\.m2
(这个文件夹没有 settings,xml )
将解压maven目录/ conf/ settings.xml
复制 C:\Documents and Settings\seawind\.m2
在 settings.xml 指定本地仓库位置
Maven 原理, 使用坐标导入jar包,先在本地仓库找,如果没有,会去网络上仓库下载 !
4、 将 repository.rar 解压,覆盖本机原来 的仓库
5、 在myeclipse 建立maven工程
可以自己选择骨架
quickstart 骨架, javase的maven项目
webapp 骨架, javaee的maven项目