|
|
|
|
unit U_MSG;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
Dialogs, StdCtrls,u_op_seae_DsWebService,SoapHTTPClient,InvokeRegistry;
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
Tfrm_MSG = class(TForm)
|
|
|
|
|
mmo1: TMemo;
|
|
|
|
|
mmo2: TMemo;
|
|
|
|
|
btn1: TButton;
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
procedure btn1Click(Sender: TObject);
|
|
|
|
|
private
|
|
|
|
|
Letter_flag:Integer;
|
|
|
|
|
mServiceSoap_Ds:DsWebServiceSoap;
|
|
|
|
|
mHttpRIO_ds:THTTPRIO;
|
|
|
|
|
XML :String;
|
|
|
|
|
public
|
|
|
|
|
function GetXML:integer;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frm_MSG: Tfrm_MSG;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses U_op_seae, u_data_share, u_sys_progress;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_MSG.FormShow(Sender: TObject);
|
|
|
|
|
var _i,MSGCount,p1,p2:integer;
|
|
|
|
|
block:string;
|
|
|
|
|
begin
|
|
|
|
|
//ˢ<><CBA2>
|
|
|
|
|
MSGCount:= GetXML;
|
|
|
|
|
if (MSGCount>0) then begin
|
|
|
|
|
mmo1.Clear;
|
|
|
|
|
for _i:=1 to MSGCount do begin
|
|
|
|
|
p1:=frm_data_share.GettimePotion(_i,'<MSGInfo>',xml);
|
|
|
|
|
p2:=frm_data_share.GettimePotion(_i,'</MSGInfo>',xml);
|
|
|
|
|
block:=Copy(xml,p1,p2-p1);
|
|
|
|
|
|
|
|
|
|
mmo1.Lines.Add(frm_data_share.GetXMLValue('SENDERNAME',block)+' '+frm_data_share.GetXMLValue('MSGDate',block));
|
|
|
|
|
mmo1.Lines.Add(frm_data_share.GetXMLValue('FieldValue',block));
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
mmo1.SelStart := Length(mmo1.Text);
|
|
|
|
|
mmo1.SelLength:= Length(mmo1.Text);//0;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_MSG.GetXML:integer;
|
|
|
|
|
var _s,url,block:string;
|
|
|
|
|
p1,p2,MSGCount:integer;
|
|
|
|
|
begin
|
|
|
|
|
if not ASSIGNED(frm_sys_progress) then
|
|
|
|
|
frm_sys_progress:=tfrm_sys_progress.Create(application);
|
|
|
|
|
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD>ڻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ<C8BA><F2A1A3A1><EFBFBD>';
|
|
|
|
|
frm_sys_progress.bsSkinGauge1.MaxValue:=100;
|
|
|
|
|
frm_sys_progress.bsSkinGauge1.MinValue:=0;
|
|
|
|
|
|
|
|
|
|
frm_sys_progress.Show;
|
|
|
|
|
frm_sys_progress.bsSkinGauge1.Value:=0;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
frm_op_seae.getwebservice_ds;
|
|
|
|
|
//<2F><>ȡ<EFBFBD><C8A1>ҵ<EFBFBD><D2B5><EFBFBD>Ĺ<EFBFBD>ͨ<EFBFBD><CDA8>Ϣ
|
|
|
|
|
_s:='<?xml version="1.0" encoding="UTF-8" standalone="no"?> ';
|
|
|
|
|
_s:=_s+' <UserInfo xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
|
|
|
|
|
_s:=_s+' <UserList> ';
|
|
|
|
|
_s:=_s+' <User> ';
|
|
|
|
|
_s:=_s+' <UserID>'+frm_data_share.t_load_employee.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring+'</UserID> ';
|
|
|
|
|
// _s:=_s+' <USERNAME>SENDERCOMPANYID</USERNAME> ';
|
|
|
|
|
_s:=_s+' <BSNO>'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring+'</BSNO> ';
|
|
|
|
|
_s:=_s+' </User> ';
|
|
|
|
|
_s:=_s+' </UserList> ';
|
|
|
|
|
_s:=_s+' </UserInfo> ';
|
|
|
|
|
//ShowMessage(_s);
|
|
|
|
|
XML:=mServiceSoap_Ds.ReceiveMSG(_s);
|
|
|
|
|
XML:=StringReplace(XML,'#$A','',[rfReplaceAll]);
|
|
|
|
|
p1:=frm_data_share.GettimePotion(1,'<MSGList>',XML);
|
|
|
|
|
p2:=frm_data_share.GettimePotion(1,'</MSGList>',xml);
|
|
|
|
|
XML:=copy(XML,p1,p2-p1);
|
|
|
|
|
//ShowMessage(XML);
|
|
|
|
|
MSGcount:= frm_data_share.countString('MSGInfo',xml);
|
|
|
|
|
result:= MSGcount;
|
|
|
|
|
finally
|
|
|
|
|
frm_sys_progress.Close;
|
|
|
|
|
frm_sys_progress.Free;
|
|
|
|
|
frm_sys_progress:=nil;
|
|
|
|
|
if (XML='') then begin
|
|
|
|
|
result:=0;
|
|
|
|
|
//showmessage('û<><C3BB><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
//if assigned(MT1) then MT1.first;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_MSG.btn1Click(Sender: TObject);
|
|
|
|
|
var _s,XML :string;
|
|
|
|
|
begin
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
frm_op_seae.getwebservice_ds;
|
|
|
|
|
|
|
|
|
|
_s:='<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
|
|
|
|
|
_s:=_s+'<BookingMSG xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1">';
|
|
|
|
|
_s:=_s+'<MSGList> ';
|
|
|
|
|
_s:=_s+' <MSGInfo> ';
|
|
|
|
|
_s:=_s+' <SENDERID>'+frm_data_share.t_load_employee.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring+'</SENDERID> ';
|
|
|
|
|
//_s:=_s+' <SENDERCOMPANYID>SENDERCOMPANYID</SENDERCOMPANYID> ';
|
|
|
|
|
//_s:=_s+' <SENDERNAME>SENDERNAME</SENDERNAME> ';
|
|
|
|
|
//_s:=_s+' <SENDERCOMPANYNAME>SENDERCOMPANYNAME</SENDERCOMPANYNAME> ';
|
|
|
|
|
//_s:=_s+' <RECEIVERID>RECEIVERID</RECEIVERID> ';
|
|
|
|
|
//_s:=_s+' <RECEIVERCOMPANYID>RECEIVERCOMPANYID</RECEIVERCOMPANYID> ';
|
|
|
|
|
//_s:=_s+' <RECEIVERNAME>RECEIVERNAME</RECEIVERNAME> ';
|
|
|
|
|
//_s:=_s+' <RECEIVERCOMPANYNAME>RECEIVERCOMPANYNAME</RECEIVERCOMPANYNAME> ';
|
|
|
|
|
_s:=_s+' <BSTYPE><3E><>ͨ<EFBFBD><CDA8>Ϣ</BSTYPE> ';
|
|
|
|
|
_s:=_s+' <BSNO>'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring+'</BSNO> ';
|
|
|
|
|
_s:=_s+' <FieldName><3E><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD></FieldName> ';
|
|
|
|
|
_s:=_s+' <FieldValue>'+mmo2.Lines.Text+'</FieldValue> ';
|
|
|
|
|
//_s:=_s+' <MSGDate></MSGDate> ';
|
|
|
|
|
//_s:=_s+' <RECDate></RECDate> ';
|
|
|
|
|
_s:=_s+' </MSGInfo> ';
|
|
|
|
|
_s:=_s+'</MSGList> ';
|
|
|
|
|
_s:=_s+'</BookingMSG> ';
|
|
|
|
|
|
|
|
|
|
XML:=mServiceSoap_Ds.SendMSG(_s);
|
|
|
|
|
|
|
|
|
|
if (pos('<27>ɹ<EFBFBD>',XML)>0) then begin
|
|
|
|
|
mmo2.Clear;
|
|
|
|
|
frm_MSG.FormShow(Self);
|
|
|
|
|
end else begin
|
|
|
|
|
showmessage('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>');
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|