strPoke

// Copyright (C), 2015, CEU Co., Ltd.
// USR Changed by 2015-02-02T11:00:34 Fandy Xie 谢宇帆
// Version       : 1.0
// Description   : 快速自定义设置主键流水编号
// Return        :
static void strPoke(Args _args)
{
//name getNextId()
    name    month, maxId, numStr, ret, numPoke;
    int     i;
    #YIP_EWF
    #define.prefixSubCompany("Fandy")
    #define.SubCompanyNumLen(5)

    name getMaxId()
    {
        YIP_EWFSubGroup   table;
        select maxof(SubGroupId) from table
                where table.SubGroupId like #prefixSubCompany + '*';

        return table.SubGroupId;
    }
    ;

    maxId  = getMaxId();
    if(maxId)
        numStr = substr(maxId, strlen(maxId),- #SubCompanyNumLen);
    for (i = 1; i <= #SubCompanyNumLen; i++)
    {
        numPoke += "0";
    }
    numStr  = int2str(str2int(numStr) + 1);
    ret     = #prefixSubCompany + strPoke(numPoke, numStr, #SubCompanyNumLen + 1 - strLen(numStr));

    info(ret);//Fandy00001
}


你可能感兴趣的:(strPoke)