📄 hand_large.ec
字号:
/* large_open */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void addspacef();void mess();char y_n();char readdv();char readst();char readch();long ac_num();double get_rate();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();void prtf_upper();short num_time();#include </u/ebcsav/include/begin>short i,n=1,flag,ti,year1,month1,n1,n3,n6,n9,n12;double x,sum1,sum3,sum6,sum9,sum12;long k;unsigned char c;char st[30];FILE *pf;$ char s_num[2],nam[9],ter[2],cu_type[2],addres[25],statu[2], s_type[2],ope_num[2];$ long a_num,pas,cr_num,ope_date,int_date,las_date;$ double amoun,interes,maint_v;$ short cred_type;$ long cred_num,b_num;move(0,29);$ database saving;printw("大 额 储 蓄 移 植");s_num[0]=op.num&0x7f;s_num[1]='\0';nam[0]='\0';s_type[1]='\0';cu_type[0]='R';cu_type[1]='\0';amoun=0.0;addres[0]='\0';statu[0]='A';statu[1]='\0';pas=0;maint_v=0.0;ter[1]='\0';n1=n3=n6=n9=n12=0;sum1=sum3=sum6=sum9=sum12=0.0;$ declare blot1 scroll cursor for select blot_num from r_blot;pf=fopen("/u/ebcsav/tmp/large.txt","r");while(1) { move(2,0); clrtobot(); block(1,0,22,80); move(23,16); standout(); mess((short)1); standend(); fscanf(pf,"%ld %c %ld %hd %lf %s %ld %ld %s",&a_num,&c,&ope_date, &i,&amoun,nam,&pas,&cr_num,addres); if(feof(pf)) break; statu[0]=c; ter[0]=i; statu[0]=c; las_date=int_date=ope_date; move(3,10); addstr("帐 号: "); move(3,48); prt_inum((long)s_num[0],2); addstr("-"); prt_inum(a_num,9); move(4,10); addstr("姓 名: "); move(4,48); printw("%-8s",nam); move(5,10); addstr("密 码: "); move(5,48); printw("%d",pas); move(6,10); addstr("币 种: "); move(6,48); addstr("人民币"); move(7,10); addstr("期 限: "); move(7,48); printw("%d个月",ter[0]); move(8,10); addstr("金 额: "); move(8,48); prt_dnum(amoun,16); move(9,10); addstr("地 址: "); move(9,48); printw("%-24s",addres); move(10,10); addstr("凭 证 号: "); move(10,48); prt_inum(cr_num,7); move(11,10); addstr("起息日期: "); move(11,48); printw("%4d年%2d月%2d日",las_date/10000,las_date%10000/100,las_date%100); move(12,10); addstr("利 率: "); k=ter[0]; k+=((toupper(cu_type[0])-64)*10000+600); interes=get_rate(k,int_date); move(12,48); printw("%3.4f",interes); refresh(); ope_num[0]=op_num; ope_num[1]='\0'; cred_type=6; s_type[0]=cred_type; cred_num=cr_num; flag=0; $ begin work; move(20,20); $ insert into l_fix values ($s_num,$a_num,$nam,$pas,$cu_type,$ter,$amoun, $addres,$cr_num,$ope_date,$int_date,$statu, $las_date,$interes,$maint_v); if(sqlca.sqlcode!=0) { addstr("写"); mess((short)14); printw("(%d), ",sqlca.sqlcode); getch(); } else flag=1; if(flag==1) { $ commit work; switch(ter[0]) { case 1: n1++; sum1+=amoun; break; case 3: n3++; sum3+=amoun; break; case 6: n6++; sum6+=amoun; break; case 9: n9++; sum9+=amoun; break; case 12: n12++; sum12+=amoun; } } else { $ rollback work; } }fclose(pf);$ close database;move(10,10);printw("一个月期 %d 户, 合计 %f 元",n1,sum1);move(11,10);printw("三个月期 %d 户, 合计 %f 元",n3,sum3);move(12,10);printw("六个月期 %d 户, 合计 %f 元",n6,sum6);move(13,10);printw("九个月期 %d 户, 合计 %f 元",n9,sum9);move(14,10);printw("一年期 %d 户, 合计 %f 元",n12,sum12);move(15,10);printw("按回车键返回.");getch();endwin();#include </u/ebcsav/include/end>#include </u/ebcsav/include/mess>double get_rate(k,dat)long k,dat;{$double rat;$long k1,dat1;double ll2;int dat2;long tz[16]={15,30,60,90,120,150,180,210,240,270,300,330,360,720,1080,0};short year,month,day;long i,yy,mm,mm1,dd,t1,ts,m1,m2,m3,yer,da2;num_date(&year,&month,&day);yy=dat/10000;mm=(dat%10000)/100;dd=dat%100;t1=k/100;if(day>=dd)ts=(year-yy)*360+(month-mm)*30+day-dd;else { if(month==1){yer=year-1; mm1=12; } else{ mm1=month-1; yer=year; } m1=yer%400; m2=yer%100; m3=yer%4; if(mm1==1||mm1==3||mm1==5||mm1==7||mm1==8||mm1==10||mm1==12) da2=31; else if(mm1!=2) da2=30; else if(m1==0||m2!=0&&m3==0) da2=29; else da2=28; ts=(yer-yy)*360+(mm1-mm)*30+da2+day-dd; }if(t1==1807){ if(ts<15)k=180200; else { i=0; do{ i++; }while(ts>=tz[i]&&i<15); k=t1*100+i; } }k1=k;$ declare read3 scroll cursor for select ll,rq into $rat,$dat1 from inter_rate where syh=$k1; if(sqlca.sqlcode!=0) { move(21,20); addstr("申请"); mess((short)9); printw("(%d), ",sqlca.sqlcode); mess((short)3); getch(); return; } $ open read3; if(sqlca.sqlcode !=0) { printw("** %d 错误 1: 打开利率表出错 **",sqlca.sqlcode); getch(); return; }$fetch first read3;dat2=0;do{ if(dat1<=dat&&dat1>=dat2) { dat2=dat1; ll2=rat; } $fetch next read3; }while(sqlca.sqlcode!=SQLNOTFOUND);$close read3;return(ll2);}#include </u/ebcsav/include/addspace>#include </u/ebcsav/include/addspacef>#include </u/ebcsav/include/y_n>#include </u/ebcsav/include/prt_inum>#include </u/ebcsav/include/prt_dnum>#include </u/ebcsav/include/prtf_inum>#include </u/ebcsav/include/prtf_dnum>#include </u/ebcsav/include/prtf_upper>#include </u/ebcsav/include/num_time>#include </u/ebcsav/include/readch>#include </u/ebcsav/include/readdv>#include </u/ebcsav/include/readst>#include </u/ebcsav/include/ac_num>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -