用友YONBIPV3元数据升级添加字段方案

概要

用友NC2111及BIP系列产品部分表字段不足,需要手动添加扩充可使用的字段

例如:

以表iufo_comvouch_body(常用凭证明细记录)为例,添加字段名为mxkm的字段,类型为字符串

添加流程

  • 修改数据库表iufo_comvouch_body添加字段mxkm
ALTER TABLE iufo_comvouch_body ADD (mxkm VARCHAR2(1024));
  • 往元数据相关的三张表中插入数据,分别是md_property,md_ormap,md_column
--1.实体属性表,类的相关信息,从中查出iufo_comvouch_body的id主键
select * from md_class where DEFAULTTABLENAME='iufo_comvouch_body';
--2.实体属性,表里面的字段信息,根据1中查询出的id查出相关信息,可以复制一条数据进行修改,我这里参考原本自带的note备注字段进行修改,主要修改NAME,DISPLAYNAME,ATTRSEQUENCE以及ID字段,其中id字段可以百度UUID自动生成
select * from md_property where CLASSID='b9f94716-961b-4b46-a0c2-7afbcae1886b';
insert into md_property (accessorclassname, accesspower, accesspowergroup, attrlength, attrmaxvalue, attrminvalue, attrsequence, calculation, classid, createindustry, createtime, creator, customattr, datatype, datatypestyle, defaultvalue, description, displayname, dr, dynamicattr, dynamictable, fixedlength, help, hided, id, industry, isactive, isauthen, modifier, modifytime, name, notserialize, nullable, precise, readonly, refmodelname, resid, ts, versiontype, visibility) values (null,'N',null,'1024',null,null,'8','N','b9f94716-961b-4b46-a0c2-7afbcae1886b','0',null,null,'N','BS000010000100001030','300',null,null,'明细科目',null,'N',null,'N',null,'N','b1fdbb61-e0e2-415d-b400-5fb819429081',0,'Y',null,null,null,'mxkm','N','Y',0,'N',null,'2UC000-000258','2022-11-30 16:00:13',0,0);
--3.这张表中字段比较少,其中ATTRIBUTEID为2中生成的UUID,CLASSID为1中查出的ID,修改COLUMNID为iufo_comvouch_body@@@mxkm
select * from md_ormap where CLASSID='b9f94716-961b-4b46-a0c2-7afbcae1886b';
insert into md_ormap (ATTRIBUTEID, CLASSID, COLUMNID, DR, TABLEID, TS) values ('b1fdbb61-e0e2-415d-b400-5fb819429081','b9f94716-961b-4b46-a0c2-7afbcae1886b','iufo_comvouch_body@@@mxkm',null,'iufo_comvouch_body','2022-11-30 16:00:13');
--4.数据仓库元数据列,修改COLUMNSEQUENCE,DISPLAYNAME,ID,NAME
select * from md_column where TABLEID='iufo_comvouch_body';
insert into md_column (COLUMNLENGTH, COLUMNSEQUENCE, COLUMNTYPE, CREATETIME, CREATOR, DEFAULTVALUE, DESCRIPTION, DISPLAYNAME, DR, FORLOCALE, GROUPID, HELP, ID, IDENTITIED, INCREMENTSEED, INCREMENTSTEP, ISACTIVE, MODIFIER, MODIFYTIME, NAME, NULLABLE, PKEY, PRECISE, RESID, SQLDATETYPE, TABLEID, TS, VERSIONTYPE) values ('1024','8',0,null,null,null,null,'明细科目',null,'N',null,null,'iufo_comvouch_body@@@mxkm',null,null,null,'Y',null,null,'mxkm','Y','N',0,'2UC000-000258','varchar','iufo_comvouch_body','2022-11-30 16:00:13',0);
  •  修改后端代码相关VO类,添加增加的字段
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package nc.vo.hbbb.commonvouch;

import nc.vo.pub.SuperVO;
import nc.vo.pub.lang.UFDateTime;
import nc.vo.pub.lang.UFDouble;

public class CommonVouchBodyVO extends SuperVO {
    private String pk_comvouch_head;
    private String pk_detail;
    private Integer iorder;
    private String digest;
    private String pk_measure;
    private UFDouble debitamount;
    private UFDouble creditamount;
    private String note;
    private Integer dr = 0;
    private UFDateTime ts;
    /**
     * 新增字段
     */
    private String mxkm;
    public static final String MXKM = "mxkm";

    public String getMxkm() {
        return mxkm;
    }

    public void setMxkm(String mxkm) {
        this.mxkm = mxkm;
    }

    /**
     * 
     */

    public static final String PK_COMVOUCH_HEAD = "pk_comvouch_head";
    public static final String PK_DETAIL = "pk_detail";
    public static final String IORDER = "iorder";
    public static final String DIGEST = "digest";
    public static final String PK_MEASURE = "pk_measure";
    public static final String DEBITAMOUNT = "debitamount";
    public static final String CREDITAMOUNT = "creditamount";
    public static final String NOTE = "note";

    public String getPk_comvouch_head() {
        return this.pk_comvouch_head;
    }

    public void setPk_comvouch_head(String newPk_comvouch_head) {
        this.pk_comvouch_head = newPk_comvouch_head;
    }

    public String getPk_detail() {
        return this.pk_detail;
    }

    public void setPk_detail(String newPk_detail) {
        this.pk_detail = newPk_detail;
    }

    public Integer getIorder() {
        return this.iorder;
    }

    public void setIorder(Integer newIorder) {
        this.iorder = newIorder;
    }

    public String getDigest() {
        return this.digest;
    }

    public void setDigest(String newDigest) {
        this.digest = newDigest;
    }

    public String getPk_measure() {
        return this.pk_measure;
    }

    public void setPk_measure(String newPk_measure) {
        this.pk_measure = newPk_measure;
    }

    public UFDouble getDebitamount() {
        return this.debitamount;
    }

    public void setDebitamount(UFDouble newDebitamount) {
        this.debitamount = newDebitamount;
    }

    public UFDouble getCreditamount() {
        return this.creditamount;
    }

    public void setCreditamount(UFDouble newCreditamount) {
        this.creditamount = newCreditamount;
    }

    public String getNote() {
        return this.note;
    }

    public void setNote(String newNote) {
        this.note = newNote;
    }

    public Integer getDr() {
        return this.dr;
    }

    public void setDr(Integer newDr) {
        this.dr = newDr;
    }

    public UFDateTime getTs() {
        return this.ts;
    }

    public void setTs(UFDateTime newTs) {
        this.ts = newTs;
    }

    public String getParentPKFieldName() {
        return "pk_comvouch_head";
    }

    public String getPKFieldName() {
        return "pk_detail";
    }

    public String getTableName() {
        return "iufo_comvouch_body";
    }

    public static String getDefaultTableName() {
        return "iufo_comvouch_body";
    }

    public CommonVouchBodyVO() {
    }
}
  •  完成上述操作,导出VO补丁打入到home中,然后重启服务
  • 修改元数据BMF文件,这里iufo_comvouch_body元数据文件位置在home\modules\ufoc\METADATA\commonvouch,如果找不到相关的元数据文件可以参考以下方法:1.用数据字典插件,左树的搜索框输入类名就可以找到元数据,使用帮助可看文章:https://nccdev.yonyou.com/article/detail/1592;2.用admin账号进入元数据管理节点找到相关VO信息通过目录一层层修改。复制修改相关信息插入明细科目保存
            <attributelist>
                <attribute accessStrategy="" accesspower="false" accesspowergroup="" calculation="false" classID="b9f94716-961b-4b46-a0c2-7afbcae1886b" createIndustry="0" dataType="BS000010000100001051" dataTypeStyle="SINGLE" dbtype="char" defaultValue="" description="" displayName="明细主键" dynamic="false" dynamicTable="" fieldName="pk_detail" fieldType="char" fixedLength="false" forLocale="false" help="" id="6b0ad9de-6a28-4d74-b891-43da86e82209" industryChanged="false" isActive="true" isAuthorization="true" isDefaultDimensionAttribute="false" isDefaultMeasureAttribute="false" isFeature="false" isGlobalization="false" isHide="false" isKey="true" isNullable="false" isReadOnly="false" isShare="false" isSource="true" length="20" maxValue="" minValue="" modifyIndustry="0" name="pk_detail" notSerialize="false" precise="" refModelName="" resid="21830001-000113" sequence="0" typeDisplayName="UFID" typeName="UFID" versionType="0" visibility="public"/>
                <attribute accessStrategy="" accesspower="false" accesspowergroup="" calculation="false" classID="b9f94716-961b-4b46-a0c2-7afbcae1886b" createIndustry="0" dataType="BS000010000100001004" dataTypeStyle="SINGLE" dbtype="int" defaultValue="" description="" displayName="分录号" dynamic="false" dynamicTable="" fieldName="iorder" fieldType="int" fixedLength="false" forLocale="false" help="" id="6c3d9cec-1802-49ce-a1ae-964057cbfa5a" industryChanged="false" isActive="true" isAuthorization="true" isDefaultDimensionAttribute="false" isDefaultMeasureAttribute="false" isFeature="false" isGlobalization="false" isHide="false" isKey="false" isNullable="true" isReadOnly="false" isShare="false" isSource="true" length="" maxValue="" minValue="" modifyIndustry="0" name="iorder" notSerialize="false" precise="" refModelName="" resid="2UC000-000152" sequence="1" typeDisplayName="Integer" typeName="Integer" versionType="0" visibility="public"/>
                <attribute accessStrategy="" accesspower="false" accesspowergroup="" calculation="false" classID="b9f94716-961b-4b46-a0c2-7afbcae1886b" createIndustry="0" dataType="BS000010000100001001" dataTypeStyle="SINGLE" dbtype="varchar" defaultValue="" description="" displayName="摘要" dynamic="false" dynamicTable="" fieldName="digest" fieldType="varchar" fixedLength="false" forLocale="false" help="" id="709eb31f-cfcc-459f-97e8-a9d13159b698" industryChanged="false" isActive="true" isAuthorization="true" isDefaultDimensionAttribute="false" isDefaultMeasureAttribute="false" isFeature="false" isGlobalization="false" isHide="false" isKey="false" isNullable="true" isReadOnly="false" isShare="false" isSource="true" length="50" maxValue="" minValue="" modifyIndustry="0" name="digest" notSerialize="false" precise="" refModelName="" resid="2UC000-000426" sequence="2" typeDisplayName="String" typeName="String" versionType="0" visibility="public"/>
                <attribute accessStrategy="" accesspower="false" accesspowergroup="" calculation="false" classID="b9f94716-961b-4b46-a0c2-7afbcae1886b" createIndustry="0" dataType="2aa56d00-dcb0-428a-aeb7-aaa7198dafde" dataTypeStyle="REF" dbtype="" defaultValue="~" description="" displayName="合并报表项目" dynamic="false" dynamicTable="" fieldName="pk_measure" fieldType="varchar" fixedLength="false" forLocale="false" help="" id="1b70acf9-a384-4533-94ad-2a3c453862b4" industryChanged="false" isActive="true" isAuthorization="true" isDefaultDimensionAttribute="false" isDefaultMeasureAttribute="false" isFeature="false" isGlobalization="false" isHide="false" isKey="false" isNullable="true" isReadOnly="false" isShare="false" isSource="true" length="20" maxValue="" minValue="" modifyIndustry="0" name="pk_measure" notSerialize="false" precise="" refModelName="合并报表项目" resid="21830001-000110" sequence="3" typeDisplayName="合并报表项目" typeName="project" versionType="0" visibility="public"/>
                <attribute accessStrategy="" accesspower="false" accesspowergroup="" calculation="false" classID="b9f94716-961b-4b46-a0c2-7afbcae1886b" createIndustry="0" dataType="BS000010000100001031" dataTypeStyle="SINGLE" dbtype="decimal" defaultValue="" description="" displayName="借方金额" dynamic="false" dynamicTable="" fieldName="debitamount" fieldType="decimal" fixedLength="false" forLocale="false" help="" id="83fcc169-bd09-4c2f-93eb-0f30b028ed2d" industryChanged="false" isActive="true" isAuthorization="true" isDefaultDimensionAttribute="false" isDefaultMeasureAttribute="false" isFeature="false" isGlobalization="false" isHide="false" isKey="false" isNullable="true" isReadOnly="false" isShare="false" isSource="true" length="28" maxValue="" minValue="" modifyIndustry="0" name="debitamount" notSerialize="false" precise="8" refModelName="" resid="21830001-000111" sequence="4" typeDisplayName="UFDouble" typeName="UFDouble" versionType="0" visibility="public"/>
                <attribute accessStrategy="" accesspower="false" accesspowergroup="" calculation="false" classID="b9f94716-961b-4b46-a0c2-7afbcae1886b" createIndustry="0" dataType="BS000010000100001031" dataTypeStyle="SINGLE" dbtype="decimal" defaultValue="" description="" displayName="贷方金额" dynamic="false" dynamicTable="" fieldName="creditamount" fieldType="decimal" fixedLength="false" forLocale="false" help="" id="6b0dd50b-7d8f-45c2-80c3-0ef3dddcbd94" industryChanged="false" isActive="true" isAuthorization="true" isDefaultDimensionAttribute="false" isDefaultMeasureAttribute="false" isFeature="false" isGlobalization="false" isHide="false" isKey="false" isNullable="true" isReadOnly="false" isShare="false" isSource="true" length="28" maxValue="" minValue="" modifyIndustry="0" name="creditamount" notSerialize="false" precise="8" refModelName="" resid="21830001-000109" sequence="5" typeDisplayName="UFDouble" typeName="UFDouble" versionType="0" visibility="public"/>
                <attribute accessStrategy="" accesspower="false" accesspowergroup="" calculation="false" classID="b9f94716-961b-4b46-a0c2-7afbcae1886b" createIndustry="0" dataType="BS000010000100001030" dataTypeStyle="SINGLE" dbtype="varchar" defaultValue="" description="" displayName="备注" dynamic="false" dynamicTable="" fieldName="note" fieldType="varchar" fixedLength="false" forLocale="false" help="" id="16670d32-f6a6-404b-9b38-7da944c3c7ae" industryChanged="false" isActive="true" isAuthorization="true" isDefaultDimensionAttribute="false" isDefaultMeasureAttribute="false" isFeature="false" isGlobalization="false" isHide="false" isKey="false" isNullable="true" isReadOnly="false" isShare="false" isSource="true" length="1024" maxValue="" minValue="" modifyIndustry="0" name="note" notSerialize="false" precise="" refModelName="" resid="2UC000-000258" sequence="6" typeDisplayName="备注" typeName="MEMO" versionType="0" visibility="public"/>
                <attribute accessStrategy="" accesspower="false" accesspowergroup="" calculation="false" classID="b9f94716-961b-4b46-a0c2-7afbcae1886b" createIndustry="0" dataType="BS000010000100001001" dataTypeStyle="SINGLE" dbtype="varchar" defaultValue="" description="" displayName="常用调整凭证头主键" dynamic="false" dynamicTable="" fieldName="pk_comvouch_head" fieldType="varchar" fixedLength="false" forLocale="false" help="" id="e328f1c8-1478-42c5-96a8-d9e2b7af2bc6" industryChanged="false" isActive="true" isAuthorization="true" isDefaultDimensionAttribute="false" isDefaultMeasureAttribute="false" isFeature="false" isGlobalization="false" isHide="false" isKey="false" isNullable="true" isReadOnly="false" isShare="false" isSource="true" length="50" maxValue="" minValue="" modifyIndustry="0" name="pk_comvouch_head" notSerialize="false" precise="" refModelName="" resid="21830001-000106" sequence="7" typeDisplayName="String" typeName="String" versionType="0" visibility="public"/>
				<attribute accessStrategy="" accesspower="false" accesspowergroup="" calculation="false" classID="b9f94716-961b-4b46-a0c2-7afbcae1886b" createIndustry="0" dataType="BS000010000100001030" dataTypeStyle="SINGLE" dbtype="varchar" defaultValue="" description="" displayName="明细科目" dynamic="false" dynamicTable="" fieldName="mxkm" fieldType="varchar" fixedLength="false" forLocale="false" help="" id="b1fdbb61-e0e2-415d-b400-5fb819429081" industryChanged="false" isActive="true" isAuthorization="true" isDefaultDimensionAttribute="false" isDefaultMeasureAttribute="false" isFeature="false" isGlobalization="false" isHide="false" isKey="false" isNullable="true" isReadOnly="false" isShare="false" isSource="true" length="1024" maxValue="" minValue="" modifyIndustry="0" name="mxkm" notSerialize="false" precise="" refModelName="" resid="2UC000-000258" sequence="6" typeDisplayName="明细科目" typeName="mxkm" versionType="0" visibility="public"/>
            </attributelist>
  •  选中修改过后的BMF文件进行元数据升级

小结

至此,添加元数据结束,本人亲测可用​​​​​​​

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

胡图图爸爸胡英俊

文章自得方为贵,衣钵相传岂是

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值