Nc65添加自定义参照
作者:互联网
Nc65添加自定义参照
此次需求为在收款结算管理自定义5字段可参照付款结算单
需要在参照表bd_refinfo插入参照信息
–插入参照语句
insert into BD_REFINFO (
CODE, DR, ISNEEDPARA, ISSPECIALREF,
METADATATYPENAME, MODULENAME, NAME, PARA1,
PARA2,PK_REFINFO, REFCLASS, REFSYSTEM,
REFTYPE, RESERV1,RESERV3, RESID,
RESIDPATH, TS, WHEREPART)
values (
‘borrow_no’, 0, null, null,
'BillAggVO’, ‘cmp’, ‘付款结算U9借款单’, null,
null,‘0001Z0100000001BOROW’, ‘nc.ui.train.pub.ref.BorrowRefModel’, null,
‘0’,null, null,‘借款单号’,
‘ref’,‘2013-10-05 22:57:13’, null);
编写参照类,在参照类中定义要显示哪些值,查询的表,过滤条件等
我做的是单表参照,所以继承AbstractRefModel 这个类即可
package nc.ui.cmp.ref;
import nc.ui.bd.ref.AbstractRefModel;
import nc.vo.bd.material.MaterialVO;
import nc.vo.org.OrgVO;
public class BillborwRefModel extends AbstractRefModel {
/**
* getDefaultFieldCount 方法注解.
*/
public int getDefaultFieldCount() {
return 5;
}
/**
* 参照数据库字段名数组 创建日期:(01-4-4 0:57:23)
*
* @return java.lang.String
*/
public java.lang.String[] getFieldCode() {
return new String[] {"bill_no","def11","def15","primal_money","name","pk_paybill"};
}
/**
* 和数据库字段名数组对应的中文名称数组 创建日期:(01-4-4 0:57:23)
*
* @return java.lang.String
*/
public java.lang.String[] getFieldName() {
return new String[] {"付款结算单号","借款单号","借款余额","借款总额","业务员","主键"};
}
/*
* (non-Javadoc)
*
* @see
nc.ui.bd.ref.AbstractRefModel#setHiddenFieldCode(java.lang.String[])
*/
@Override
public void setHiddenFieldCode(String[] newHiddenFieldCode) {
super.setHiddenFieldCode(new String[] { "pk_paybill" });
}
/**
* 设置不显示参照
*//*
public String[] getHiddenFieldCode(){
return new String[] {"pk_paybill"};
}*/
/**
* 要返回的主键字段名i.e. pk_deptdoc 创建日期:(01-4-4 0:57:23)
*
* @return java.lang.String
*/
public String getPkFieldCode() {
return "pk_paybill";
// jiawei 修改返回值为表主键
//return "pk_billtypeid";
}
/**
* 参照标题 创建日期:(01-4-4 0:57:23)
*
* @return java.lang.String
*/
public String getRefTitle() {
return "付款结算单"/*@res "单据模板类型"*/;
}
/**
* 参照数据库表或者视图名 创建日期:(01-4-4 0:57:23)
*
* @return java.lang.String
*/
public String getTableName() {
String tableName="(SELECT p.pk_paybill, p.bill_no, p.primal_money, p.def11, p.def15 , b.name FROM p LEFT JOIN cmp_paybilldetail d ON p.pk_paybill = d.pk_paybill LEFT JOIN bd_psndoc b ON d.pk_busiman = b.pk_psndoc where p.primal_money is not null and p.primal_money>0 and ( p.pk_group = '~' or p.pk_group = '";
tableName+= getPk_group() + "') and p.def11 is not null and p.def11 != '~' and p.def15 is not null and p.def15 not in ('~','0') and p.dr = '0')";
return tableName;
}
/**
* 添加条件2011-01-20
*/
public String getWherePart() {
return "1=1" ;
}
}
配置单据模板自定义参照即可
标签:参照,return,String,自定义,添加,Nc65,pk,null,public 来源: https://blog.csdn.net/qq_42769940/article/details/98059595