📄 smg_tq.pas
字号:
unit SMG_TQ;
interface
uses SysUtils;
implementation
uses SP_SMG_DLL, DLL_Exports, SMG_DB;
procedure TQBatchProc;
var
sSvcContent, sChargeNo, sSvcType, sDestNo, p_sDestNo, NowTime, pSPNumber:string;
sSPNum:string;
i,n,pTranType:Integer;
pCurRecNo:LongInt;
SendBuffer:PSendBuffer;
x,z:Real;
begin
NowTime:=FormatDateTime('hh:mm',Now);
//============================搜索指定的数据发送=========================//
if (NowTime=SendTime) and
(SendTime<>'0:00') and
(SendTime<>'00:00')
then begin
SetTime('0:00');
SendTime:=Get_Time;
// str_Out('数据打包发送',1);
ProgressBar;
Progress.Progress:=0;
//'0'表示SP付费,#0空串表示被叫号码付费
sChargeNo:='';
with frmSMGDB do
begin
with qryRegister do
begin
Close;
Parameters.ParamByName('pSvcType').Value:=TranSvcType;
Parameters.ParamByName('pSPNumber').Value:=sSPNumber;
Open;
end;
if qryRegister.RecordCount>0 then
begin
UpTryAll.Close;
UpTryAll.ExecSQL;
n:=qryRegister.RecordCount;
with qrySvcContent do
begin
Close; // 被触发的服务类型
Parameters.ParamByName('pSvcType').Value:=TranSvcType;
Open;
if RecordCount > 0 then
begin
sSvcType := Trim(Fields[0].Text);
sSvcContent := Trim(Fields[1].Text);
end else Exit;
end;
z:=0.00;
x:=0.00;
qryRegister.First;
while not qryRegister.Eof do
begin
I:=0;
p_sDestNo:='';
while (not qryRegister.Eof) and (I<SNDUPT) do
begin
sDestNo:=Trim(qryRegister.Fields[2].Text);
p_sDestNo:=p_sDestNO+sDestNo+',';
qryRegister.Next;
Inc(I);
Inc(RunCount);
if x<1.005 then x:=x+GetProgBar(n) else
begin
Progress.Progress := Progress.Progress+Round(x);
x:=0.00;
end;
// frm_smServer.lCurRecord.Caption:=IntToStr(frmServerDB.aqrRegister1.RecNo);
end;
if Copy(p_sDestNo,Length(p_sDestNo),1)=',' then
p_sDestNo := Copy(p_sDestNo,1,Length(p_sDestNo)-1);
New(SendBuffer);
with SendBuffer^ do
begin
SPNumber:=PChar(SP_Num);
ChargeNumber:=PChar('');
User_Count:=1;
UserNumber:=PChar(p_sDestNo);
Corp_ID:=PChar(SPCode);
Service_Type:=PChar(sSvcType);
Fee_Type:=#2;
Fee_Value:=PChar('10');
Given_Value:=PChar('');
Agent_Flag:=#0;
Mo_Flag:=#0;
Priority:=#0;
Expire_Time:='';
Schedule_Time:='';
Report_Flag:=#1;
Tp_pid:='0';
Tp_udhi:='0';
Message_Coding:=#15;
Message_Type:=#0;
Message_Length:=160;
Message_Content:=PChar(sSvcContent);
end;
BufferList.Add(SendBuffer);
end;
end;
Progress.Progress := 100;
ProgressAction :=True;
qryRegister.Close;
qrySvcContent.Close;
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -