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

📄 pcs_convert_file.pc

📁 unix 下用pro*c tuxedo 开发的东西
💻 PC
字号:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

*	File name		: Pcs_Convert_File.x	                   		*

*	Module ID		:				          	*

*	Module Name	:                                                 	*

*	Purpose		: convert ml,gh,tjbb,zfj,zdys,pdys to a file	*

*	Author             	: lix                                       	*

*	Date Created	: 1999,07,29                                       	*

*	Version		: Version 1.0                                      	*

*	Environment	: Digital UNIX                                     	*

*	Portability	: UNIX Platform                                    	*

*	Warnings		:                                              	*

*	References	:                                                      	*

*	Calling Syntax	:                                                  	*

*	Parameters	: None                                                 	*

*	Returns		: void                                          	*

*	Calling Function	:                                             	*

*	Called Functions	: main function	                        	*

*	Datastores and usages:                                            	*     

*        	   (a) Input                                                 		*

* 	   (b) OutPut                                                     	*       

*	Report		: None                                        	*

*	Screens		: None                                         	*

*	Messages Files	: None                                         	*

*	Change Log	:                                                      	*

*	Change No. 	Date	Author	Reason For Change         	*

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

*/

#include "stdio.h"

#include "stdlib.h"

#include "sqlcpr.h"

#include <fcntl.h>

#include <signal.h>

#include "/usr/bkfx/include/myapi.h"

#include "/usr/bkfx/include/Pcs_Convert_File/Pcs_Convert_File.h"

#include "/usr/bkfx/include/Pcs_Convert_File/convapi.h"





int main()

{

	char sjfl;

	char sjbh[3];

	char temp,temp2;

	char temp3;/*it is used only for test some sjfl*/

	long int jsxh;

	int  flag,rec_count;

	int retcode=0;

	char *PID = "Client Txn Clt_Mpt Process(Port 7111)";

	char produce_err_str[35];
	int total_num_fbkj;
	

	NOCONVERT='1';

	WAITFORCONVERT='2';

	CONVERTED='6';

	ERROR=0;


	init_time=0;
	

	signal(SIGTERM,freect);

	ProcessError(LOG_NORMAL,"PCS_Convert_File: this is NORMAL message in ","convertfile");



	flag=InitPcsConvertFile();

	if(flag!=0)

	{

		ProcessError(LOG_ERROR,"PCS_Convert_File: Error in function Init error", END);

		exit(0);

	}

	

	createdir();

	init_fbkj_wjbh();
	temp = SJFL_YXSJ;

	temp2= SJFL_BSFX;

	temp3= SJFL_PDYS;

	iTInterval=0;

	iTInterval=GetTimeInterval("PCS_CONVERT");

	EXEC SQL SELECT bsbh INTO :BsbhFromT FROM T_BSBH;

	

begin:


	exec sql select count(*) into :total_num_fbkj from t_fbkj;
	if ( total_num_fbkj != g_fbkj_count )
		init_fbkj_wjbh();
	strcpy(YS_SINGAL,"        ");


	EXEC SQL SELECT count(*) INTO :rec_count FROM t_jsrz WHERE sjzt=:WAITFORCONVERT AND sjfl<>:temp2 ;/**/

	if( rec_count==0 ) 
		goto End;

	EXEC SQL DECLARE cur_convert CURSOR FOR

		SELECT jsxh,sjfl,sjbh FROM t_jsrz WHERE sjzt=:WAITFORCONVERT AND sjfl<>:temp2 ORDER BY sjbh;/**/

	EXEC SQL OPEN cur_convert;

	for( ;rec_count>0;rec_count-- )

	{

		EXEC SQL WHENEVER SQLERROR DO sqlerror();

		EXEC SQL FETCH cur_convert INTO :jsxh,:sjfl,:sjbh;

		if( ERROR!=0 )

		{

			ERROR=0;

			continue;

		}

		flag=0;

		switch(sjfl)

		{

			case SJFL_ZDYS:	flag=CallConvertZDYS(jsxh,sjbh);

					break;

			case SJFL_PDYS:	flag=CallConvertPDYS(jsxh,sjbh);

					break;

			case SJFL_BKML:	flag=CallConvertBKML(jsxh,sjbh);

					break;

			case SJFL_ZFJ:	flag=CallConvertZFJ(jsxh,sjbh);

					break;

			case SJFL_GH:	flag=CallConvertGH(jsxh,sjbh);

					break;

			case SJFL_YXSJ:	flag=CallConvertYX(jsxh,sjbh);

					break;

			default:	ProcessError(LOG_ERROR,"PCS_Convert_File: error in pcsconvertfile sjfl is incorrect",END);

					flag=CONTNOTBREAK;

		}

		if(flag==CONTNOTBREAK)

			continue;

		if( flag!=0 )

		{

			sprintf(produce_err_str,"%10d,sjfl is %c,sjbh is %2s",jsxh,sjfl,sjbh);
			ProcessError(LOG_ERROR,"PCS_Convert_File: Error when call CallConvert jsxh is: ",produce_err_str);

			EXEC SQL ROLLBACK WORK;
			continue;

		}

		EXEC SQL COMMIT WORK;

	}

	

	EXEC SQL CLOSE cur_convert;


	PutBag();

End:
#ifdef DEBUG
		exit(0);
#endif


	sleep(iTInterval);

	goto begin;

}

⌨️ 快捷键说明

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