NC57开发文档修改版.docx

上传人:b****1 文档编号:987480 上传时间:2023-04-30 格式:DOCX 页数:21 大小:435.08KB
下载 相关 举报
NC57开发文档修改版.docx_第1页
第1页 / 共21页
NC57开发文档修改版.docx_第2页
第2页 / 共21页
NC57开发文档修改版.docx_第3页
第3页 / 共21页
NC57开发文档修改版.docx_第4页
第4页 / 共21页
NC57开发文档修改版.docx_第5页
第5页 / 共21页
NC57开发文档修改版.docx_第6页
第6页 / 共21页
NC57开发文档修改版.docx_第7页
第7页 / 共21页
NC57开发文档修改版.docx_第8页
第8页 / 共21页
NC57开发文档修改版.docx_第9页
第9页 / 共21页
NC57开发文档修改版.docx_第10页
第10页 / 共21页
NC57开发文档修改版.docx_第11页
第11页 / 共21页
NC57开发文档修改版.docx_第12页
第12页 / 共21页
NC57开发文档修改版.docx_第13页
第13页 / 共21页
NC57开发文档修改版.docx_第14页
第14页 / 共21页
NC57开发文档修改版.docx_第15页
第15页 / 共21页
NC57开发文档修改版.docx_第16页
第16页 / 共21页
NC57开发文档修改版.docx_第17页
第17页 / 共21页
NC57开发文档修改版.docx_第18页
第18页 / 共21页
NC57开发文档修改版.docx_第19页
第19页 / 共21页
NC57开发文档修改版.docx_第20页
第20页 / 共21页
亲,该文档总共21页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

NC57开发文档修改版.docx

《NC57开发文档修改版.docx》由会员分享,可在线阅读,更多相关《NC57开发文档修改版.docx(21页珍藏版)》请在冰点文库上搜索。

NC57开发文档修改版.docx

NC57开发文档修改版

一、搭建开发环境

工具:

Eclipse

数据库:

Oracle

安装NC模块并建立帐套用户。

1.1安装和配置插件

首先下载nc.uap.mde系列插件,然后安装,安装即把插件直接考贝Eclipse的plugin目录下,由于Eclipse的bug,如果曾经安装过,请把configuration目录下的内容除了config.ini外其他文件都删除,在此启动Eclipse即可。

设置Window->Prefreence->MDEDevelopment

NCHome:

基础技术平台的运行环境根目录。

复选框

表示是否把模块的client下的类加入到构件路径。

如果你的模块不依赖别的模块的客户端代码,请取消该选择。

Datasourse

DriverList:

开发环境的配置信息(在配置时,要把其他的配置信息删除掉,只留下design),关联文件在NCHome的\ierp\bin\prop.xml。

DatabaseType:

数据库类型,选择的是ORACLE11G。

ModuleSelection

NC模块勾选。

ClientConnection

客户端连接配置,对应机器ip和端口。

启动客户端时根据此处配置连接。

1.2新建MDE项目

直接创建:

FileNewProjectMDEDevelopmentModuleproject,按照Wizard进行工作,开发一个新的工程

项目转化:

方式为在一个非MDE工程中,右击工程,在弹出菜单中点击

src/public:

存放服务接口和实体类(VO),前台调用后台文件的接口。

src/private:

后台实现类。

src/client:

前台UI

META-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,’yyyy-mm-ddhh24:

mi:

ss’)

建立完成后将相应sql复制并生成到相应数据库中。

1.4生成VO

启动中间件:

项目右键-DebugAsNCMiddleware

启动客户端:

项目右键-DebugAsNCClient

步骤如下图所示:

导入数据字典:

进入NC,客户化二次开发工具系统管理工具数据字典管理选中对应模块(没有就新建一个)工具导入数据字典…

根据向导导入即可,导入完成后检查每个表的各个字段和类型是否正确或者是否为空。

确认无误后则可以根据数据表生成VO了

生成VO文件:

二次开发工具UAP集成开发工具UAP集成开发工具工具和选项根据数据源生成VO

生成目录:

选择对应的项目VO目录

选择数据表:

对应要生成VO的数据表

1.5功能注册

注册菜单结点

二次开发工具系统管理工具功能注册

在对应的菜单结构下建立结点:

步骤如下图所示

可执行功能节点

对应文件名或控件名:

nc.ui.uif2.ToftPanelAdaptor

 

参数

参数编码:

BeanConfigFilePath

参数值:

对应目录下的xml路径

1.6配模板

单据模板

二次开发工具模板管理单据模板初始化

 

 

选中表拖动到左边

1.7分配默认模板

菜单结点关联模板

二次开发工具系统管理工具功能结点默认模板

选择单据模板,查找到之前配置好的单据模板分配给对应菜单节点就可以了。

查询、打印模板同理。

具体步骤如下图:

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")

Collectionlist=newBaseDAO().retrieveByClause(

StudentVO.class,sqlWhere);

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.StudentModelDataManager">

--卡控件-->

init-method="initUI">

--列表控件-->

init-method="initUI">

class="nc.ui.uif2.actions.SaveAction">

class="nc.ui.uif2.actions.EditAction">

--界面布局总装-->

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2