NC57开发文档修改版.docx
- 文档编号:18121822
- 上传时间:2023-08-13
- 格式:DOCX
- 页数:34
- 大小:1.97MB
NC57开发文档修改版.docx
《NC57开发文档修改版.docx》由会员分享,可在线阅读,更多相关《NC57开发文档修改版.docx(34页珍藏版)》请在冰点文库上搜索。
NC57开发文档修改版
一、搭建开发环境
工具:
Eclipse
数据库:
Oracle
安装NC模块并建立帐套用户。
1.1安装和配置插件
首先下载nc.uap.mde系列插件,然后安装,安装即把插件直接考贝Eclipse的plugin目录下,由于Eclipse的bug,如果曾经安装过,请把configuration目录下的内容除了config.ini外其他文件都删除,在此启动Eclipse即可。
设置Window->Prefreence->MDEDevelopmentNCHome:
基础技术平台的运行环境根目录。
复选框 >表示是否把模块的client 下的类加入到构件路径。 如果你的模块不依赖别的模块的客户端代码,请取消该选择。 Datasourse -可编辑修改- DriverList: 开发环境的配置信息(在配置时,要把其他的配置信息删除掉, 只留下design,)关联文件在NCHome的\ierp\bin\prop.xml。 DatabaseTyp: e数据库类型,选择的是ORACLE11G。 ModuleSelectionNC模块勾选。 ClientConnection 客户端连接配置,对应机器ip和端口。 启动客户端时根据此处配置连接。 1.2新建MDE项目 直接创建: FileNewProjectMDEDevelopmentModuleproject,按照 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默认值: default0 ts: 时间戳char(19)默认值: defaultto_char(sysdate’y,yyy-mm-ddhh24: mi: ss’) -可编辑修改- 建立完成后将相应sql复制并生成到相应数据库中。 1.4生成VO 启动中间件: 项目右键 -DebugAs NCMiddleware 启动客户端: 项目右键 -DebugAs NCClient 步骤如下图所示: 根据向导导入即可,导入完成后检查每个表的各个字段和类型是否正确或者是否为空。 确认无误后则可以根据数据表生成VO了 生成VO文件: 二次开发工具UAP集成开发工具UAP集成开发工具工具和选项根据数据源生成VO 生成目录: 选择对应的项目VO目录选择数据表: 对应要生成VO的数据表 1.5功能注册 注册菜单结点 二次开发工具系统管理工具功能注册 在对应的菜单结构下建立结点: 步骤如下图所示 参数 参数编码: BeanConfigFilePath 参数值: 对应目录下的xml路径 1.6配模板 单据模板 二次开发工具模板管理单据模板初始化 选中表拖动到左边 1.7分配默认模板 菜单结点关联模板 二次开发工具系统管理工具功能结点默认模板 选择单据模板,查找到之前配置好的单据模板分配给对应菜单节点就可以了。 查询、打印模板同理。 具体步骤如下图: 3 2选中功能节点 4选中 1 5 1.7接口(src/public) src/public/student/port/IStudentManageService.java importnc.vo.StudentVO; importnc.vo.pub.BusinessException; publicinterfaceIStudentManageService{ /*--------增加*/ publicStudentVOinsertInfo(StudentVOVO)throwsBusinessException; /*--------修改*/ publicStudentVOupdateInfo(StudentVOVO)throwsBusinessException; /*--------删除*/ publicvoiddeleteInfo(StudentVOVO)throwsBusinessException; } src/public/student/port/IStudentQueryService.java importnc.vo.StudentVO; importnc.vo.pub.BusinessException; publicinterfaceIStudentQueryService{ /*--------sql查询*/ publicStudentVO[]queryInfoByCondtion(StringsqlWhere)throwsBusinessException; /*--------pk查询*/ publicStudentVOqueryInfoByPK(Stringpk)throwsBusinessException; } 1.8实现接口(src/private) StudentManageServiceImpl 实现接口IStudentManageService importnc.bs.dao.BaseDAO; importnc.jdbc.framework.processor.ColumnProcessor;importnc.vo.StudentVO; importnc.vo.pub.BusinessException; importstudent.port.IStudentManageService; publicclassStudentManageServiceImplimplementsIStudentManageService{ publicStudentVOinsertInfo(StudentVOvo)throwsBusinessException{ Stringsql="selectcount(*)frombl_studentwherestucode="+"'"+vo.getStucode()+"'"; intnum=(Integer)newBaseDAO().executeQuery(sql,newColumnProcessor (1));if(num>0){ thrownewBusinessException("学号重复! "); } Stringpk=newBaseDAO().insertVO(vo); return(StudentVO)newBaseDAO().retrieveByPK(StudentVO.class,pk); } publicStudentVOupdateInfo(StudentVOvo)throwsBusinessException{ Stringsql="selectcount(*)frombl_studentwherestucode='"+vo.getStucode()+"'andpk_student<>'"+vo.getPk_student()+"'"; intnum=(Integer)newBaseDAO().executeQuery(sql,newColumnProcessor (1));if(num>0){ thrownewBusinessException("学号重复! "); } newBaseDAO().updateVO(vo); return(StudentVO)newBaseDAO().retrieveByPK(StudentVO.class,vo.getPk_student()); } publicvoiddeleteInfo(StudentVOvo)throwsBusinessException{newBaseDAO().deleteVO(vo); } } StudentQueryServiceImpl 实现IStudentQueryService importjava.util.Collection; importnc.bs.dao.BaseDAO;importnc.vo.StudentVO; importnc.vo.jcom.lang.StringUtil;importnc.vo.pub.BusinessException; importstudent.port.IStudentQueryService; publicclassStudentQueryServiceImplimplementsIStudentQueryService{publicStudentVO[]queryInfoByCondtion(StringsqlWhere) throwsBusinessException{ if(StringUtil.isEmpty(sqlWhere)){sqlWhere="isnull(dr,0)=0"; } @SuppressWarnings("unchecked") Collection returnlist==null? null: list.toArray(newStudentVO[list.size()]); } publicStudentVOqueryInfoByPK(Stringpk)throwsBusinessException{if(StringUtil.isEmpty(pk)){ returnnull; } returnqueryDataByPK(pk); } publicStudentVOqueryDataByPK(Stringpk)throwsBusinessException{return(StudentVO)newBaseDAO().retrieveByPK(StudentVO.class,pk); } } 1.9配置前台文件(src/client) BookTypeAppModelService 应用服务类,负责进行模型操作的处理,如: 增、删、改 importmon.NCLocator;importnc.ui.uif2.model.IAppModelService;importnc.vo.StudentVO; importnc.vo.uif2.LoginContext; importstudent.port.IStudentManageService; publicclassStudentAppModelServiceimplementsIAppModelService{publicvoiddelete(Objectarg0)throwsException{ //调用实现类的方法 NCLocator.getInstance().lookup(IStudentManageService.class) .deleteInfo((StudentVO)arg0); } publicObjectinsert(Objectarg0)throwsException{ returnNCLocator.getInstance().lookup(IStudentManageService.class) .insertInfo((StudentVO)arg0); } publicObject[]queryByDataVisibilitySetting(LoginContextarg0)throwsException{ returnnull; } publicObjectupdate(Objectarg0)throwsException{ returnNCLocator.getInstance().lookup(IStudentManageService.class) .updateInfo((StudentVO)arg0); } } BookTypeModelDataManager 数据模型管理器,主要负责各种方式的模型初始化,单据初始化所用到的函数。 importmon.NCLocator;importnc.bs.logging.Logger; importnc.ui.uif2.model.BillManageModel; importnc.ui.uif2.model.IAppModelDataManager;importnc.vo.StudentVO; importstudent.port.IStudentQueryService; publicclassStudentModelDataManagerimplementsIAppModelDataManager{privateBillManageModelmodel; publicvoidinitModel(){StudentVO[]datas=null;try{ datas=NCLocator.getInstance().lookup(IStudentQueryService.class) .queryInfoByCondtion(null); }catch(Exceptionex){Logger.error("",ex); } getModel().initModel(datas); } publicBillManageModelgetModel(){returnmodel; } publicvoidsetModel(BillManageModeltreeModel){this.model=treeModel; } } Student.xml xmlversion="1.0"encoding="UTF-8"? > DOCTYPEbeansPUBLIC"-//SPRING//DTDBEAN//EN" "http: //www.springframework.org/dtd/spring-beans.dtd"> --环境变量--> --并发异常的处理--> --应用服务类,负责进行模型操作的处理--> class="com.ui.student.StudentAppModelService>" --层次应用模型--> --数据模型管理器,主要负责各种方式的模型初始化--> class="com.ui.student.StudentModelDataManage>r" --卡控件--> --列表控件--> class="nc.ui.uif2.actions.SaveAction>" class="nc.ui.uif2.actions.EditAction"> --界面布局总装-->
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- NC57 开发 文档 修改