版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、_一、搭建开发环境工具: Eclipse数据库: Oracle安装 NC 模块并建立帐套用户。1.1 安装和配置插件首先下载系列插件,然后安装 ,安装即把插件直接考贝Eclipse的 plugin 目录下,由于Eclipse 的 bug,如果曾经安装过,请把configuration目录下的内容除了config.ini 外其他文件都删除,在此启动Eclipse即可。设置 Window->Prefreence->MDE DevelopmentNC Home:基础技术平台的运行环境根目录。复选框 <Include client class/jar in Build Classpa
2、th>:表示是否把模块的client下的类加入到构件路径。如果你的模块不依赖别的模块的客户端代码,请取消该选择。Datasourse-可编辑修改 -_DriverList:开发环境的配置信息 (在配置时,要把其他的配置信息删除掉,只留下 design),关联文件在NC Home 的 ierpbinprop.xml 。Database Type:数据库类型,选择的是ORACLE11G 。ModuleSelectionNC 模块勾选。Client Connection客户端连接配置,对应机器 ip 和端口。启动客户端时根据此处配置连接。1.2 新建 MDE 项目直接创建: FileNewPr
3、ojectMDEDevelopmentModule project ,按照Wizard 进行工作,开发一个新的工程项目转化:方式为在一个非MDE工程中,右击工程,在弹出菜单中点击<Convert to Module Project>。src/public:存放服务接口和实体类(VO) ,前台调用后台文件的接口。src/private:后台实现类。-可编辑修改 -_src/client:前台 UIMETA-INF :配置文件针对上面的卡法模式,我们规范一下代码的包结构:nc.itf.<模块名 >: 表示该模块定义的接口 (public)nc.impl.<模块名 &g
4、t; :表示该模块定义的接口实现(private)nc.vo<模块名 >: 表示 VO 的实现 (public)nc.bs.<模块名 >: 普通的后台应用 (private)nc.ui.<模块名 >.*: 客户端代码 (client)1.3 建立数据表命名规则表名:模块名 _XXX主键: pk_XXX( 必须是 20 位的字符 )建立 PDM 文件,表字段:pk_group:所属集团char(20)pk_corp:公司char(4)creator:创建人 char(20)createtime:创建时间char(19)modifier:修改人char( 20)
5、modifytime:修改时间char(19)dr:删除标识int默认值: default 0ts:时间戳char(19) 默认值:defaultto_char(sysdate,yyyy-mm-ddhh24:mi:ss)-可编辑修改 -_建立完成后将相应sql 复制并生成到相应数据库中。1.4 生成 VO启动中间件:项目右键-Debug AsNC Middleware启动客户端:项目右键-Debug AsNC Client步骤如下图所示:21导入数据字典:进入NC,客户化二次开发工具系统管理工具数据字典管理选中对应模块 (没有就新建一个 )工具导入数据字典 45123根据向导导入即可, 导入完
6、成后检查每个表的各个字段和类型是否正确或者是否为空。确认无误后则可以根据数据表生成VO 了-可编辑修改 -_生成 VO 文件:二次开发工具UAP 集成开发工具UAP 集成开发工具工具和选项根据数据源生成VO12生成目录:选择对应的项目VO 目录选择数据表:对应要生成VO 的数据表1.5 功能注册注册菜单结点二次开发工具系统管理工具功能注册在对应的菜单结构下建立结点:步骤如下图所示-可编辑修改 -_虚功能节点可执行功能节点可执行功能节点对应文件名或控件名:-可编辑修改 -_参数参数编码: BeanConfigFilePath参数值:对应目录下的xml 路径生成 xml 之后在对应目录下找到xml
7、 的路径,然后再填写1.6 配模板单据模板二次开发工具模板管理单据模板初始化-可编辑修改 -_选中表拖动到左边-可编辑修改 -_选中模板选项之后,在高级属性和显示属性这里可以进行一些相应的配置。1.7 分配默认模板菜单结点关联模板二次开发工具系统管理工具功能结点默认模板选择单据模板,查找到之前配置好的单据模板分配给对应菜单节点就可以了。查询、打印模板同理。具体步骤如下图:-可编辑修改 -_32 选中功能节点4选中151.7 接口 (src/public)src/public/student/port/IStudentManageService.javapublic interface IStu
8、dentManageService /*- 增加 -*/public StudentVO insertInfo(StudentVO VO) throws BusinessException ;/*- 修改 -*/public StudentVO updateInfo(StudentVO VO) throws BusinessException ;/*- 删除 -*/public void deleteInfo(StudentVO VO) throws BusinessException ;-可编辑修改 -_src/public/student/port/IStudentQueryService
9、.javapublic interface IStudentQueryService /*-sql查询 -*/public StudentVO queryInfoByCondtion(String sqlWhere)throws BusinessException;/*-pk查询 -*/public StudentVO queryInfoByPK(String pk) throws BusinessException;1.8 实现接口 (src/private)StudentManageServiceImpl实现接口 IStudentManageServicepublic class Stud
10、entManageServiceImpl implements IStudentManageServicepublic StudentVO insertInfo(StudentVO vo) throws BusinessException String sql = "select count(*) from bl_student where stucode = " + "'" + vo.getStucode() + "'"-可编辑修改 -_int num = (Integer) new BaseDAO().execut
11、eQuery(sql, new ColumnProcessor(1);if(num > 0)throw new BusinessException(" 学号重复!");String pk = new BaseDAO().insertVO(vo);return (StudentVO) new BaseDAO().retrieveByPK(StudentVO.class, pk);public StudentVO updateInfo(StudentVO vo) throws BusinessException String sql = "select coun
12、t(*) from bl_student where stucode = '" + vo.getStucode() + "' andpk_student <> '"+vo.getPk_student()+"'"int num = (Integer) new BaseDAO().executeQuery(sql, new ColumnProcessor(1);if(num > 0)throw new BusinessException(" 学号重复!");new BaseDAO
13、().updateVO(vo);return (StudentVO) new BaseDAO().retrieveByPK(StudentVO.class, vo.getPk_student();public void deleteInfo(StudentVO vo) throws BusinessException new BaseDAO().deleteVO(vo);StudentQueryServiceImpl实现 IStudentQueryService-可编辑修改 -_public class StudentQueryServiceImpl implements IStudentQu
14、eryService public StudentVO queryInfoByCondtion(String sqlWhere)throws BusinessException if (StringUtil. isEmpty(sqlWhere) sqlWhere = "isnull(dr,0)=0"SuppressWarnings("unchecked")Collection<StudentVO> list =new BaseDAO().retrieveByClause(StudentVO. class, sqlWhere);return l
15、ist =null ? null : list.toArray( new StudentVOlist.size();public StudentVO queryInfoByPK(String pk) throws BusinessException if (StringUtil. isEmpty(pk) return null ;return queryDataByPK(pk);public StudentVO queryDataByPK(String pk) throws BusinessException return (StudentVO) new BaseDAO().retrieveB
16、yPK(StudentVO. class, pk);1.9 配置前台文件(src/client)BookTypeAppModelService应用服务类,负责进行模型操作的处理,如:增、删、改-可编辑修改 -_public class StudentAppModelService implements IAppModelService public void delete(Object arg0) throws Exception / 调用实现类的方法NCLocator. getInstance().lookup(IStudentManageService.class).deleteInfo(
17、StudentVO) arg0);public Object insert(Object arg0) throws Exception return NCLocator. getInstance().lookup(IStudentManageService.class).insertInfo(StudentVO) arg0);public Object queryByDataVisibilitySetting(LoginContext arg0)throws Exception return null;public Object update(Object arg0) throws Excep
18、tion return NCLocator. getInstance().lookup(IStudentManageService.class).updateInfo(StudentVO) arg0);BookTypeModelDataManager数据模型管理器,主要负责各种方式的模型初始化,单据初始化所用到的函数。public class StudentModelDataManager implements IAppModelDataManager private BillManageModel model;public void initModel() StudentVO datas =
19、 null ;try datas = NCLocator. getInstance().lookup(IStudentQueryService. class).queryInfoByCondtion( null);-可编辑修改 -_ catch (Exception ex) Logger.error("", ex);getModel().initModel(datas);public BillManageModel getModel() return model;public void setModel(BillManageModel treeModel) this.mod
20、el = treeModel;Student.xml<?xml version= "1.0" encoding= "UTF-8" ?><!DOCTYPE beans PUBLIC "-/SPRING/DTD BEAN/EN"<beans><!- 环境变量-><bean id= "context" class= /><!- 并发异常的处理-><bean id= "exceptionHandler" class=><
21、property name= "context" ref= "context" /></bean><!- 应用服务类,负责进行模型操作的处理-><bean id= "modelService"class=></bean><!- 层次应用模型-><bean id= "model" class=><property name= "service"><ref bean= "modelService
22、" /></property><property name= "context"><ref bean= "context" /></property><property name= "pkField" value= "pk_student" />-可编辑修改 -_</bean><!- 数据模型管理器,主要负责各种方式的模型初始化-><bean id= "modelDataManager"cl
23、ass=><property name= "model" ref= "model" /></bean><!- 卡控件 -><bean id= "editor" class=init-method= "initUI" ><property name= "model" ref= "model" /><property name= "nodekey" value="10010101
24、" /><property name= "componentValueManager"><bean class=><property name= "headVOName" value= /> </bean></property></bean><!- 列表控件 -><bean id= "listView" class=init-method= "initUI" ><property name= &qu
25、ot;model" ref= "model" /><property name= "nodekey" value="10010101" /></bean><bean id= "saveAction"class=><property name= "model" ref= "model" /><property name= "editor" ref= "editor" /
26、><property name= "exceptionHandler" ref= "exceptionHandler" /></bean><bean id= "editAction"class=><property name= "model" ref= "model" /><property name= "exceptionHandler" ref= "exceptionHandler" />
27、; </bean><bean id= "addAction" class=><property name= "model" ref= "model" /><property name= "exceptionHandler" ref= "exceptionHandler" /> </bean><bean id= "deleteAction" class=>-可编辑修改 -_<property name
28、= "model" ref= "model" /><property name= "exceptionHandler" ref= "exceptionHandler" /> </bean><bean id= "refreshAction" class=> <property name= "model" ref= "model" /><property name= "modelDataMa
29、nager"ref= "modelDataManager"/> <property name= "exceptionHandler" ref= "exceptionHandler" /></bean><bean id= "cancelAction" class=> <property name= "model" ref= "model" /><property name= "editor"
30、; ref= "editor" /><property name= "exceptionHandler" ref= "exceptionHandler" /> </bean><!- 界面布局总装-><bean id= "container" class=init-method= "initUI" > <property name= "constraints"><list><bean class
31、=> <property name= "newComponent"><ref bean= "listView" /></property><property name= "newComponentName"><value> 列表 </value></property></bean><bean class=> <property name= "newComponent"><ref bea
32、n= "editor" /></property><property name= "targetComponent"><ref bean= "listView" /></property><property name= "newComponentName"><value> 卡片 </value></property><property name= "direction" ><value>center</value></property><!- <property name="dividerLocation"><value>250f</value></property> ->-可编辑修改 -_</bea
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年湖南郴州汝城县数学六上期末经典试题含解析
- 2024-2030年中国高精度贴片电阻市场投资潜力与未来营销策略探讨研究报告
- 2024-2030年中国高档数控机床行业发展趋势与投资战略研究报告
- 2024-2030年中国马术俱乐部行业发展分析及发展前景与趋势预测研究报告
- 2024-2030年中国饮用桶装水行业市场发展分析及竞争格局与投资前景研究报告
- 2024-2030年中国飞机点火开关行业市场发展趋势与前景展望战略研究报告
- 2024-2030年中国颜料包装制品行业市场运行分析及发展趋势与投资战略研究报告
- 2024-2030年中国韧皮服装面料行业市场发展趋势与前景展望战略研究报告
- 2024-2030年中国雪地运动眼镜行业市场运行分析及投资价值评估报告
- 2024年防粘连剂项目建议书
- 近现代名家徐悲鸿作品赏析课件
- 药物遗传毒性研究技术指导原则
- 脑梗死的二级预防
- 2022年呼和浩特职业学院单招语文试题及答案解析
- 钢结构坡屋面施工组织设计
- 特殊教育学校教职工绩效考核办法
- iatf16949项目管理乌龟图
- 手术室胎盘早剥应急预案
- 弹塑性力学与有限元弹塑性应力应变关系课件
- 油罐机械清洗作业规范
- 高等教育出版社-金尚年-马永利的理论力学课后习题答案
评论
0/150
提交评论