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

📄 dphssimc.pc

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

 文件名称:DPHSSIMC.pc
 摘    要:PHS产品的互改

 创建日期:2002年05月18日


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

 修改记录:

         取代版本:
         修改时间:
         修 改 人:
         修改摘要:
 功能增加记录:
  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 PHSSIM_FIELD	12
#define PHSSIM_LENGTH   51
#define PHS_FIELD	8
#define PHS_LENGTH      31
#define ACCOUNTINFO_FIELD	26
#define ACCOUNTINFO_LENGTH	201

#define PREPAY_FIELD	22
#define PREPAY_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  gcphone_id[26] = {0};
	char  gcmainphone_id[26] = {0};
  char  gcproduce_id[26] = {0};
	char  gcproduce_no[26] = {0};
	char  gcorder_id[26] = {0};
	char  gcaccept_id[26] = {0};
	char  gcproduct_id[26] = {0};
	char  gcsrv_code[26] = {0};
	char  gcsub_srv[26] = {0};
	char  gcaccept_state[26] = {0};
	char  gcdisp_flag[26] = {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[1000] = {0};
	char  gcproduct_no[25] = {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 gcprod_class[5] = {0};
	char gcprodexch_code[6] = {0};
	char gcprot_code[30] = {0};
  long giswitch_id=0;
	long giprodno_grade=0;
	char gclead_no[21] = {0};
	char lcrelaproduct_id[11] = {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 gcphs_code[31]={0};
  	char gcphssim_id[31]={0};
        char gcdelflag[2]={0};
  int  i=0;
  int	 j=0;
  int  gitimes=0;
  int  gicolnum=0;                    /*传入列数*/
  int  girownum=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  gia8s= -1;
  int  gia8e= -1;
  int  gia8c= 0;
  int  gie7s= -1;
  int  gie7e= -1;
  int  gie7c= 0;
  
  int  gih3s= -1;
  int  gih3e= -1;
  int  gih3c= 0; 

  int  gij2s= -1;
  int  gij2e= -1;
  int  gij2c= 0; 

  int  gid6s= -1;
  int  gid6e= -1;
  int  gid6c= 0; 
  
  int  gia0rows= 0;
  int  gia1rows= 0;
  int  gig0rows= 0;
  int  gig1rows= 0;
  int  gia5rows= 0;
  int  gia8rows= 0;
  int  gie7rows= 0;
  
  int  gih3rows=0;
  int  gij2rows=0;
  int  gid6rows=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};
EXEC SQL END DECLARE SECTION;

int intoPdn_acceptlogProc();						/*生成pdn_acceptlog*/
int intoPdn_pdinfoProc();       	      /*生成pdn_pdinfo*/
int intoSr_accept_logProc();						/*生成sr_accept_log*/
int intoPdn_servcontrolProc();					/*生成pdn_servcontrol*/
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_subsrvProc();								/*生成pdn_subsrv*/
int intoPdn_lineProc();									/*生成pdn_line*/
int intoPdn_trunksProc();								/*生成pdn_trunks*/

int intoPdn_prepayProc();							  /*生成pdn_prepay*/
int intoPdn_phssimProc();								/*生成pdn_phssim*/
int intoPdn_phsProc();								/*生成pdn_phs*/

DLLEXPORT CDECL main()

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

  ncpyParm(1,gcproduce_id,26);
	ncpyParm(2,gcproduce_no,26);
	ncpyParm(3,gcorder_id,26);
	ncpyParm(4,gcaccept_id,26);
	ncpyParm(5,gcproduct_id,26);
	ncpyParm(6,gcsrv_code,26);
	ncpyParm(7,gcsub_srv,26);
	ncpyParm(8,gcaccept_state,26);
	ncpyParm(9,gcdisp_flag,26);
	ncpyParm(10,gcsrv_type,26);
	ncpyParm(11,gcaccept_lan,26);
	ncpyParm(12,gcvest_lan,26);
	ncpyParm(13,gcaccept_grade,26);
	ncpyParm(14,gcaccept_mode,26);
	ncpyParm(15,gccharge_tache,26);
	ncpyParm(16,gcunit_type,26);
	ncpyParm(17,gcunit_code,26);
	ncpyParm(18,gcexch_code,26);
	ncpyParm(19,gcdepart_code,26);
	ncpyParm(20,gcdepart_type,26);
	ncpyParm(21,gcoper_code,26);
	ncpyParm(22,gcterminal_ip,26);
	ncpyParm(23,gcterm_code,26);
	ncpyParm(24,gcproduct_nostr,200);
  	ncpyParm(25,gcowncust_id,26);
  	ncpyParm(26,gcusercust_id,26);
	ncpyParm(27,gcapply_name,21);
	ncpyParm(28,gcapply_cert,2);
	ncpyParm(29,gcapply_certno,31);
	ncpyParm(30,gcapply_tel,41);
	ncpyParm(31,gcapply_addr,256);
  	ncpyParm(32,gcphs_code,31);
  	ncpyParm(33,gcphssim_id,31);
  trim(gcproduce_id);
	trim(gcproduce_no);
	trim(gcorder_id);
	trim(gcaccept_id);
	trim(gcproduct_id);
	trim(gcsrv_code);
	trim(gcsub_srv);
	trim(gcaccept_state);
	trim(gcdisp_flag);
	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(gcowncust_id);
	trim(gcusercust_id);
	trim(gcapply_name);
	trim(gcapply_cert);
	trim(gcapply_certno);
	trim(gcapply_tel);
	trim(gcapply_addr);
  	trim(gcphs_code);
  	trim(gcphssim_id);
    gicolnum=getInRecColNum();
    girownum=getInRecRowNum();
    for(i=0;i<girownum;i++)
    {
      ncpyRec(i,0,gccondition,20);
      trim(gccondition);
#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

/*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);
        }
      }
      
      
      /*H3PDN_PREPAY处理开始*/
      else if (strcmp(gccondition,"H3") == 0)
      {
        gih3e=i;
        gih3c++;
        ncpyRec(i,2,gcrows,5);
        trim(gcrows);
        if (atoi(gcrows) > gih3rows)
        {
          gih3rows = atoi(gcrows);
        }
      }
			/*H3PDN_PREPAY处理结束*/


/*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)
        {
          gig1rows = atoi(gcrows);
        }
      }

/*a5PDN_device处理开始*/
      else if (strcmp(gccondition,"A5") == 0)
      {
        gia5e=i;
        gia5c++;
        ncpyRec(i,6,gcrows,5);
        trim(gcrows);
        if (atoi(gcrows) > gia5rows)
        {
          gia5rows = atoi(gcrows);
        }
      }

/*a8pdn_subsrv处理开始*/
      else if (strcmp(gccondition,"A8") == 0)
      {
        gia8e=i;
        gia8c++;
        ncpyRec(i,6,gcrows,5);
        trim(gcrows);
        if (atoi(gcrows) > gia8rows)
        {
          gia8rows = atoi(gcrows);
        }
      }

/*e7cn_cust_info处理开始*/
      else if (strcmp(gccondition,"E7") == 0)
      {
        gie7e=i;
        gie7c++;
        ncpyRec(i,6,gcrows,5);
        trim(gcrows);
        if (atoi(gcrows) > gie7rows)
        {
          gie7rows = atoi(gcrows);
        }
      }
/*J2pdn_phssim处理开始*/
      else if (strcmp(gccondition,"J2") == 0)
      {
        gij2e=i;
        gij2c++;
        ncpyRec(i,6,gcrows,5);
        trim(gcrows);
        if (atoi(gcrows) > gij2rows)
        {
          gij2rows = atoi(gcrows);
        }
      }      	
/*D6pdn_phs处理开始*/
      else if (strcmp(gccondition,"D6") == 0)
      {
        gid6e=i;
        gid6c++;
        ncpyRec(i,6,gcrows,5);
        trim(gcrows);
        if (atoi(gcrows) > gid6rows)
        {
          gid6rows = atoi(gcrows);
        }
      }      	

    }
/*扫描FOR 循环完成*/


    gia0s = gia0e - gia0c + 1;
    gia1s = gia1e - gia1c + 1;
    
    gih3s = gih3e - gih3c + 1;
    
    gig0s = gig0e - gig0c + 1;
    gig1s = gig1e - gig1c + 1;
    gia5s = gia5e - gia5c + 1;
    gia8s = gia8e - gia8c + 1;
    gie7s = gie7e - gie7c + 1;
    gij2s = gij2e - gij2c + 1;
    gid6s = gid6e - gid6c + 1;    
      gcretval=intoPdn_acceptlogProc();   	     /*生成pdn_acceptlog详细资料*/
      if (gcretval != 0)
      {
#ifdef	YYDEBUG
        DebugLog("acceptlog");
        fclose(tracefp);
		CopyTr(gcfilename,gcyyerrlog);
#endif
        exceptExit(gcretval,gcretstr);
      }
/*      if ((gitimes==0)||(gitimes==1))

⌨️ 快捷键说明

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