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

📄 formphschange.pas

📁 小灵通机卡分离模块的设计.建立在数据库服务器
💻 PAS
📖 第 1 页 / 共 3 页
字号:
      ls_flag:='1';
    end;
  if ls_flag='1' then
    begin
      ls_custid:=trim(NewUserInfo.LwlUserInfo.FieldByName('cust_id').AsString);
      AppendValue(lwlPhsSim,'E7','2','cust_id','客户编号','number','M','1',ls_custid,ls_custid);
    end;
  //号码信息变动
  ls_flag:='';
  ls_value:=trim(NewPhoneInfo.LwlPhoneInfo.FieldByName('product_no').AsString);
  ls_value_o:=trim(NewPhoneInfo.LwlPhoneInfoOld.FieldByName('product_no').AsString);
  if ls_value<>ls_value_o then
    begin
      AppendValue(lwlPhsSim,'A0','6','product_no','产品号码','varchar2','M','1',ls_value,ls_value_o);
      Appendvalue(lwlPhsSim,'A1','4','product_no','产品号码','varchar2','M','1',ls_value,ls_value_o);
      ls_flag:='1';
    end;
  ls_value:=trim(NewPhoneInfo.LwlPhoneInfo.FieldByName('revs_type').AsString);
  ls_value_o:=trim(NewPhoneInfo.LwlPhoneInfoOld.FieldByName('revs_type').AsString);
  if ls_value<>ls_value_o then
    begin
      AppendValue(lwlPhsSim,'A1','15','revs_type','反极类型','char','M','1',ls_value,ls_value_o);
      ls_flag:='1';
    end;
  ls_value:=trim(NewPhoneInfo.LwlPhoneInfo.FieldByName('line_type').AsString);
  ls_value_o:=trim(NewPhoneInfo.LwlPhoneInfoOld.FieldByName('line_type').AsString);
  if ls_value<>ls_value_o then
    begin
      AppendValue(lwlPhsSim,'A1','13','line_type','线路类别','char','M','1',ls_value,ls_value_o);
      ls_flag:='1';
    end;
  ls_value:=trim(NewPhoneInfo.LwlPhoneInfo.FieldByName('secrecy_mode').AsString);
  ls_value_o:=trim(NewPhoneInfo.LwlPhoneInfoOld.FieldByName('secrecy_mode').AsString);
  if ls_value<>ls_value_o then
    begin
      AppendValue(lwlPhsSim,'A1','12','secrecy_mode','保密方式','char','M','1',ls_value,ls_value_o);
      ls_flag:='1';
    end;
  ls_value:=trim(NewPhoneInfo.LwlPhoneInfo.FieldByName('prodno_name').AsString);
  ls_value_o:=trim(NewPhoneInfo.LwlPhoneInfoOld.FieldByName('prodno_name').AsString);
  if ls_value<>ls_value_o then
    begin
      AppendValue(lwlPhsSim,'A1','21','prodno_name','查号名称栏','varchar2','M','1',ls_value,ls_value_o);
      ls_flag:='1';
    end;
  ls_value:=trim(NewPhoneInfo.LwlPhoneInfo.FieldByName('lead_no').AsString);
  ls_value_o:=trim(NewPhoneInfo.LwlPhoneInfoOld.FieldByName('lead_no').AsString);
  if ls_value<>ls_value_o then
    begin
      AppendValue(lwlPhsSim,'A1','10','lead_no','引示号电话号码(中继,centrex)','varchar2','M','1',ls_value,ls_value_o);
      ls_flag:='1';
    end;
  if iprodproptype=0 then
     //改于050512 lin 将"card_iccid" 改为 "card_psnm"
    ls_value:=trim(NewPhsSiminfo.LwlPhsSim.FieldByName('card_psnm').AsString)
  else if iprodproptype=1 then
    ls_value:=trim(NewFramephsinfo.Lwlphs.FieldByName('ps_code').AsString)
  else
    ls_value:='';
  ls_value_o:=trim(trim(NewPhoneInfo.LwlPhoneInfoOld.FieldByName('fac_code').AsString));
  if ls_value<>ls_value_o then
    begin
      AppendValue(lwlPhsSim,'A1','16','fac_code','设备号','varchar2','M','1',ls_value,ls_value_o);
      ls_flag:='1';
    end;
   if ls_flag='1' then
     begin
       ls_custid:=trim(NewPhoneInfo.LwlPhoneInfo.FieldByName('phone_id').AsString);
       AppendValue(lwlPhsSim,'A1','2','phone_id','电话编号','number','M','1',ls_custid,ls_custid);
     end;
  //产品性质变动信息
  ls_flag:='';
  ls_value:=trim(NewProdInfo.LwlProdInfo.FieldByName('prod_prop').AsString);
  ls_value_o:=trim(NewProdInfo.LwlProdInfoOld.FieldByName('prod_prop').AsString);
  if ls_value<>ls_value_o then
    begin
      AppendValue(lwlPhsSim,'A0','10','prod_prop','产品性质','char','M','1',ls_value,ls_value_o);
      ls_flag:='1';
    end;

  //合一分离信息变更
  if iprodproptype=0 then
    begin
      ls_flag:='';
      //改于050512 lin 将"card_iccid" 改为 "card_psnm"
      ls_value:=trim(NewPhsSiminfo.LwlPhsSim.FieldByName('card_iccid').AsString);
      ls_psnm:=trim(NewPhsSiminfo.LwlPhsSim.FieldByName('card_psnm').AsString);
      ls_value_o:=NewPhsSiminfo.iOldSim;
//      ls_value_o:=trim(NewPhsSimInfo.LwlPhsSimOld.fieldByName('card_psnm').AsString);
      if ls_value<>ls_value_o then
        begin
          AppendValue(lwlPhsSim,'J2','5','card_psnm','PS号码','varchar2','A','1',ls_psnm,ls_psnm_o);
          AppendValue(lwlPhsSim,'J2','4','card_iccid','Sim卡号','varchar2','A','1',ls_value,ls_value_o);
        end;
      ls_value:=trim(NewPhsSiminfo.LwlPhsSim.FieldByName('card_type').AsString);
      ls_value_o:=trim(NewPhsSimInfo.LwlPhsSimOld.fieldByName('card_type').AsString);
      if ls_value<>ls_value_o then
        begin
          AppendValue(lwlPhsSim,'J2','6','card_type','卡类型','char','A','1',ls_value,ls_value_o);
        end;
      ls_value:=trim(NewPhsSiminfo.LwlPhsSim.FieldByName('prodsec_no').AsString);
      ls_value_o:=trim(NewPhsSimInfo.LwlPhsSimOld.fieldByName('prodsec_no').AsString);
      if ls_value<>ls_value_o then
        begin
          AppendValue(lwlPhsSim,'J2','3','prodsec_no','外地号码','varchar2','A','1',ls_value,ls_value_o);
        end;
    end
  else
    begin
      ls_flag:='';
      ls_value:=trim(NewFramephsinfo.Lwlphs.FieldByName('ps_code').AsString);
      ls_value_o:=NewFramephsinfo.oldpscode;
//      ls_value:=trim(NewFramephsinfo.Lwlphsold.FieldByName('ps_code').AsString);
      if ls_value<>ls_value_o then
        begin
          AppendValue(lwlPhsSim,'D6','3','ps_code','PS编码','varchar2','A','1',ls_value,ls_value_o);
        end;
    end;

  if (FrmYyslzx.Getscbh()<>-1)then
    iscbh:=inttostr(FrmYyslzx.Getscbh())
  else
     iscbh:=trim(NewProdInfo.LwlProdInfo.fieldbyname('produce_id').AsString);

{  //调用生成记录的中间件服务
  LwlPhsSim.Open;
  LwlphsSim.Clear;
  LwlphsSim.Param.Clear;
  LwlphsSim.CicsRegion:=vg_CicsRegion;
  LwlphsSim.CicsProgram:='DPHSSIMC';  }
  SetLinkParmIn(LwlphsSim,'param1',iscbh);
  SetLinkParmIn(LwlPhsSim,'param2',iscls);
  SetLinkParmIn(LwlPhsSim,'param3',lddbh);
  SetLinkParmIn(LwlPhsSim,'param4',lslbh);
  SetLinkParmIn(LwlPhsSim,'param5',icpbh);
  if iprodproptype=0 then
    begin
      SetLinkParmIn(LwlPhsSim,'param6','I5');
      SetLinkParmIn(LwlPhsSim,'param7','I5');
    end
  else if iprodproptype=1 then
    begin
      SetLinkParmIn(LwlPhsSim,'param6','I6');
      SetLinkParmIn(LwlPhsSim,'param7','I6');
    end;
  SetLinkParmIn(LwlPhsSim,'param8','00');
  SetLinkParmIn(LwlPhsSim,'param9','0');
  SetLinkParmIn(LwlPhsSim,'param10',ls_SrvType);
  SetLinkParmIn(LwlPhsSim,'param11',vg_lan_code);
  SetLinkParmIn(LwlPhsSim,'param12',vg_lan_code);
  SetLinkParmIn(LwlPhsSim,'param13',lsldj);
  SetLinkParmIn(LwlPhsSim,'param14',vg_accept_mode);
  SetLinkParmIn(LwlPhsSim,'param15',vg_order_tache);
  SetLinkParmIn(LwlPhsSim,'param16',vg_unit_type);
  SetLinkParmIn(LwlPhsSim,'param17',vg_unit_code);
  SetLinkParmIn(LwlPhsSim,'param18',vg_exch_code);
  SetLinkParmIn(LwlPhsSim,'param19',vg_depart_code);
  SetLinkParmIn(LwlPhsSim,'param20',vg_depart_type);
  SetLinkParmIn(LwlPhsSim,'param21',vg_oper_code);
  SetLinkParmIn(LwlPhsSim,'param22',vg_ipaddr);
  SetLinkParmIn(LwlPhsSim,'param23',vg_term_code);
  SetLinkParmIn(LwlPhsSim,'param24',iSubNumStr);
  SetLinkParmIn(LwlPhsSim,'param25',lowncustid);
  SetLinkParmIn(LwlPhsSim,'param26',lusercustid);
  //-----经办人信息---
  SetLinkParmIn(LwlPhsSim,'param27',NewUserInfo.ApplyInfo1.LwlApplyInfo.FieldByName('apply_name').AsString);
  SetLinkParmIn(LwlPhsSim,'param28',NewUserInfo.ApplyInfo1.LwlApplyInfo.FieldByName('apply_cert').AsString);
  SetLinkParmIn(LwlPhsSim,'param29',NewUserInfo.ApplyInfo1.LwlApplyInfo.FieldByName('apply_certno').AsString);
  SetLinkParmIn(LwlPhsSim,'param30',NewUserInfo.ApplyInfo1.LwlApplyInfo.FieldByName('apply_tel').AsString);
  SetLinkParmIn(LwlPhsSim,'param31',NewUserInfo.ApplyInfo1.LwlApplyInfo.FieldByName('apply_addr').AsString);
  //释放的ps和sim码
  SetLinkParmIn(LwlPhsSim,'param32',NewFramephsinfo.oldpscode);
  SetLinkParmIn(LwlPhsSim,'param33',NewPhsSimInfo.iOldSim);

  //定义输出参数
  SetLinkParmOut(LwlPhsSim,'retparam1');
  SetLinkParmOut(LwlPhsSim,'retparam2');
  SetLinkParmOut(LwlPhsSim,'retparam3');
  SetLinkParmOut(LwlPhsSim,'retparam4');

  LwlPhsSim.Apply;
  if LwlPhsSim.RValue = -1 then
    begin
      ShowError('错误提示',LwlPhsSim.Infomation);
      exit;
    end;
  if LwlPhsSim.RValue > 100 then
  begin
     ShowError('调用中间件出错',LwlPhsSim.Infomation);
     exit;
  end;
  if LwlphsSim.RValue = 0 then
    begin
      MessageDlg('业务受理成功!',mtInformation,[mbOk],0);
      //设置给客户服务中心的返回值
      ls_scbh:=trim(lwlPhsSim.Param.ParamByName('retparam1').AsString);    //生产编号
      ls_scls:=trim(lwlPhsSim.Param.ParamByName('retparam2').AsString);    //生产流水
      ls_slbh:=trim(lwlPhsSim.Param.ParamByName('retparam3').AsString);    //受理编号
      FrmYyslzx.setscbh(strtoint(ls_scbh));   //生产编号
      FrmYyslzx.setscls(strtoint(ls_scls));   //生产流水
      FrmYyslzx.setslbh(ls_slbh);   //受理编号
      FrmYyslzx.setddbh(lwlPhsSim.Param.ParamByName('retparam4').AsString);   //订单编号
      FrmYyslzx.setkhmc(NewUserInfo.DbeUserNam.Field.Text);    //客户名称
      FrmYyslzx.setcphm(NewPhoneInfo.DbePhoneNo.Field.Text);   //产品号码
      FrmYyslzx.setsldlx(ls_AcceptState);       //受理单类型
      FrmYyslzx.Dispcurrrecord;       //调用控制中心的函数,显示工单
      FrmYyslzx.SetUserinfo(NewUserInfo.LwlUserInfo);       //传递客户信息给受理中心

      //审核单打印
      SetPrint(NewUserInfo.LwlUserInfo,ls_scbh,'E7','1','owner',NewUserInfo.LwlUserInfoOld.FieldCount);
      SetPrint(NewUserInfo.LwlUserInfoOld,ls_scbh,'E7','0','owner',NewUserInfo.LwlUserInfoOld.FieldCount);
      SetPrint(NewProdInfo.LwlProdInfo,ls_scbh,'A0','1','',NewProdInfo.LwlProdInfoOld.FieldCount);
      SetPrint(NewPhoneInfo.LwlPhoneInfo,ls_scbh,'A1','1','main',NewPhoneInfo.LwlPhoneInfoOld.FieldCount);
      Setprint(NewPhoneInfo.LwlPhoneInfoOld,ls_scbh,'A1','0','',NewPhoneInfo.LwlPhoneInfoOld.FieldCount);
      if iprodproptype=0 then
        SetPrint(NewPhsSimInfo.LwlPhsSim,ls_scbh,'J2','1','',NewPhsSimInfo.LwlPhsSimOld.FieldCount)
      else
        SetPrint(NewFramephsinfo.Lwlphs,ls_scbh,'D6','1','',NewFramephsinfo.Lwlphsold.FieldCount);
      if iprodproptype=0 then
        ls_ywm:='I5'
      else if iprodproptype=1 then
        ls_ywm:='I6';
      ls_cplb := FrmYyslzx.GetNewcplb();
      SetAssistantData(ls_scbh,ls_scls,ls_slbh,ls_ywm,ls_cplb);
      AnalyseData(ls_msgout);

      LwlphsSim.Close;
      Frmphschange.Close;
    end;
end;

procedure TFrmphschange.NewPhoneInfoBtnNumSelClick(Sender: TObject);
begin
  inherited;

  if NewProdInfo.DblcAddrNo.KeyValue = null then
  begin
    MessageDlg('客户地址错误或模糊,重新确定局向!',mtInformation,[mbok],0);
    exit;
  end;
  NewPhoneInfo.iSwithId := NewPhoneInfo.LwlPhoneInfo.FieldByName('switch_id').AsString; //交换机
  NewPhoneInfo.iExchCode := NewProdInfo.LwlProdInfo.FieldByName('exch_code').AsString;  //地址局向
  NewPhoneInfo.iProtCode := NewProdInfo.LwlProdInfo.FieldByName('prot_code').AsString;  //协议编号
  NewPhoneInfo.iProdClass := NewProdInfo.LwlProdInfo.FieldByName('prod_class').AsString;//产品类别
  NewPhoneInfo.gExchName := NewProdInfo.DblcAddrNo.Text;  //管理局名称
  NewPhoneInfo.iCustType := NewUserinfo.LwlUserInfo.FieldByName('cust_type').AsString;//客户等级

  NewPhoneInfo.BtnNumSelClick(Sender);

end;

procedure TFrmphschange.NewPhoneInfoBtnGroupSelClick(Sender: TObject);
begin
  inherited;
  NewPhoneInfo.iSwithId := NewPhoneInfo.LwlPhoneInfo.FieldByName('switch_id').AsString; //交换机
  NewPhoneInfo.iExchCode := NewProdInfo.LwlProdInfo.FieldByName('exch_code').AsString;  //地址局向

  NewPhoneInfo.BtnGroupSelClick(Sender);

end;

procedure TFrmphschange.BtnCancelClick(Sender: TObject);
var
  RetVal :integer;
  ls_phone ,ls_phone_o : string;   //新产品号码,旧产品号码
  ls_simno,ls_simno_o  : string;   //新sim码,旧sim码
  ls_psno,  ls_psno_o  : string;   //新ps码,旧ps码
  ls_array : array [0..1] of string;
begin
  inherited;
  RetVal := MessageDlg('是否要取消当前操作,返回客户服务中心?', mtConfirmation, [mbYes, mbNo], 0);
  if RetVal=mrno then
  begin
     exit;
  end;
 //判定当前号码是否改变,如果改变,则释放号码;
  ls_phone:=trim(Newphoneinfo.LwlphoneInfo.fieldbyname('product_no').AsString);
  ls_phone_o:=trim(Newphoneinfo.LwlphoneInfoOld.fieldbyname('product_no').AsString);
  if (ls_phone <> ls_phone_o) and (ls_phone<>'') then
  begin
     GetDataCondition(Newphoneinfo.Lwlnumfree,'UPNOSTA',ls_phone,'1');
  end;
  if iprodproptype=0 then
    begin
      ls_simno:=trim(NewPhsSimInfo.LwlPhsSim.FieldByName('card_iccid').AsString);
//      ls_simno_o:=trim(NewPhsSimInfo.LwlPhsSimOld.FieldByName('card_psnm').AsString);
      if (ls_simno<>NewPhsSimInfo.iOldSim) and (ls_simno<>'') then
        begin
          //释放sim码
          ls_array[0] := ls_simno;
          ls_array[1] := '';
          if GetData(NewPhsSimInfo.LwlNumFree,'SIMNUMGL',ls_array,2,2) = 0 then
            begin
              if trim(NewPhsSimInfo.LwlNumFree.Param.ParamByName('retparam1').AsString) = '1' then
                begin
                  NewPhsSimInfo.LwlPhsSim.Edit;
                  NewPhsSimInfo.LwlPhsSim.FieldByName('card_iccid').AsString := NewPhsSimInfo.LwlNumFree.Param.ParamByName('retparam2').AsString;
                  NewPhsSimInfo.LwlPhsSim.Post;
                end
              else
                begin
                  MessageDlg(NewPhsSimInfo.LwlNumFree.Infomation,mtInformation,[mbOk],0);
                  NewPhsSimInfo.LwlPhsSim.FieldByName('card_iccid').AsString := ls_simno;
                  NewPhsSimInfo.DbeCardIccid.SetFocus;
                end;
            end
          else
            begin
              MessageDlg(NewPhsSimInfo.LwlNumFree.Infomation,mtInformation,[mbOk],0);
              NewPhsSimInfo.LwlPhsSim.FieldByName('card_iccid').AsString := ls_simno;
              NewPhsSimInfo.DbeCardIccid.SetFocus;
            end;
        end;
    end
  else
    begin
      ls_psno:=trim(NewFramephsinfo.Lwlphs.FieldByName('ps_code').AsString);
      ls_psno_o:=trim(NewFramephsinfo.oldpscode);
      if (ls_psno<>ls_psno_o) and (ls_psno<>'') then
        begin
          //释放ps码
          NewFramephsinfo.Judgepscode(ls_psno,ls_psno_o);
        end;
    end;
  close;  
end;

procedure TFrmphschange.NewPhsSimInfoButton1Click(Sender: TObject);
begin
  inherited;
  NewPhsSimInfo.Button1Click(Sender);

end;

end.

⌨️ 快捷键说明

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