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

📄 inte_f_add.ec

📁 这是一个使用 informix esql/c 技术开发的银行程序的部分代码。
💻 EC
📖 第 1 页 / 共 2 页
字号:
/*   活期支取   */#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();char fv_date();long ac_num();short num_time();double get_inte();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();#include </u/ebcsav/include/begin>double x,amm;short j=0,i,n,ti,p=0;unsigned char c;char st[30],yn;long k;$ char s_num[2],s_num1[2],nam[9],cu_type[2],adde[25];$ long pas,pas1,a_num,a_num1,cr_num,ope_date,b_num,b_num2;$ double amoun,inte,amou,amo,balan;$ short cred_type;$ long cred_num,i_date,l_date,r_date,open_dat;$ char ope_num[2],s_type[2],sta[2],l_num[2],r_type[2],stat[2],stat1[2]; $ char select_1[100]; int fl;if(month!=12||day!=20){move(10,20);printw("未到计息日期.....");getch();return;}$ database saving;ope_num[0]=op_num;ope_num[1]='\0';s_num[0]=op.num&0x7f;s_num[1]='\0';s_num1[1]='\0';l_num[1]='\0';s_type[0]=12;s_type[1]='\0';r_type[0]=14;r_type[1]='\0';stat1[0]='E';stat[0]='B';sta[1]='\0';stat1[1]='\0';stat[1]='\0';nam[0]='\0';cu_type[0]='R';cu_type[1]='\0';amoun=0.0;amou=0.0;    $ begin work; fl=op.type&0x03; switch(fl)          {          case 2:          case 3:         strcpy(select_1,  " select *  from f_demand where cur_type!= ? and status != ? and status != ?");                break;          case 0:          case 1:               return;               break;          }        $ prepare db from  $select_1;        $ declare dem2 scroll cursor for db;        $ declare blot scroll cursor for select blot_num from f_blot;        move(19,20);    if(sqlca.sqlcode!=0)      {        addstr("申请");        mess((short)9);        printw("a(%d), ",sqlca.sqlcode);        mess((short)3);        getch();        return;      }$open dem2 using $cu_type,$stat1,$stat; if(sqlca.sqlcode !=0)  {    printw("**b %d 错误: 打开活期储蓄帐户表出错 **",sqlca.sqlcode);   getch();   return;   }$fetch first dem2 into $s_num,$a_num,$nam,     $pas1,$cu_type,$amoun,$adde, $cr_num,$open_dat,               $i_date,$sta,$l_date,$inte,$l_num;move(10,20);printw("正在计息请等待...");while(sqlca.sqlcode!=SQLNOTFOUND){j++;move(13,20);printw("第    %d    户",j);refresh();      ope_date=year*10000+month*100+day;      if(ope_date!=i_date)        {           k=0;           k=((toupper(cu_type[0])-64)*10000+12*100);           inte=inte+get_inte(k,i_date,amoun,&amm);           i_date=ope_date;         }       if(toupper(cu_type[0])=='J')           {             inte=(long)inte;           }          else {           inte=(long)inte+(long)((inte-(long)inte)*100+0.5)/100.0;                }      if(inte<0.01)     {       $ fetch dem2 into $s_num,$a_num,$nam,$pas1,$cu_type,          $amoun,$adde,$cr_num,$open_dat,$i_date,$sta,$l_date,$inte,$l_num;      continue;     }      amoun=amoun+inte;        $ update f_demand set amount=$amoun,interest=0.0,                 inte_date=$i_date        where sec_num=$s_num and acc_num=$a_num;                    if(sqlca.sqlerrd[2]!=1)                      {                        addstr("写");                        mess(14);                        p=1;                        break;                       }                  $ insert into f_blot                    values                    (0,$ope_num,$s_num,$a_num,$nam,$s_type,                    $cu_type,0,$cr_num,"I",$inte,$amoun,0.0);                  $ open blot;                  $fetch last blot into $b_num;                  $ close blot;                  $ insert into f_dem_sch                    values                    ($s_num,$a_num,$ope_date,$b_num,                     $nam,$cu_type,$inte,$amoun,0.0,$r_type);$fetch  dem2 into $s_num,$a_num,$nam,     $pas1,$cu_type,$amoun,$adde, $cr_num,$open_dat,               $i_date,$sta,$l_date,$inte,$l_num;}   if(p==1)     {move(10,20);printw("计息异常!!!!!");getch();      $ rollback work;     }   else     {move(10,20);printw("计息完闭.....");getch();      $ commit work;     }$ close database;#include </u/ebcsav/include/end>#include </u/ebcsav/include/mess>#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/readch>#include </u/ebcsav/include/readdv>#include </u/ebcsav/include/readst>#include </u/ebcsav/include/ac_num>#include </u/ebcsav/include/num_time>#include </u/ebcsav/include/fv_date>double get_inte(k,dat,amount,maint)long k,dat;double amount,*maint;{$double rat,dat1,bl;$long k1;$int y,m,sy,sm,sd,wy,wm,wd;char c3;double ll1,ll2,ll3;double lx=0,am,lx1=0,lx2=0,lx3=0,lx4=0;short year,month,day;long tzbz,yy,mm,mm1,dd,zx,t1,t2,t3,t4,dat2,dat3,dat4,ts,ts1,m1,m2,m3,yer,da2;long i,j,lz[3]={360,1080,1800},dq[6]={90,180,360,720,1080,1800},    de[5]={30,90,180,270,360},    tz[16]={15,30,60,90,120,150,180,210,240,270,300,330,360,720,1080,0};num_date(&year,&month,&day);yy=dat/10000;t1=amount;amount=t1;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;   }tzbz=0;if(t1==1807){             if(ts<tz[0])              {               tzbz=1;               k=180200;              }             else              {             i=0;                    do{                      i++;                      }while(ts>=tz[i]&&i<15);                      k=t1*100+i;              }            }t1=k/10000;t2=k%10000;t3=t2/100;t4=t2%100*30;if(t1>32&&t1!=50){        t1-=32;        t3=3;        k-=320000;         }if(t1==50){          t1=18;          t3=8;        k-=320000;          }k1=k;$ declare read1 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 read1; if(sqlca.sqlcode !=0)  {    printw("** %d 错误 1: 打开利率表出错 **",sqlca.sqlcode);   getch();   return;   }$fetch first read1;dat2=0;dat3=0;do{   if(dat1>=dat2)

⌨️ 快捷键说明

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