📄 gprodinf.pc
字号:
/********************************************************************
* Copyright (c) 2002-2008. 广州南方电信系统软件有限公司
All rights reserved.
文件名称:GPRODINF.pc
摘 要:根据输入参数获取产品资料。
创建日期:2002年05月20日
当前版本:1.0
作 者:wgm
成日期:
修改记录:
取代版本:
修改时间:
修 改 人:
修改摘要:
功能增加纪录:
1、生产编号 如果为空,则根据产品编号检索
2、生产流水 如果为空,则根据产品编号检索,否则,根据生产编号,生产流水检索
3、产品编号
4、表名简码
5、新旧信息标志 '0':检索旧信息'1':检索新信息
6、标志 'owner'如果表名简码为客户资料,则检索客户的所有者信息
'user': 如果表名简码为客户资料,则检索客户的使用者信息
'main': 如果表名简码为电话资料,则检索电话的主号码信息;
'child: 如果表名简码为电话资料,则检索电话的子号码信息
'all': 如果表名简码为客户或电话资料,则检索客户或电话的所有信息
'03/04/':如果表名简码为pdn_relate,则检索rela_type=03|04的记录
********************************************************************/
#include "cicslink.h"
#include "yypublic.h"
EXEC SQL INCLUDE sqlca;
EXEC SQL BEGIN DECLARE SECTION;
char gcretstr[200] = {0}; /*返回信息串*/
char gcfilename[100] = {0};
char gcyyerrlog[100] = {0};
int gcretval=0; /*返回值*/
char gcret[5] = {0};
char gcproduce_id[26] = {0};
char gcproduce_no[26] = {0};
char gcproduct_id[26] = {0};
char gctable_name[20] = {0};
char gcproduce_type[2] = {0};
char gcscopeflag[10] = {0};
char gcsrv_code[10] = {0};
char gcact_type[5] = {0};
int gimodifys=0;
EXEC SQL END DECLARE SECTION;
int getpdinfoProc(char *pflag,char *sflag); /*获取pdinfo详细资料*/
int getphoneProc(char *pflag,char *sflag); /*获取phone详细资料*/
int getincr_prodProc(char *pflag,char *sflag); /*获取incr_prod详细资料*/
int getprod_propProc(char *pflag,char *sflag); /*获取prod_prop详细资料*/
int getaccountProc(char *pflag,char *sflag); /*获取account详细资料*/
int getaccountinfoProc(char *pflag,char *sflag); /*获取accountinfo详细资料*/
int getdeviceProc(char *pflag,char *sflag); /*获取device详细资料*/
int getwarrantorProc(char *pflag,char *sflag); /*获取warrantor详细资料*/
int getcust_infoProc(char *pflag,char *sflag); /*获取cust_info详细资料*/
int getlinkinfoProc(char *pflag,char *sflag); /*获取linkinfo详细资料*/
int getphsProc(char *pflag,char *sflag); /*获取phs详细资料*/
int getacceptlogProc(char *pflag,char *sflag); /*获取acceptlog详细资料*/
int getrelayProc(char *pflag,char *sflag); /*获取relay详细资料*/
int getvoiceProc(char *pflag,char *sflag); /*获取voice详细资料*/
int get800Proc(char *pflag,char *sflag); /*获取800详细资料*/
int get800noProc(char *pflag,char *sflag); /*获取800no详细资料*/
int get200Proc(char *pflag,char *sflag); /*获取200详细资料*/
int getrelateProc(char *pflag,char *sflag); /*获取relate详细资料*/
int getdataprodProc(char *pflag,char *sflag); /*获取dataprod详细资料*/
int getoppprodProc(char *pflag,char *sflag); /*获取oppprod详细资料*/
int getpvcProc(char *pflag,char *sflag); /*获取pvc详细资料*/
int getatmProc(char *pflag,char *sflag); /*获取atm详细资料*/
int getpacProc(char *pflag,char *sflag); /*获取pac详细资料*/
int getadslProc(char *pflag,char *sflag); /*获取adsl详细资料*/
int getdatarelayProc(char *pflag,char *sflag); /*获取datarelay详细资料*/
int getlanProc(char *pflag,char *sflag); /*获取lan详细资料*/
int getvpnProc(char *pflag,char *sflag); /*获取vpn详细资料*/
int get163dialProc(char *pflag,char *sflag); /*获取163dial详细资料*/
int get163lineProc(char *pflag,char *sflag); /*获取163line详细资料*/
int getvirhostProc(char *pflag,char *sflag); /*获取virhost详细资料*/
int gethostmanaProc(char *pflag,char *sflag); /*获取hostmana详细资料*/
int getequiphireProc(char *pflag,char *sflag); /*获取equiphire详细资料*/
int getvpdnProc(char *pflag,char *sflag); /*获取vpdn详细资料*/
int getjrightProc(char *pflag,char *sflag); /*获取jright详细资料*/
int getipProc(char *pflag,char *sflag); /*获取ip详细资料*/
int getvnetProc(char *pflag,char *sflag); /*获取vnet详细资料*/
int getip_videoProc(char *pflag,char *sflag); /*获取ip_video详细资料*/
int getidcProc(char *pflag,char *sflag); /*获取idc详细资料*/
int getuptProc(char *pflag,char *sflag); /*获取upt详细资料*/
int getappintinfoProc(char *pflag,char *sflag); /*获取appintinfo详细资料*/
int getappintaccProc(char *pflag,char *sflag); /*获取appintacc详细资料*/
int getwacProc(char *pflag,char *sflag); /*获取wac详细资料*/
int getphssimProc(char *pflag,char *sflag); /*获取phssim详细资料*/
DLLEXPORT CDECL main()
{
#ifdef YYDEBUG
sprintf(gcfilename,"%s%s",DEBUGDIR,"gprodinf.tr");
trim(gcfilename);
sprintf(gcyyerrlog,"%s%s",DEBUGDIR,"yyerrlog.tr");
trim(gcyyerrlog);
if((tracefp=fopen(gcfilename,"w"))==NULL)
{
fprintf(stderr,"open trace file error\n");
exceptExit(10002,INI_COMM_ERR );
}
#endif
if (getInputData("GPRODINF") != 0) /*初始化通讯区*/
{
#ifdef YYDEBUG
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(10002,INI_COMM_ERR ); /*初始化错误,退出服务*/
}
if (getInParamNum() < 6)
{
#ifdef YYDEBUG
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(10001,PARAM_ERR ); /*参数输入错误,退出服务*/
}
ncpyParm(1,gcproduce_id,26);
ncpyParm(2,gcproduce_no,26);
ncpyParm(3,gcproduct_id,26);
ncpyParm(4,gctable_name,20);
ncpyParm(5,gcproduce_type,2);
ncpyParm(6,gcscopeflag,10);
trim(gcproduce_id);
trim(gcproduce_no);
trim(gcproduct_id);
trim(gctable_name);
trim(gcproduce_type);
trim(gcscopeflag);
#ifdef YYDEBUG
DebugLog("ncpyparm,gcproduce_id=%s",gcproduce_id);
DebugLog("ncpyparm,gcproduce_no=%s",gcproduce_no);
DebugLog("ncpyparm,gcproduct_id=%s",gcproduct_id);
DebugLog("ncpyparm,gctable_name=%s",gctable_name);
DebugLog("ncpyparm,gcproduce_type=%s",gcproduce_type);
DebugLog("ncpyparm,gcscopeflag=%s",gcscopeflag);
#endif
/*判断检索条件*/
if (gcproduce_id[0] != 0)
{
EXEC SQL SELECT srv_code INTO :gcsrv_code FROM pdn_servcontrol WHERE produce_id = :gcproduce_id AND produce_no = :gcproduce_no;
if (sqlca.sqlcode != 0)
{
#ifdef YYDEBUG
DebugLog("pdn_servcontrol,error!!!");
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(-1,"查询pdn_servcontrol出错");
}
trim(gcsrv_code);
EXEC SQL SELECT act_type INTO :gcact_type FROM dr_service WHERE srv_code = :gcsrv_code;
if (sqlca.sqlcode != 0)
{
#ifdef YYDEBUG
DebugLog("dr_service,error!!!");
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(-1,"查询dr_service出错");
}
trim(gcact_type);
if (strcmp(gcsrv_code,"00") == 0)
{
EXEC SQL SELECT 1 INTO :gimodifys FROM dual WHERE EXISTS(SELECT 1 FROM pdn_pdinfo WHERE produce_id = :gcproduce_id AND produce_type = 0);
if (sqlca.sqlcode < 0)
{
#ifdef YYDEBUG
DebugLog("pdn_pdinfo,error!!!");
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(-1,"查询pdn_pdinfo出错");
}
}
}
#ifdef YYDEBUG
DebugLog("ncpyparm,gcproduce_id=%s",gcproduce_id);
DebugLog("ncpyparm,gcproduce_no=%s",gcproduce_no);
DebugLog("ncpyparm,gcproduct_id=%s",gcproduct_id);
DebugLog("ncpyparm,gctable_name=%s",gctable_name);
DebugLog("ncpyparm,gcproduce_type=%s",gcproduce_type);
DebugLog("ncpyparm,gcscopeflag=%s",gcscopeflag);
DebugLog("ncpyparm,gcsrv_code=%s",gcsrv_code);
DebugLog("ncpyparm,gcact_type=%s",gcact_type);
#endif
/*pdinfo处理开始*/
if (strcmp(gctable_name,"A0") == 0 ) /*pdn_pdinfo*/
{
if (gcproduce_id[0] == 0) /*生产编号为空*/
{
gcretval=getpdinfoProc("pdn","2"); /*根据产品编号取pdn_pdinfo*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pdn,2,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
gcretval=getpdinfoProc("pd","2"); /*根据产品编号取pd_pdinfo*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pd,2,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
strcpy(gcretstr,"检索pdinfo无纪录");
#ifdef YYDEBUG
fclose(tracefp);
#endif
sprintf(gcret,"%d",gcretval);
addParams(BEGIN,gcret,END);
normalExit(gcretval,gcretstr);
}
}
}
else if (gcproduce_id[0] != 0) /*生产编号不为空*/
{
gcretval=getpdinfoProc("pdn","7"); /*根据生产编号取pdn_pdinfo*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pdn,7,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
strcpy(gcretstr,"检索pdinfo无纪录");
#ifdef YYDEBUG
fclose(tracefp);
#endif
sprintf(gcret,"%d",gcretval);
addParams(BEGIN,gcret,END);
normalExit(gcretval,gcretstr);
}
}
}
/*phone处理开始*/
else if (strcmp(gctable_name,"A1") == 0 ) /*pdn_phone*/
{
if (gcproduce_id[0] == 0) /*生产编号为空*/
{
gcretval=getphoneProc("pdn","2"); /*根据产品编号取pdn_phone*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pdn,2,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
gcretval=getphoneProc("pd","2"); /*根据产品编号取pd_phone*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pd,2,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
strcpy(gcretstr,"检索phone无纪录");
#ifdef YYDEBUG
fclose(tracefp);
#endif
sprintf(gcret,"%d",gcretval);
addParams(BEGIN,gcret,END);
normalExit(gcretval,gcretstr);
}
}
}
else if (gcproduce_id[0] != 0) /*生产编号不为空*/
{
gcretval=getphoneProc("pdn","7"); /*根据生产编号取pdn_phone*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pdn,7,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
strcpy(gcretstr,"检索phone无纪录");
#ifdef YYDEBUG
fclose(tracefp);
#endif
sprintf(gcret,"%d",gcretval);
addParams(BEGIN,gcret,END);
normalExit(gcretval,gcretstr);
}
}
}
/*incr_prod处理开始*/
else if (strcmp(gctable_name,"G0") == 0 ) /*pdn_incr_prod*/
{
if (gcproduce_id[0] == 0) /*生产编号为空*/
{
gcretval=getincr_prodProc("pdn","2"); /*根据产品编号取pdn_incr_prod*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pdn,2,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
gcretval=getincr_prodProc("pd","2"); /*根据产品编号取pd_incr_prod*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pd,2,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
strcpy(gcretstr,"检索incr_prod无纪录");
#ifdef YYDEBUG
fclose(tracefp);
#endif
sprintf(gcret,"%d",gcretval);
addParams(BEGIN,gcret,END);
normalExit(gcretval,gcretstr);
}
}
}
else if (gcproduce_id[0] != 0) /*生产编号不为空*/
{
gcretval=getincr_prodProc("pdn","7"); /*根据生产编号取pdn_incr_prod*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pdn,7,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
strcpy(gcretstr,"检索incr_prod无纪录");
#ifdef YYDEBUG
fclose(tracefp);
#endif
sprintf(gcret,"%d",gcretval);
addParams(BEGIN,gcret,END);
normalExit(gcretval,gcretstr);
}
}
}
/*prod_prop处理开始*/
else if (strcmp(gctable_name,"G1") == 0 ) /*pdn_prod_prop*/
{
if (gcproduce_id[0] == 0) /*生产编号为空*/
{
gcretval=getprod_propProc("pdn","2"); /*根据产品编号取pdn_prod_prop*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pdn,2,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
gcretval=getprod_propProc("pd","2"); /*根据产品编号取pd_prod_prop*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pd,2,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
strcpy(gcretstr,"检索prod_prop无纪录");
#ifdef YYDEBUG
fclose(tracefp);
#endif
sprintf(gcret,"%d",gcretval);
addParams(BEGIN,gcret,END);
normalExit(gcretval,gcretstr);
}
}
}
else if (gcproduce_id[0] != 0) /*生产编号不为空*/
{
gcretval=getprod_propProc("pdn","7"); /*根据生产编号取pdn_prod_prop*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pdn,7,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
#endif
exceptExit(gcretval,gcretstr);
}
else if (gcretval == 0)
{
strcpy(gcretstr,"检索prod_prop无纪录");
#ifdef YYDEBUG
fclose(tracefp);
#endif
sprintf(gcret,"%d",gcretval);
addParams(BEGIN,gcret,END);
normalExit(gcretval,gcretstr);
}
}
}
/*mobile处理开始*/
else if (strcmp(gctable_name,"G3") == 0 ) /*pdn_mobile*/
{
if (gcproduce_id[0] == 0) /*生产编号为空*/
{
gcretval=getmobileProc("pdn","2"); /*根据产品编号取pdn_mobile*/
if (gcretval < 0)
{
#ifdef YYDEBUG
DebugLog("pdn,2,error!!!gcretstr=%s",gcretstr);
fclose(tracefp);
CopyTr(gcfilename,gcyyerrlog);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -