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

📄 formphszj.pas

📁 小灵通机卡分离模块的设计.建立在数据库服务器
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    LwlphsZj.Append;
    LwlphsZj.Fields[0].Value := 'A1';
    LwlphsZj.Fields[1].Value := InttoStr(i);
    LwlphsZj.Fields[2].Value := '1';
    if (i<>16) and (i<>9) then
       LwlphsZj.Fields[3].Value := trim(phoneinfo.LwlPhoneInfo.Fields[i].AsString);
    if i=9 then
       Lwlphszj.Fields[3].AsString:='0';
    if i=16 then
       //
     if ProdInfo.LwlProdInfo.FieldByName('prod_prop').AsString = 'B1' then
     begin
         LwlphsZj.Fields[3].Value := trim(framephsinfo.Lwlphs.fieldbyname('ps_code').asstring);

     end
     else if  ProdInfo.LwlProdInfo.FieldByName('prod_prop').AsString = 'B3' then
     begin
      LwlphsZj.Fields[3].Value := trim(phssiminfo1.LwlPhsSim.fieldbyname('card_psnm').asstring);
     end;
      //

    LwlphsZj.Post;
    end;

//(modify by terry 2002.8.7)
{//如果选择程控功能,则写入程控功能信息
  if ProgFunc.CbProgFunc.Items.Text <> '' then
    for i := 0 to (iFuncNum-1) do
      begin
      for j := 0 to 7 do
        begin
        LwlphsZj.Append;
        LwlphsZj.Fields[0].Value := 'A2';
        LwlphsZj.Fields[1].Value := InttoStr(j);
        LwlphsZj.Fields[2].Value := InttoStr(i+1);
        LwlphsZj.Fields[3].Value := pdnfuncnew[i,j];
        LwlphsZj.Post;
        end;
      end;}
//如果选择了增值产品,则写入增值产品信息表和属性表
  if (ProgFunc.CbProgFunc.Items.Text <> '') or (ProgFunc.LwlIncrProd.RecordCount > 0) then
  begin
    ProgFunc.LwlIncrProd.First;
    for i := 0 to (ProgFunc.LwlIncrProd.RecordCount-1) do
    begin
      for j := 0 to (ProgFunc.LwlIncrProdOld.FieldCount-1) do
      begin
        LwlphsZj.Append;
        LwlphsZj.Fields[0].Value := 'G0';
        LwlphsZj.Fields[1].Value := InttoStr(j);
        LwlphsZj.Fields[2].Value := InttoStr(i+1);
        LwlphsZj.Fields[3].Value := ProgFunc.LwlIncrProd.Fields[j].AsString;
        LwlphsZj.Post;
      end;
      ProgFunc.LwlIncrProd.Next;
    end;

    ProgFunc.LwlIncrProdProp.First;
    for i := 0 to (ProgFunc.LwlIncrProdProp.RecordCount-1) do
    begin
      for j := 0 to (ProgFunc.LwlIncrProdPropOld.FieldCount-1) do
      begin
        LwlphsZj.Append;
        LwlphsZj.Fields[0].Value := 'G1';
        LwlphsZj.Fields[1].Value := InttoStr(j);
        LwlphsZj.Fields[2].Value := InttoStr(i+1);
        LwlphsZj.Fields[3].Value := ProgFunc.LwlIncrProdProp.Fields[j].AsString;
        LwlphsZj.Post;
      end;
      ProgFunc.LwlIncrProdProp.Next;
    end;
  end;

  //将预付费信息的数据插入当地的数据集中 (modify on 2003.10.08)
  //只能有一种预付费方式存在
  if (ls_prodprepay = 1) and (ls_accprepay = 0) then
  begin
    for i := 0 to (ProgFunc.LwlPrepayOld.FieldCount -1) do
    begin
      LwlphsZj.Append;
      LwlphsZj.Fields[0].Value := 'H3';
      LwlphsZj.Fields[1].Value := InttoStr(i);
      LwlphsZj.Fields[2].Value := '1';
      LwlphsZj.Fields[3].Value := ProgFunc.LwlPrepay.Fields[i].AsString;
      LwlphsZj.Post;
    end;
  end
  else if (ls_accprepay = 1) and (ls_prodprepay = 0) then
  begin
    for i := 0 to (AccountInfo.LwlPrepayOld.FieldCount -1) do
    begin
      LwlphsZj.Append;
      LwlphsZj.Fields[0].Value := 'H3';
      LwlphsZj.Fields[1].Value := InttoStr(i);
      LwlphsZj.Fields[2].Value := '2';
      LwlphsZj.Fields[3].Value := AccountInfo.LwlPrepay.Fields[i].AsString;
      LwlphsZj.Post;
    end;
  end;

//如果选择了设备,则写入设备信息
  if ProgFunc.CbDevice.Items.Text <> '' then
  begin
    ProgFunc.LwlDevice.First;
    for i := 0 to (ProgFunc.LwlDevice.RecordCount-1) do
    begin
      for j := 0 to (ProgFunc.LwlDevice.FieldCount-1) do
      begin
        LwlphsZj.Append;
        LwlphsZj.Fields[0].Value := 'A5';
        LwlphsZj.Fields[1].Value := InttoStr(j);
        LwlphsZj.Fields[2].Value := InttoStr(i+1);
        LwlphsZj.Fields[3].Value := trim(ProgFunc.LwlDevice.Fields[j].AsString);
        LwlphsZj.Post;
      end;
      ProgFunc.LwlDevice.Next;
    end;
  end;

//如果需要担保人,则写入担保信息
  if CbxVouch.Checked = true then
    begin
    for i := 0 to (FrmYhDb.LwlVouchInfoOld.FieldCount-1) do
      begin
      LwlphsZj.Append;
      LwlphsZj.Fields[0].Value := 'A6';
      LwlphsZj.Fields[1].Value := InttoStr(i);
      LwlphsZj.Fields[2].Value := '1';
      LwlphsZj.Fields[3].Value := trim(FrmYhDb.LwlVouchInfo.Fields[i].AsString);
      LwlphsZj.Post;
      end;
    end;
    //--------------------add by yqd 2 about 机卡分离 start -----------------
//把PHS产品信息写入数据集

  if self.iproducttype = '1' then
  begin
        for i:=0 to (Framephsinfo.Lwlphsold.FieldCount-1) do
        begin
                LwlphsZj.Append;
                LwlphsZj.Fields[0].Value := 'D6';
                LwlphsZj.Fields[1].Value := InttoStr(i);
                LwlphsZj.Fields[2].Value := '1';
                LwlphsZj.Fields[3].Value := trim(Framephsinfo.Lwlphs.Fields[i].AsString);
                LwlphsZj.Post;
        end;
  end
  else if self.iproducttype = '0' then
  begin
        for i:=0 to (self.PhsSimInfo1.LwlPhsSimOld.FieldCount-1) do
        begin
                LwlphsZj.Append;
                LwlphsZj.Fields[0].Value := 'J2';
                LwlphsZj.Fields[1].Value := InttoStr(i);
                LwlphsZj.Fields[2].Value := '1';
                LwlphsZj.Fields[3].Value := trim(PhsSimInfo1.LwlPhsSim.Fields[i].AsString);
                LwlphsZj.Post;
        end;

  end;
 //-------------------add by yqd 2 end about 机卡分离-------------
  if ForegiftInfo.lwlForegift.RecordCount > 1 then
  begin
    ForegiftInfo.lwlForegift.First;
  end;
  for i := 1 to ForegiftInfo.lwlForegift.RecordCount do
  begin
    for j := 0 to (ForegiftInfo.lwlForegiftOld.FieldCount-1) do
    begin
      LwlphsZj.Append;
      LwlphsZj.Fields[0].Value := 'H6';
      LwlphsZj.Fields[1].Value := InttoStr(j);
      LwlphsZj.Fields[2].Value := InttoStr(i);
      LwlphsZj.Fields[3].Value := ForegiftInfo.lwlForegift.Fields[j].AsString;
      LwlphsZj.Post;
    end;
    ForegiftInfo.lwlForegift.Next;
  end;

  //----add by qyd about 机卡分离--激活 at 20050525 start
  //将营销信息的数据插入当地的数据集中
  if FrmYyslzx.Getywm ='I7' then
  begin
         for i:=1 to LwlPorderdis.RecordCount do
         begin
           for j := 0 to (LwlPorderdis.FieldCount-1) do
             begin
              LwlphsZj.Append;
               LwlphsZj.Fields[0].Value := 'V5';
                LwlphsZj.Fields[1].Value := InttoStr(j);
              LwlphsZj.Fields[2].Value := InttoStr(i);
                LwlphsZj.Fields[3].Value :=LwlPorderdis.Fields[j].AsString;
           end;
         end;
   end;      
  //----add by qyd about 机卡分离--激活 at 20050525 start


  LwlphsZj.Apply;
  if (LwlphsZj.RValue = -1) or (LwlphsZj.RValue <> 0) then
  begin
     ShowError('错误提示',LwlphsZj.Infomation);
  end;

  if LwlphsZj.RValue = 0 then
  begin
    MessageDlg('业务受理成功!',mtInformation,[mbOk],0);
    //设置给客户服务中心的返回值
    FrmYyslzx.setscbh(LwlphsZj.Param.ParamByName('retparam1').AsInteger);    //生产编号
    FrmYyslzx.setscls(LwlphsZj.Param.ParamByName('retparam2').AsInteger);    //生产流水
    FrmYyslzx.setslbh(LwlphsZj.Param.ParamByName('retparam3').asString);     //受理编号
    //showmessage('订单编号:'+LwlphsZj.Param.ParamByName('retparam4').asString);
    FrmYyslzx.setddbh(LwlphsZj.Param.ParamByName('retparam4').asString);     //订单编号
    FrmYyslzx.Setcpbh(LwlphsZj.Param.ParamByName('retparam6').asString);     //产品编号
    FrmYyslzx.setkhmc(FrmYhxx.DbeUserNam.Field.Text);     //客户名称
    FrmYyslzx.setcphm(PhoneInfo.DbePhoneNo.Field.Text);     //产品号码
    FrmYyslzx.setsldlx(Currsldlx);       //受理单类型
    FrmYyslzx.Dispcurrrecord;       //调用控制中心的函数,显示工单

    //设置客户信息修改标志,必需放在回添编号前(modify on 2002.12.15)
    FrmYyslzx.Setcustmodflag(FrmYhxx.iCustFlag);

  //(modify by terry 2002.9.16)
    //回添各个编号
    FrmYhxx.LwlUserInfo.FieldByName('cust_id').AsString := LwlphsZj.Param.ParamByName('retparam7').asString; //客户编号
    FrmYhxx.LwlUserInfo.FieldByName('cust_code').AsString := LwlphsZj.Param.ParamByName('retparam8').asString;//客户标识
    FrmYhxx.LwlUserInfo.Edit;
    FrmYhxx.LwlUserInfo.Post;
    //使用者的编号
    if CbxDifference.Checked = true then
    begin
      FrmKhxx.LwlUserInfo.FieldByName('cust_id').AsString := LwlphsZj.Param.ParamByName('retparam9').asString;
      FrmKhxx.LwlUserInfo.FieldByName('cust_code').AsString := LwlphsZj.Param.ParamByName('retparam10').asString;
      FrmKhxx.LwlUserInfo.Edit;
      FrmKhxx.LwlUserInfo.Post;
    end;
    ProdInfo.LwlProdInfo.FieldByName('product_id').AsString := LwlphsZj.Param.ParamByName('retparam6').asString;//产品编号
    ProdInfo.LwlProdInfo.Edit;
    ProdInfo.LwlProdInfo.Post;
    LwlphsZj.First;
    while not LwlphsZj.Eof do
    begin
    //帐目信息
      AccountInfo.LwlAccount.First;
      while not AccountInfo.LwlAccount.Eof do
      begin
        if AccountInfo.LwlAccount.FieldByName('contract_id').AsString = LwlphsZj.Fields[0].AsString then
        begin
          AccountInfo.LwlAccount.FieldByName('contract_id').AsString := LwlphsZj.Fields[2].AsString;
        end;
        AccountInfo.LwlAccount.Edit;
        AccountInfo.LwlAccount.Post;
        AccountInfo.LwlAccount.Next;
      end;
    //帐务信息
      AccountInfo.LwlAccoInfo.Locate('contract_id',LwlphsZj.Fields[0].AsString,[loCaseInsensitive]);
      AccountInfo.LwlAccoInfo.FieldByName('pay_id').AsString := LwlphsZj.Fields[1].AsString;
      AccountInfo.LwlAccoInfo.FieldByName('contract_id').AsString := LwlphsZj.Fields[2].AsString;
      AccountInfo.LwlAccoInfo.FieldByName('cust_id').AsString := LwlphsZj.Param.ParamByName('retparam7').asString;
      AccountInfo.LwlAccoInfo.Edit;
      AccountInfo.LwlAccoInfo.Post;
      LwlphsZj.Next;
    end;

    FrmYyslzx.SetUserinfo(FrmYhxx.LwlUserInfo);       //传递客户信息给受理中心
    FrmYyslzx.SetAccoInfo(AccountInfo.LwlAccoInfo);   //传递帐务信息给受理中心
    FrmYyslzx.SetProdInfo(ProdInfo.LwlProdInfo);      //传递地址信息给受理中心

{  //传入打印信息
    DM_yyslzx.Lwlcplb.Locate('scode',FrmYyslzx.Getcplb(),[loCaseInsensitive]);
    FrmYyslzx.ClearPrintinfo(LwlphsZj.Param.ParamByName('retparam3').asString);  //清除编号原有信息
    //客户和营业受理辅助信息
    FrmYhxx.UserSetData(LwlphsZj.Param.ParamByName('retparam3').asString,trim(DM_yyslzx.Lwlcplb.FieldByName('sname').AsString) + '装机','',1);
    //帐务信息
    AccountInfo.AccountSetData(LwlphsZj.Param.ParamByName('retparam3').asString,1);
    //产品信息
    ProdInfo.ProdSetData(LwlphsZj.Param.ParamByName('retparam3').asString,1);
    //增值产品和设备
    ProgFunc.FuncSetData(LwlphsZj.Param.ParamByName('retparam3').asString,1);}
//审核单打印(2003.02.26)
    ls_scbh := LwlphsZj.Param.ParamByName('retparam1').AsString;    //生产编号
    ls_scls := LwlphsZj.Param.ParamByName('retparam2').AsString;    //生产流水
    ls_slbh := LwlphsZj.Param.ParamByName('retparam3').AsString;    //受理编号
    SetPrint(FrmYhxx.LwlUserInfo,ls_scbh,'E7','1','owner',FrmYhxx.LwlUserInfoOld.FieldCount);
    SetPrint(AccountInfo.LwlAccount,ls_scbh,'A3','1','',AccountInfo.LwlAccountOld.FieldCount);
    SetPrint(AccountInfo.LwlAccoInfo,ls_scbh,'A4','1','',AccountInfo.LwlAccoInfoOld.FieldCount);
    SetPrint(ProdInfo.LwlProdInfo,ls_scbh,'A0','1','',ProdInfo.LwlProdInfoOld.FieldCount);
    SetPrint(PhoneInfo.LwlPhoneInfo,ls_scbh,'A1','1','main',PhoneInfo.LwlPhoneInfoOld.FieldCount);
    SetPrint(ProgFunc.LwlIncrProd,ls_scbh,'G0','1','',ProgFunc.LwlIncrProdOld.FieldCount);
    SetPrint(ProgFunc.LwlIncrProdProp,ls_scbh,'G1','1','',ProgFunc.LwlIncrProdPropOld.FieldCount);
    SetPrint(ProgFunc.LwlDevice,ls_scbh,'A5','1','',ProgFunc.LwlDeviceOld.FieldCount);
//--------------------add by yqd 3 about 机卡分离 start----------------
    if  self.iproducttype = '1' then//合一机
            SetPrint(Framephsinfo.Lwlphs,ls_scbh,'D6','1','',Framephsinfo.Lwlphsold.FieldCount)
    else if  iproducttype = '0' then //分离机
    begin
            SetPrint(self.PhsSimInfo1.LwlPhsSim,ls_scbh,'J2','1','',SELF.PhsSimInfo1.LwlPhsSimOld.FieldCount);

    end;

//--------------------add by yqd 3 about 机卡分离 end----------------

    if ForegiftInfo.lwlForegift.RecordCount>0 then
    begin
      SetPrint(ForegiftInfo.lwlForegift,ls_scbh,'H6','1','',ForegiftInfo.lwlForegiftOld.FieldCount);
    end;
    if CbxDifference.Checked = true then
    begin
      SetPrint(FrmKhxx.LwlUserInfo,ls_scbh,'E7','1','user',FrmKhxx.LwlUserInfoOld.FieldCount);
    end;
    if CbxVouch.Checked = true then
    begin
      SetPrint(FrmYhDb.LwlVouchInfo,ls_scbh,'A6','1','',FrmYhDb.LwlVouchInfoOld.FieldCount);
    end;
    ls_ywm := '00'; //业务码
    ls_cplb := FrmYyslzx.Getcplb();
    SetAssistantData(ls_scbh,ls_scls,ls_slbh,ls_ywm,ls_cplb);
    AnalyseData(ls_msgout);
    LwlphsZj.Close;


//=================================================================
//批量装机处理  薛盈2003.9.28
//=================================================================

    if CbBatch.Checked = true then
    begin
      //重新初始化参数
      FrmYhxx.UserInit;
      //AccountInfo.AccountInit;
      ProdInfo.ProdInit;
      PhoneInfo.PhoneInit('0');
      ProgFunc.ProgFuncInit;
      /// add by yqd start about 机卡分离
      self.Currddbh:=LwlphsZj.Param.ParamByName('retparam4').asString;
      if self.iproducttype = '1' then    //合一机
      begin
                FramePhsInfo.Init;
                FramePhsInfo.oldpscode := '';
      end

⌨️ 快捷键说明

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