NC57开发文档(修改版).doc_第1页
NC57开发文档(修改版).doc_第2页
NC57开发文档(修改版).doc_第3页
NC57开发文档(修改版).doc_第4页
NC57开发文档(修改版).doc_第5页
已阅读5页,还剩15页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

_一、 搭建开发环境工具:Eclipse数据库:Oracle安装NC模块并建立帐套用户。1.1 安装和配置插件首先下载nc.uap.mde系列插件,然后安装,安装即把插件直接考贝Eclipse的plugin目录下,由于Eclipse的bug,如果曾经安装过,请把configuration目录下的内容除了config.ini外其他文件都删除,在此启动Eclipse即可。设置Window-Prefreence-MDE DevelopmentNC Home:基础技术平台的运行环境根目录。复选框:表示是否把模块的client下的类加入到构件路径。如果你的模块不依赖别的模块的客户端代码,请取消该选择。DatasourseDriverList:开发环境的配置信息(在配置时,要把其他的配置信息删除掉,只留下design),关联文件在NC Home的ierpbinprop.xml。Database Type:数据库类型,选择的是ORACLE11G。ModuleSelectionNC模块勾选。Client Connection客户端连接配置,对应机器ip和端口。启动客户端时根据此处配置连接。1.2 新建MDE项目直接创建:FileNewProjectMDE DevelopmentModule project ,按照Wizard进行工作,开发一个新的工程项目转化:方式为在一个非MDE工程中,右击工程,在弹出菜单中点击。src/public:存放服务接口和实体类(VO),前台调用后台文件的接口。src/private:后台实现类。src/client:前台UIMETA-INF:配置文件针对上面的卡法模式,我们规范一下代码的包结构: nc.itf.: 表示该模块定义的接口(public) nc.impl.:表示该模块定义的接口实现(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)modifytime:修改时间char(19)dr:删除标识int默认值:default 0ts:时间戳char(19)默认值:default to_char(sysdate,yyyy-mm-dd hh24:mi:ss)建立完成后将相应sql复制并生成到相应数据库中。1.4 生成VO启动中间件:项目右键-Debug AsNC Middleware启动客户端:项目右键-Debug AsNC Client步骤如下图所示:21导入数据字典:进入NC,客户化二次开发工具系统管理工具数据字典管理选中对应模块(没有就新建一个)工具导入数据字典54321根据向导导入即可,导入完成后检查每个表的各个字段和类型是否正确或者是否为空。确认无误后则可以根据数据表生成VO了生成VO文件:二次开发工具UAP集成开发工具 UAP集成开发工具工具和选项根据数据源生成VO12生成目录:选择对应的项目VO目录选择数据表:对应要生成VO的数据表1.5 功能注册注册菜单结点二次开发工具系统管理工具功能注册在对应的菜单结构下建立结点:步骤如下图所示可执行功能节点虚功能节点可执行功能节点对应文件名或控件名:nc.ui.uif2.ToftPanelAdaptor参数参数编码:BeanConfigFilePath参数值:对应目录下的xml路径生成xml之后在对应目录下找到xml的路径,然后再填写1.6 配模板单据模板二次开发工具模板管理单据模板初始化 选中表拖动到左边选中模板选项之后,在高级属性和显示属性这里可以进行一些相应的配置。1.7 分配默认模板 菜单结点关联模板 二次开发工具系统管理工具功能结点默认模板 选择单据模板,查找到之前配置好的单据模板分配给对应菜单节点就可以了。查询、打印模板同理。 具体步骤如下图:5 4选中32 选中功能节点11.7 接口(src/public)src/public/student/port/IStudentManageService.javaimport nc.vo.StudentVO;import nc.vo.pub.BusinessException;public interface IStudentManageService /*-增加-*/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.javaimport nc.vo.StudentVO;import nc.vo.pub.BusinessException;public interface IStudentQueryService /*-sql查询-*/public StudentVO queryInfoByCondtion(String sqlWhere)throws BusinessException;/*-pk查询-*/public StudentVO queryInfoByPK(String pk) throws BusinessException;1.8 实现接口(src/private)StudentManageServiceImpl实现接口IStudentManageServiceimport nc.bs.dao.BaseDAO;import cessor.ColumnProcessor;import nc.vo.StudentVO;import nc.vo.pub.BusinessException;import student.port.IStudentManageService;public class StudentManageServiceImpl implements IStudentManageServicepublic StudentVO insertInfo(StudentVO vo) throws BusinessException String sql = select count(*) from bl_student where stucode = + + vo.getStucode() + ;int num = (Integer) new BaseDAO().executeQuery(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 count(*) from bl_student where stucode = + vo.getStucode() + and pk_student +vo.getPk_student()+;int num = (Integer) new BaseDAO().executeQuery(sql, new ColumnProcessor(1);if(num 0)throw new BusinessException(学号重复!);new BaseDAO().updateVO(vo);return (StudentVO) new BaseDAO().retrieveByPK(StudentVO.class, vo.getPk_student();public void deleteInfo(StudentVO vo) throws BusinessException new BaseDAO().deleteVO(vo);StudentQueryServiceImpl实现IStudentQueryServiceimport java.util.Collection;import nc.bs.dao.BaseDAO;import nc.vo.StudentVO;import nc.vo.jcom.lang.StringUtil;import nc.vo.pub.BusinessException;import student.port.IStudentQueryService;public class StudentQueryServiceImpl implements IStudentQueryService public StudentVO queryInfoByCondtion(String sqlWhere)throws BusinessException if (StringUtil.isEmpty(sqlWhere) sqlWhere = isnull(dr,0)=0;SuppressWarnings(unchecked)Collection list = new BaseDAO().retrieveByClause(StudentVO.class, sqlWhere);return list = 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().retrieveByPK(StudentVO.class, pk);1.9 配置前台文件(src/client)BookTypeAppModelService应用服务类,负责进行模型操作的处理,如:增、删、改import mon.NCLocator;import nc.ui.uif2.model.IAppModelService;import nc.vo.StudentVO;import nc.vo.uif2.LoginContext;import student.port.IStudentManageService;public class StudentAppModelService implements IAppModelService public void delete(Object arg0) throws Exception / 调用实现类的方法NCLocator.getInstance().lookup(IStudentManageService.class).deleteInfo(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 Exception return NCLocator.getInstance().lookup(IStudentManageService.class).updateInfo(StudentVO) arg0);BookTypeModelDataManager数据模型管理器,主要负责各种方式的模型初始化,单据初始化所用到的函数。import mon.NCLocator;import nc.bs.logging.Logger;import nc.ui.uif2.model.BillManageModel;import nc.ui.uif2.model.IAppModelDataManager;import nc.vo.StudentVO;import student.port.IStudentQueryService;public class StudentModelDataManager implements IAppModelDataManager private BillManageModel model;public void initModel() StudentVO datas = null;try datas = NCLoca

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论