⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dphsmod.pc

📁 小灵通机卡分离模块的设计.建立在数据库服务器
💻 PC
📖 第 1 页 / 共 5 页
字号:
/********************************************************************
* Copyright (c) 2002-2008. 广州南方电信系统软件有限公司
All rights reserved.

文件名称:DPHSMOD.pc
摘    要:改PHS产品信息

创建日期:2002年09月06日


当前版本:1.0
作    者:wgm
成日期:

修改记录:

取代版本:
修改时间:
修 改 人:
修改摘要:
功能增加记录:
1、输入参数:



输出:成功或失败
根据


********************************************************************/
#define YYDEBUG
#include "cicslink.h"
#include "yypublic.h"
#include "genid.h"
EXEC SQL BEGIN DECLARE SECTION;
#define PDINFO_FIELD	48
#define PDINFO_LENGTH	301
#define PHONE_FIELD	28
#define PHONE_LENGTH	201
#define ACCOUNTINFO_FIELD	26
#define ACCOUNTINFO_LENGTH	201
#define PREPAY_FIELD	22
#define PREPAY_LENGTH	256
#define PHSSIM_FIELD	12
#define PHSSIM_LENGTH	256
EXEC SQL END DECLARE SECTION;

EXEC SQL INCLUDE sqlca;


EXEC SQL BEGIN DECLARE SECTION;
char  gcretstr[200] = {0};                /*返回信息串*/
char  gcfilename[100] = {0};
char gcyyerrlog[100] = {0};
char  gccondition[20] = {0};
char  gcrows[5] = {0};
int   gcretval=0;                   /*返回值*/

char  gcoldproduce_id[10][26] = {0};
char  gcoldproduce_no[10][26] = {0};
char  gcoldaccept_id[10][26] = {0};
char  gcoldproduct_id[10][26] = {0};
char  gcoldsrv_code[10][26] = {0};
char  gcoldaccept_state[10][26] = {0};
char  gcfield_modifystr[10][2000] = {0};

char  gcnewproduce_id[10][26] = {0};
char  gcnewproduce_no[10][26] = {0};
char  gcnewaccept_id[10][26] = {0};
char  gcnewproduct_id[10][26] = {0};
char  gcnewsrv_code[10][26] = {0};
char  gcnewaccept_state[10][26] = {0};
char  gcnewchantypestr[10][2000] = {0};

char  gcsrv_name[10][50] = {0};
char  gcsub_srv[10][26] = {0};
int   giuseflsg[10] = {0};

char  gcmainproduce_id[26] = {0};
char  gcmainproduce_no[26] = {0};
char  gcmainorder_id[26] = {0};
char  gcmainaccept_id[26] = {0};
char  gcmainproduct_id[26] = {0};
char  gcmainsrv_code[26] = {0};
char  gcmainsrv_name[50] = {0};
char  gcmainaccept_state[26] = {0};
char  gcmainsub_srv[26] = {0};
char  gcmainproduct_no[25] = {0};

char  gcsrv_type[26] = {0};
char  gcaccept_lan[26] = {0};
char  gcvest_lan[26] = {0};
char  gcaccept_grade[26] = {0};
int   giaccept_grade_value=0;
char  gcaccept_mode[26] = {0};
char  gccharge_tache[26] = {0};
char  gcunit_type[26] = {0};
char  gcunit_code[26] = {0};
char  gcexch_code[26] = {0};
char  gcdepart_code[26] = {0};
char  gcdepart_type[26] = {0};
char  gcoper_code[26] = {0};
char  gcterminal_ip[26] = {0};
char  gcterm_code[26] = {0};
char  gcproduct_nostr[2000] = {0};
char  gcps_codestr[2000] = {0};
char  lcps_code[40] = {0};
char  gcproduct_no[26] = {0};
int 	gideal_grad=0;
char  gccust_type[5] = {0};
int   gicust_type_value=0;
char  gcowncust_id[26] = {0};
char  gcusercust_id[26] = {0};
char	gccust_id[26] = {0};
char	gcbtime[26] = {0};
char	gcbact[26] = {0};
char  gcprod_class[5] = {0};
char  gcoldprod_class[5] = {0};
char  gcpriproduce_id[26] = {0};
char  gcpriproduce_no[26] = {0};
char  gcprodexch_code[6] = {0};
char  gcprot_code[30] = {0};
char  gcswitch_id[20] = {0};
long  giswitch_id=0;
char  gctempfield[10] = {0};
char  gcfieldstr[10] = {0};
char  gctempsrv_code[10] = {0};
int   gizjyj=0;
char 	gcservinfofield[10][300] = {0};
char  gcservinfotable[10][20] = {0};
char  gctempfieldstr[500] = {0};
char  gctempstr[20] = {0};
char  gcrollsrv_code[10][10] = {0};
char  gcrollproduce_no[10][26] = {0};
char	girolls=0;
char  gcprisrv_code[26] = {0};
char  gcdelflag[5] = {0};
char  gcnewflag[2] = {0};
char  gcbjflag[2] = {0};
char  gclink_srvstr[10] = {0};
char  gcday_len[5] = {0};
char  gctime_type[5] = {0};
char  gcstime[30] = {0};
char  gclang_type[5] = {0};
char gcapply_name[21] = {0};
char gcapply_cert[2] = {0};
char gcapply_certno[31] = {0};
char gcapply_tel[41] = {0};
char gcapply_addr[256] = {0};
char gcaccount_id[26] = {0};

char  gcsim_codestr[2000] = {0};
int  i=0;
int	 j=0;
int	 k=0;
int  gitimes=0;
int  gicolnum=0;                    /*传入列数*/
int  girownum=0;                    /*传入行数*/
int  girecords=0;										/*记录数*/
int  gia0s= -1;
int  gia0e= -1;
int  gia0c= 0;
int  gia1s= -1;
int  gia1e= -1;
int  gia1c= 0;
int  gig0s= -1;
int  gig0e= -1;
int  gig0c= 0;
int  gig1s= -1;
int  gig1e= -1;
int  gig1c= 0;
int  gia5s= -1;
int  gia5e= -1;
int  gia5c= 0;
int  gid6s= -1;
int  gid6e= -1;
int  gid6c= 0;
int  gie7s= -1;
int  gie7e= -1;
int  gie7c= 0;
int  gih3s= -1;
int  gih3e= -1;
int  gih3c= 0;
int  giadds= -1;
int  giadde= -1;
int  giaddc= 0;
int  gisrvc= 0;
int  gisubc= 0;
int  gia0rows= 0;
int  gia1rows= 0;
int  gig0rows= 0;
int  gig1rows= 0;
int  gia5rows= 0;
int  gid6rows= 0;
int  gie7rows= 0;
int  gih3rows= 0;
int  giaddrows= 0;
int  gilines= 0;

char g0[300] = {0};
char g1[300] = {0};
char g2[300] = {0};
char g3[300] = {0};
char g4[300] = {0};
char g5[300] = {0};
char g6[300] = {0};
char g7[300] = {0};
char g8[300] = {0};

char debugstr[2000];

int  gij2s= -1;
int  gij2e= -1;
int  gij2c= 0;
EXEC SQL END DECLARE SECTION;

int intoPdn_pdinfoProc();       	      /*生成pdn_pdinfo*/
int intoCn_cust_infoProc();							/*生成cn_cust_info*/
int intoPdn_phoneProc();								/*生成pdn_phone*/
int intoPdn_incr_prodProc();						/*生成pdn_incr_prod*/
int intoPdn_prod_propProc();						/*生成pdn_prod_prop*/
int intoPdn_deviceProc();								/*生成pdn_device*/
int intoPdn_linkinfoProc();							/*生成pdn_linkinfo*/
int intoPdn_phsProc();									/*生成pdn_phs*/
int intoPdn_prepayProc();								/*生成pdn_prepay*/
int judge_srvcodeProc();								/*判断业务码,生成工单*/
int initializtionProc();								/*初始化处理*/
void intoPdnprepayinfo();           				/*增加小灵通预付费信息*/
int intoPdn_phssimProc();									/*生成pdn_phssim*/
DLLEXPORT CDECL main()

{
	#ifdef	YYDEBUG
	sprintf(gcfilename,"%s%s",DEBUGDIR,"dphsmod.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("DPHSMOD") != 0)   	      /*初始化通讯区*/
	{
		#ifdef	YYDEBUG
		fclose(tracefp);
		CopyTr(gcfilename,gcyyerrlog);
		#endif
		exceptExit(10002,INI_COMM_ERR );          /*初始化错误,退出服务*/
	}
	i = getInParamNum();
	if (getInParamNum() < 31)
	{
		#ifdef	YYDEBUG
		DebugLog("i=%d",i);
		fclose(tracefp);
		CopyTr(gcfilename,gcyyerrlog);
		#endif
		exceptExit(10001,PARAM_ERR );	      /*参数输入错误,退出服务*/
	}

	ncpyParm(1,gcmainproduce_id,26);
	ncpyParm(2,gcmainproduce_no,26);
	ncpyParm(3,gcmainorder_id,26);
	ncpyParm(4,gcmainaccept_id,26);
	ncpyParm(5,gcmainproduct_id,26);
	ncpyParm(6,gcsrv_type,26);
	ncpyParm(7,gcaccept_lan,26);
	ncpyParm(8,gcvest_lan,26);
	ncpyParm(9,gcaccept_grade,26);
	ncpyParm(10,gcaccept_mode,26);
	ncpyParm(11,gccharge_tache,26);
	ncpyParm(12,gcunit_type,26);
	ncpyParm(13,gcunit_code,26);
	ncpyParm(14,gcexch_code,26);
	ncpyParm(15,gcdepart_code,26);
	ncpyParm(16,gcdepart_type,26);
	ncpyParm(17,gcoper_code,26);
	ncpyParm(18,gcterminal_ip,26);
	ncpyParm(19,gcterm_code,26);
	ncpyParm(20,gcproduct_nostr,2000);
	ncpyParm(21,gcps_codestr,2000);
	ncpyParm(22,gcmainsrv_code,26);
	ncpyParm(23,gcmainaccept_state,26);
	ncpyParm(24,gcmainsub_srv,26);
	ncpyParm(25,gcprod_class,5);
	ncpyParm(26,gcpriproduce_no,26);
	ncpyParm(27,gccust_type,5);
	ncpyParm(28,gcprodexch_code,6);
	ncpyParm(29,gcswitch_id,20);
	ncpyParm(30,gcprot_code,30);
	ncpyParm(31,gcbjflag,2);
	ncpyParm(32,gclink_srvstr,10);
	ncpyParm(33,gclang_type,5);
	ncpyParm(34,gcstime,30);
	ncpyParm(35,gcday_len,5);
	ncpyParm(36,gctime_type,5);
	ncpyParm(37,gcapply_name,21);
	ncpyParm(38,gcapply_cert,2);
	ncpyParm(39,gcapply_certno,31);
	ncpyParm(40,gcapply_tel,41);
	ncpyParm(41,gcapply_addr,256);
	ncpyParm(42,gcsim_codestr,2000);
	trim(gcmainproduce_id);
	trim(gcmainproduce_no);
	trim(gcmainorder_id);
	trim(gcmainaccept_id);
	trim(gcmainproduct_id);
	trim(gcsrv_type);
	trim(gcaccept_lan);
	trim(gcvest_lan);
	trim(gcaccept_grade);
	trim(gcaccept_mode);
	trim(gccharge_tache);
	trim(gcunit_type);
	trim(gcunit_code);
	trim(gcexch_code);
	trim(gcdepart_code);
	trim(gcdepart_type);
	trim(gcoper_code);
	trim(gcterminal_ip);
	trim(gcterm_code);
	trim(gcproduct_nostr);
	trim(gcps_codestr);
	trim(gcmainsrv_code);
	trim(gcmainaccept_state);
	trim(gcmainsub_srv);
	trim(gcprod_class);
	trim(gcpriproduce_no);
	trim(gccust_type);
	trim(gcprodexch_code);
	trim(gcprot_code);
	trim(gcswitch_id);
	trim(gcbjflag);
	trim(gclink_srvstr);
	trim(gclang_type);
	trim(gcstime);
	trim(gcday_len);
	trim(gctime_type);
	trim(gcapply_name);
	trim(gcapply_cert);
	trim(gcapply_certno);
	trim(gcapply_tel);
	trim(gcapply_addr);
	trim(gcsim_codestr);
	#ifdef	YYDEBUG
	DebugLog("gcmainproduce_id=%s",gcmainproduce_id);
	DebugLog("gcmainproduce_no=%s",gcmainproduce_no);
	DebugLog("gcmainorder_id=%s",gcmainorder_id);
	DebugLog("gcmainaccept_id=%s",gcmainaccept_id);
	DebugLog("gcmainproduct_id=%s",gcmainproduct_id);
	DebugLog("gcsrv_type=%s",gcsrv_type);
	DebugLog("gcaccept_lan=%s",gcaccept_lan);
	DebugLog("gcvest_lan=%s",gcvest_lan);
	DebugLog("gcaccept_grade=%s",gcaccept_grade);
	DebugLog("gcaccept_mode=%s",gcaccept_mode);
	DebugLog("gccharge_tache=%s",gccharge_tache);
	DebugLog("gcunit_type=%s",gcunit_type);
	DebugLog("gcunit_code=%s",gcunit_code);
	DebugLog("gcexch_code=%s",gcexch_code);
	DebugLog("gcdepart_code=%s",gcdepart_code);
	DebugLog("gcdepart_type=%s",gcdepart_type);
	DebugLog("gcoper_code=%s",gcoper_code);
	DebugLog("gcterminal_ip=%s",gcterminal_ip);
	DebugLog("gcterm_code=%s",gcterm_code);
	DebugLog("gcproduct_nostr=%s",gcproduct_nostr);
	DebugLog("gcps_codestr=%s",gcps_codestr);
	DebugLog("gcmainsrv_code=%s",gcmainsrv_code);
	DebugLog("gcmainaccept_state=%s",gcmainaccept_state);
	DebugLog("gcmainsub_srv=%s",gcmainsub_srv);
	DebugLog("gcprod_class=%s",gcprod_class);
	DebugLog("gcpriproduce_no=%s",gcpriproduce_no);
	DebugLog("gccust_type=%s",gccust_type);
	DebugLog("gcprodexch_code=%s",gcprodexch_code);
	DebugLog("gcprot_code=%s",gcprot_code);
	DebugLog("gcswitch_id=%s",gcswitch_id);
	DebugLog("gcbjflag=%s",gcbjflag);
	DebugLog("gclink_srvstr=%s",gclink_srvstr);
	DebugLog("gclang_type=%s",gclang_type);
	DebugLog("gcstime=%s",gcstime);
	DebugLog("gcday_len=%s",gcday_len);
	DebugLog("gctime_type=%s",gctime_type);
	DebugLog("gcapply_name=%s",gcapply_name);
	DebugLog("gcapply_cert=%s",gcapply_cert);
	DebugLog("gcapply_certno=%s",gcapply_certno);
	DebugLog("gcapply_tel=%s",gcapply_tel);
	DebugLog("gcapply_addr=%s",gcapply_addr);
	DebugLog("gcsim_codestr=%s",gcsim_codestr);
	#endif


	for(i=0;i<10;i++)
	{
		gcnewproduce_id[i][0]=0;
		gcnewproduce_no[i][0]=0;
		gcnewaccept_id[i][0]=0;
		gcnewproduct_id[i][0]=0;
		gcnewsrv_code[i][0]=0;
		gcsrv_name[i][0]=0;
		gcnewaccept_state[i][0]=0;
		gcrollsrv_code[i][0]=0;
		gcrollproduce_no[i][0]=0;
	}

	gicolnum=getInRecColNum();
	girownum=getInRecRowNum();
	for(i=0;i<girownum;i++)
	{
		#ifdef	YYDEBUG
		ncpyRec(i,0,g0,300);
		ncpyRec(i,1,g1,300);
		ncpyRec(i,2,g2,300);
		ncpyRec(i,3,g3,300);
		ncpyRec(i,4,g4,300);
		ncpyRec(i,5,g5,300);
		ncpyRec(i,6,g6,300);
		ncpyRec(i,7,g7,300);
		ncpyRec(i,8,g8,300);
		DebugLog("i=%d,g0=%s",i,g0);
		DebugLog("i=%d,g1=%s",i,g1);
		DebugLog("i=%d,g2=%s",i,g2);
		DebugLog("i=%d,g3=%s",i,g3);
		DebugLog("i=%d,g4=%s",i,g4);
		DebugLog("i=%d,g5=%s",i,g5);
		DebugLog("i=%d,g6=%s",i,g6);
		DebugLog("i=%d,g7=%s",i,g7);
		DebugLog("i=%d,g8=%s",i,g8);
		#endif


		ncpyRec(i,0,gccondition,20);
		trim(gccondition);

		/*A0PDN_PDINFO处理开始*/
		if (strcmp(gccondition,"A0") == 0)
		{
			gia0e=i;
			gia0c++;
			ncpyRec(i,6,gcrows,5);
			trim(gcrows);
			if (atoi(gcrows) > gia0rows)
			{
				gia0rows = atoi(gcrows);
			}
		}


		/*A1PDN_phone处理开始*/
		else if (strcmp(gccondition,"A1") == 0)
		{
			gia1e=i;
			gia1c++;
			ncpyRec(i,6,gcrows,5);
			trim(gcrows);
			if (atoi(gcrows) > gia1rows)
			{
				gia1rows = atoi(gcrows);
			}
		}


		/*g0PDN_incr_prod处理开始*/
		else if (strcmp(gccondition,"G0") == 0)
		{
			gig0e=i;
			gig0c++;
			ncpyRec(i,6,gcrows,5);
			trim(gcrows);
			if (atoi(gcrows) > gig0rows)
			{
				gig0rows = atoi(gcrows);
			}
		}

		/*g1pdn_prod_prop处理开始*/
		else if (strcmp(gccondition,"G1") == 0)
		{
			gig1e=i;
			gig1c++;
			ncpyRec(i,6,gcrows,5);
			trim(gcrows);
			if (atoi(gcrows) > gig1rows)
			{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -