You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DONGSHENG6/海关EDI/u_op_seae_edi_custom_hgydt....

3733 lines
149 KiB
Plaintext

11 months ago
unit u_op_seae_edi_custom_hgydt;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
IdFTP, IdFTPCommon, Dialogs, BusinessSkinForm, StdCtrls, bsSkinCtrls, inifiles,
DB, ADODB, VCLUnZip, VCLZip, bsSkinBoxCtrls, DsWebService, SoapHTTPClient,
InvokeRegistry, IdBaseComponent, IdComponent, IdTCPConnection,IdMultipartFormData,
IdTCPClient, IdHTTP;
type
Tfrm_op_seae_edi_custom_hgydt = class(TForm)
t_op_ctn: TADOQuery;
t_op_ctn1: TDataSource;
t_op_ams: TADOQuery;
bsSkinPanel1: TbsSkinPanel;
VCLZip1: TVCLZip;
SaveDialog1: TSaveDialog;
Label9: TLabel;
Label8: TLabel;
Label3: TLabel;
Label2: TLabel;
Label15: TLabel;
Label12: TLabel;
Label11: TLabel;
Label10: TLabel;
Label1: TLabel;
Edit9: TEdit;
Edit8: TEdit;
Edit3: TEdit;
Edit2: TEdit;
Edit12: TEdit;
Edit11: TEdit;
Edit10: TEdit;
Edit1: TEdit;
ComboBox1: TComboBox;
bsSkinRadioGroup1: TbsSkinRadioGroup;
bsSkinGroupBox1: TbsSkinGroupBox;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
bsSkinCheckListBox1: TbsSkinCheckListBox;
bsSkinButton5: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
IdHTTP1: TIdHTTP;
Label13: TLabel;
Edit13: TEdit;
Label14: TLabel;
Edit14: TEdit;
Memo1: TMemo;
Label16: TLabel;
Memo2: TMemo;
Label17: TLabel;
procedure bsSkinButton2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinRadioGroup1Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
private
mServiceSoap_Ds: DsWebServiceSoap;
mHttpRIO_ds: THTTPRIO;
function isEditrue(DataSet: TDataSet): boolean;
function GetStrNum(str: string): integer;
function FormatListString(Old: TStrings; mCount, Strlength: integer): string;
function FormatEdiString(str: string; Strlength: integer = 0): string;
function CreateSIEdiFile_MBL: TStrings;
function CreateSIEdiFile_XML: TStrings;
function GetCntrEdi(cntrsize: string): string;
function GetpkgsEdi(pkgs: string): string;
function GetlineEdi(aline: string): string;
function GetvesselEdi(avessel: string): string;
function GetLengthword(var s: string; l: Integer; str: string): string;
procedure GetLengthTString(var sl: TStringList; l: integer);
function IsZhongwen(Str: string): Boolean;
function Changestr(str: widestring): string;
function isEditrue_Multi(DataSet: TDataSet): boolean;
function CreateSIEdiFile_XML_Multi: TStrings;
function CreateSIEdiFile_XML_Del: TStrings;
{ Private declarations }
public
{ Public declarations }
function GetPortStr(Port: string): string;
function GetPPCC(aFree: string): string;
function GetCntrSize(code, Cntr: string): string;
function Getport(code, port: string): string;
function GetCarrCustomNO(sanme: string): string;
function GetCtnCode(ctnkind, ctnsize: string): string;
function formatAfrstr(str: string): string;
function formattel(str:string):string;
procedure getwebservice_ds;
procedure SaveUTF8File(AContent:string;AFileName: string);
end;
var
frm_op_seae_edi_custom_hgydt: Tfrm_op_seae_edi_custom_hgydt;
implementation
uses
u_main, my_sys_function, u_data_share, u_op_seae_edi_data;
{$R *.dfm}
procedure Tfrm_op_seae_edi_custom_hgydt.SaveUTF8File(AContent:string;AFileName: string);
var
ffileStream:TFileStream;
futf8Bytes: string;
S: string;
begin
ffileStream:=TFileStream.Create(AFileName,fmCreate);
futf8Bytes:= UTF8Encode(AContent);
S:=#$EF#$BB#$BF;
ffileStream.Write(S[1],Length(S));
ffileStream.Write(futf8Bytes[1],Length(futf8Bytes));
ffileStream.Free;
end;
function Tfrm_op_seae_edi_custom_hgydt.formatAfrstr(str: string): string;
begin
Result := Trim(str);
Result := StringReplace(Result, '&', '&', [rfReplaceAll]);
Result := StringReplace(Result, '<', '&lt;', [rfReplaceAll]);
Result := StringReplace(Result, '"', '&quot;', [rfReplaceAll]);
Result := StringReplace(Result, '>', '&gt;', [rfReplaceAll]);
Result := StringReplace(Result, '''', '&apos;', [rfReplaceAll]);
end;
function Tfrm_op_seae_edi_custom_hgydt.GetCtnCode(ctnkind, ctnsize: string): string;
var
aQuery: TADOQuery;
sl:TStringList;
begin
aQuery := CreateAdoQuery;
ctnsize := StringReplace(ctnsize, '''', '''''', [rfReplaceAll]);
Result := '';
sl:=TStringList.Create;
try
sl.Assign(Memo1.Lines);
Result:=sl.Values[ctnsize+ctnkind];
if (Result='') then begin
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>=''' + ctnkind + ''' and <20>ߴ<EFBFBD>=''' + ctnsize + '''');
Open;
if not IsEmpty then
Result := Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
else
Result := '';
end;
end;
finally
FreeAndNil(aQuery);
FreeAndNil(sl);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.Changestr(str: widestring): string;
var
i: integer;
strC: widestring;
begin
strC := '';
for i := 1 to length(str) do
begin
if ((str[i] = #39) or (str[i] = ':') or (str[i] = '''') or (str[i] = '+') or (str[i] = '?')) then
begin
strC := strC + '?' + str[i];
end
else
begin
strC := strC + str[i];
end;
end;
result := strC;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetCarrCustomNO(sanme: string): string;
var
aQuery: TADOQuery;
begin
result := '';
aQuery := CreateAdoQuery;
try
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('Select <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=:<3A>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>');
Parameters.ParamByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').Value := sanme;
Open;
if (not IsEmpty) and (FieldByName('<27><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>').AsString <> '') then
begin
Result := FieldByName('<27><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>').AsString;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetPPCC(aFree: string): string;
var
aQuery: TADOQuery;
begin
result := '';
aQuery := CreateAdoQuery;
try
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD> from t_code_FREE where <20><><EFBFBD>ѷ<EFBFBD>ʽ=:FREE');
Parameters.ParamByName('FREE').Value := aFree;
Open;
if (not IsEmpty) and (FieldByName('<27><><EFBFBD><EFBFBD>').AsString <> '') then
begin
Result := FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetCntrSize(code, Cntr: string): string;
var
aQuery: TADOQuery;
begin
result := Cntr;
aQuery := CreateAdoQuery;
try
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>=''' + code + '''');
Open;
if (not IsEmpty) and (FieldByName('EDI<44><49><EFBFBD><EFBFBD>').AsString <> '') then
begin
Result := FieldByName('EDI<44><49><EFBFBD><EFBFBD>').AsString;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.Getport(code, port: string): string;
var
aQuery: TADOQuery;
begin
result := port;
aQuery := CreateAdoQuery;
try
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('Select <20>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD> from t_code_edi_port where EDI<44><49><EFBFBD><EFBFBD>=''' + code + '''');
Open;
if (not IsEmpty) and (FieldByName('<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>').AsString <> '') then
begin
Result := FieldByName('<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
end;
if Pos(',', Result) > 0 then
Result := Copy(Result, 1, Pos(',', Result) - 1);
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetPortStr(Port: string): string;
begin
if Pos(',', Port) > 0 then
Result := Copy(Port, 1, Pos(',', Port) - 1)
else
Result := Port;
end;
function Tfrm_op_seae_edi_custom_hgydt.IsZhongwen(Str: string): Boolean;
var
i: Integer;
begin
Result := false;
if Str = '' then
Exit;
for i := 1 to Length(Str) do
begin
// if Str[i]>Chr(127) then begin
if bytetype(Str[i], 1) <> mbsinglebyte then
begin
Result := True;
Exit;
end;
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetLengthword(var s: string; l: Integer; str: string): string;
var
i: Integer;
b: Boolean;
begin
s := '';
if Length(str) <= l then
begin
result := str;
end
else
begin
b := true;
s := Copy(str, l + 1, Length(str) - l);
str := Copy(str, 1, l);
result := '';
for i := Length(str) downto 1 do
begin
if (not (str[i] in [' ', ';', ',', '.', ':', '/', '(', ')', '?', '+', '-'])) and b then
s := str[i] + s
else
begin
b := false;
result := str[i] + Result;
end;
end;
s := s + ' ';
end;
end;
procedure Tfrm_op_seae_edi_custom_hgydt.GetLengthTString(var sl: TStringList; l: integer);
var
i: integer;
str_head, S: string;
Stemp: TStrings;
begin
Stemp := TStringList.Create;
try
str_head := '';
S := '';
for i := 0 to sl.Count - 1 do
begin
if sl[i] <> '' then
Stemp.add(GetLengthword(str_head, l, S + sl[i]));
S := str_head;
end;
while S <> '' do
begin
Stemp.add(GetLengthword(str_head, l, S));
S := str_head;
end;
sl.Assign(Stemp);
finally
FreeAndNil(Stemp);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.FormatEdiString(str: string; Strlength: integer = 0): string;
var
i: integer;
strC: widestring;
begin
strC := '';
for i := 1 to length(str) do
begin
if ((str[i] = #39) or (str[i] = ':') or (str[i] = '+') or (str[i] = '?') or (str[i] = ';')) then
begin
strC := strC + '?' + str[i];
end
else
begin
strC := strC + str[i];
end;
end;
result := strC;
end;
function Tfrm_op_seae_edi_custom_hgydt.FormatListString(Old: TStrings; mCount, Strlength: integer): string;
var
i: integer;
NewStrs: TStrings;
mStr: string;
begin
Result := '';
NewStrs := TStringList.Create;
for i := 0 to Old.Count - 1 do
begin
if Length(Old.Strings[i]) <= Strlength then
begin
NewStrs.Add(Old.Strings[i]);
end
else
begin
mStr := Old.Strings[i];
while length(mStr) > Strlength do
begin
NewStrs.Add(copy(mStr, 1, Strlength));
system.Delete(mStr, 1, Strlength);
end;
NewStrs.Add(mStr);
end;
end;
try
for i := 0 to mCount - 1 do
begin
if i < NewStrs.Count then
begin
Result := Result + NewStrs.Strings[i];
end;
if i < mCount - 1 then
Result := Result + ':';
end;
finally
FreeAndNil(NewStrs);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetStrNum(str: string): integer;
var
i: integer;
begin
result := 0;
if str = '' then
exit;
for i := 1 to length(str) do
begin
if str[i] in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] then
result := result + 1;
end;
end;
procedure Tfrm_op_seae_edi_custom_hgydt.bsSkinButton2Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_op_seae_edi_custom_hgydt.FormShow(Sender: TObject);
var
inifile1: Tinifile;
begin
inifile1 := Tinifile.Create(ExtractFilePath(application.ExeName) + 'main.ini');
edit1.text := inifile1.ReadString('customHGYDT', 'SEND', '');
edit2.text := inifile1.ReadString('customHGYDT', 'RECIEVE', '');
edit3.text := inifile1.ReadString('customHGYDT', 'SENDNAME', '');
edit4.text := inifile1.ReadString('customHGYDT', 'FTPSERVER', '');
edit5.text := inifile1.ReadString('customHGYDT', 'FTPPATH', '/');
edit6.text := inifile1.ReadString('customHGYDT', 'FTPNAME', '');
edit7.text := inifile1.ReadString('customHGYDT', 'FTPPASS', '');
edit8.text := inifile1.ReadString('customHGYDT', 'SENDDEPT', '');
edit9.text := inifile1.ReadString('customHGYDT', 'SENDATTN', '');
edit10.text := inifile1.ReadString('customHGYDT', 'SENDTEL', '');
edit11.text := inifile1.ReadString('customHGYDT', 'SENDFAX', '');
edit12.text := inifile1.ReadString('customHGYDT', 'SENDEMAIL', '');
edit13.text:=inifile1.ReadString('customHGYDT','ESINAME','');
edit14.text:=inifile1.ReadString('customHGYDT','ESIPASS','');
if FileExists(ExtractFilePath(Application.ExeName)+'CNTRSTR.txt') then
Memo1.Lines.LoadFromFile(ExtractFilePath(Application.ExeName)+'CNTRSTR.txt');
ComboBox1.text := inifile1.ReadString('customHGYDT', 'SENDFILETYPE', 'txt');
inifile1.free;
if frm_op_seae_edi_data.dxDBGrid1.SelectedCount>1 then bsSkinCheckRadioBox2.Checked:=True
else bsSkinCheckRadioBox2.Checked:=False;
if (Memo1.text='') then begin
frm_data_share.t_code_ctn.First;
while not frm_data_share.t_code_ctn.Eof do begin
Memo1.Lines.Add(frm_data_share.t_code_ctn.fieldbyname('<27>ߴ<EFBFBD>').asstring+frm_data_share.t_code_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'='+frm_data_share.t_code_ctn.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring);
frm_data_share.t_code_ctn.Next;
end;
end;
//82916891 л
end;
procedure Tfrm_op_seae_edi_custom_hgydt.bsSkinButton1Click(Sender: TObject);
var
Str: TStrings;
inifile1: Tinifile;
i: integer;
numunzipped: integer;
fileType: string;
begin
if bsSkinRadioGroup1.ItemIndex = 0 then
fileType := '-9'
else if bsSkinRadioGroup1.ItemIndex = 1 then
fileType := '-2'
else if bsSkinRadioGroup1.ItemIndex = 2 then
fileType := '-3'
else if bsSkinRadioGroup1.ItemIndex = 3 then
fileType := '-5'
else if bsSkinRadioGroup1.ItemIndex = 4 then
fileType := '-0'
else if bsSkinRadioGroup1.ItemIndex = 5 then
fileType := '-11'
else
fileType := '-9';
{
9 <20><>Ҫ
2 <20><><EFBFBD><EFBFBD>
3 ɾ<><C9BE>
5 <20><><EFBFBD><EFBFBD>
0 <20><>Ҫ
11 ָ<><D6B8>
}
inifile1 := Tinifile.Create(ExtractFilePath(application.ExeName) + 'main.ini');
inifile1.WriteString('customHGYDT', 'SEND', edit1.text);
inifile1.WriteString('customHGYDT', 'RECIEVE', edit2.text);
inifile1.WriteString('customHGYDT', 'SENDNAME', edit3.text);
inifile1.WriteString('customHGYDT', 'FTPSERVER', edit4.text);
inifile1.WriteString('customHGYDT', 'FTPPATH', edit5.text);
inifile1.WriteString('customHGYDT', 'FTPNAME', edit6.text);
inifile1.WriteString('customHGYDT', 'FTPPASS', edit7.text);
inifile1.WriteString('customHGYDT', 'SENDDEPT', edit8.text);
inifile1.WriteString('customHGYDT', 'SENDATTN', edit9.text);
inifile1.WriteString('customHGYDT', 'SENDTEL', edit10.text);
inifile1.WriteString('customHGYDT', 'SENDFAX', edit11.text);
inifile1.WriteString('customHGYDT', 'SENDEMAIL', edit12.text);
inifile1.WriteString('customHGYDT', 'SENDFILETYPE', ComboBox1.text);
inifile1.WriteString('customHGYDT', 'CNTRSTR',Memo1.Text);
Memo1.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+'CNTRSTR.txt');
// inifile1.WriteString('customWAIDAI','ESINAME',edit13.text);
// inifile1.WriteString('customWAIDAI','ESIPASS',edit14.text);
inifile1.free;
Str := Tstringlist.Create;
try
if (ComboBox1.Text = '') or (ComboBox1.Text = 'txt') then
Str := CreateSIEdiFile_MBL
else
begin
if (fileType='-3') then begin
Str :=CreateSIEdiFile_XML_Del;
end else begin
if bsSkinCheckRadioBox2.Checked then Str := CreateSIEdiFile_XML_Multi
else Str := CreateSIEdiFile_xml;
end;
end;
for i := 0 to Str.Count - 1 do
begin
if IsZhongwen(Str[i]) then
begin
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>', mtWarning, [mbYes, mbNo], 0) = mrNo then
exit;
end;
end;
SaveDialog1.FileName := frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
if (ComboBox1.Text = '') or (ComboBox1.Text = 'txt') then
SaveDialog1.Filter := '*.txt|*.txt'
else
SaveDialog1.Filter := '*.xml|*.xml';
if SaveDialog1.Execute then
begin
if (ComboBox1.Text = '') or (ComboBox1.Text = 'txt') then
Str.SaveToFile(SaveDialog1.FileName + fileType + '.txt')
else begin
//
if (fileType='-3') then begin
SaveUTF8File(Str.Text,SaveDialog1.FileName + fileType + '.xml');
end else begin
Str.SaveToFile(SaveDialog1.FileName + fileType + '.xml');
end;
end;
if ComboBox1.Text = 'xml' then
with VCLZip1 do
begin
FilesList.Add(SaveDialog1.FileName + fileType + '.xml');
zipname := frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring + fileType + '.zip';
DoAll := false;
DestDir := ExtractFilePath(SaveDialog1.GetNamePath);
RecreateDirs := false;
RetainAttributes := true;
numunzipped := Zip;
end;
//VCLZip.l
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
end
else
begin
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
exit;
end;
finally
FreeAndNil(Str)
end;
close;
end;
function Tfrm_op_seae_edi_custom_hgydt.isEditrue(DataSet: TDataSet): boolean;
var
cntrs, substr: string;
i, c: Integer;
begin
result := true;
if trim(Edit1.text) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(Edit2.text) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
c := 0;
if bsSkinRadioGroup1.ItemIndex = 3 then
begin
for i := 0 to bsSkinCheckListBox1.Items.Count - 1 do
begin
if bsSkinCheckListBox1.Checked[i] then
begin
c := c + 1;
end;
end;
if c <= 0 then
begin
ShowMessage('<27>޸<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>ԭ<EFBFBD><D4AD>');
result := false;
end
else if c > 4 then
begin
ShowMessage('<27><><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>ѡ<EFBFBD><D1A1>4<EFBFBD><34>ԭ<EFBFBD><D4AD>');
result := false;
end;
end;
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) = '' then
begin
result := false;
MessageDlg('<27><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>ѷ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
{
if trim(DataSet.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('װ<>۴<EFBFBD><DBB4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('װ<><D7B0><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
}
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('Ŀ<>ĵز<C4B5><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('ǩ<><C7A9><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
{
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
}
if (trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').asstring) = '') and (trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '') then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰<CBB5><E7BBB0><EFBFBD><EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
substr := trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
substr := StringReplace(substr, ' ', '', [rfReplaceAll]);
substr := UpperCase(substr);
if ((Length(substr) >= 7) and (Copy(substr, 1, 7) = 'TOORDER')) or ((Length(substr) >= 10) and (Copy(substr, 1, 10) = 'TOTHEORDER')) then
begin
{
if trim(DataSet.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
}
if trim(DataSet.fieldbyname('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
end
else
begin
{
if trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
}
if (trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').asstring) = '') and (trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '') then
begin
result := false;
MessageDlg('<27>ջ<EFBFBD><D5BB>˵绰<CBB5><E7BBB0><EFBFBD><EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
end;
if trim(GetpkgsEdi(DataSet.fieldbyname('<27><>װ').asstring)) = '' then
begin
result := false;
MessageDlg('<27><>װEDI<44><49><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD>!', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><>ͷ').asstring) = '' then
begin
result := false;
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger = 0 then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat = 0 then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
{
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat = 0 then
begin
result := false;
MessageDlg('<27>ܳ<EFBFBD><DCB3><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
}
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'D' then
begin
if Trim(DataSet.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if Trim(DataSet.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if GetStrNum(Trim(DataSet.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)) <> 4 then
begin
result := false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD><34><CEBB><EFBFBD><EFBFBD>', mtWarning, [mbOk], 0);
end;
end;
if trim(DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'R' then
begin
if Trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
end;
t_op_ctn.close;
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value := DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_op_ctn.open;
if t_op_ctn.IsEmpty then
begin
result := false;
MessageDlg('<27><>װ<EFBFBD><EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
t_op_ctn.First;
while not t_op_ctn.Eof do
begin
if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', mtWarning, [mbOk], 0);
end;
if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', mtWarning, [mbOk], 0);
end;
t_op_ctn.Next;
end;
if iszhongwen(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString) then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
if iszhongwen(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString) then
begin
result := false;
MessageDlg('<27>ջ<EFBFBD><D5BB>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
if iszhongwen(DataSet.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString) then
begin
result := false;
MessageDlg('֪ͨ<CDA8>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
if iszhongwen(DataSet.fieldbyname('<27><>ͷ').AsString) then
begin
result := false;
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
if iszhongwen(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
end;
//2018-8-3
function Tfrm_op_seae_edi_custom_hgydt.isEditrue_Multi(DataSet: TDataSet): boolean;
var
cntrs, substr: string;
i, c: Integer;
begin
result := true;
if trim(Edit1.text) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(Edit2.text) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
c := 0;
if bsSkinRadioGroup1.ItemIndex = 3 then
begin
for i := 0 to bsSkinCheckListBox1.Items.Count - 1 do
begin
if bsSkinCheckListBox1.Checked[i] then
begin
c := c + 1;
end;
end;
if c <= 0 then
begin
ShowMessage('<27>޸<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>ԭ<EFBFBD><D4AD>');
result := false;
end
else if c > 4 then
begin
ShowMessage('<27><><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>ѡ<EFBFBD><D1A1>4<EFBFBD><34>ԭ<EFBFBD><D4AD>');
result := false;
end;
end;
DataSet.First;
while not DataSet.Eof do
begin
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) = '' then
begin
result := false;
MessageDlg('<27><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>ѷ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('װ<>۴<EFBFBD><DBB4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('װ<><D7B0><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('Ŀ<>ĵز<C4B5><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('ǩ<><C7A9><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
{
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
}
if (trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').asstring) = '') and (trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '') then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰<CBB5><E7BBB0><EFBFBD><EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
substr := trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
substr := StringReplace(substr, ' ', '', [rfReplaceAll]);
substr := UpperCase(substr);
if ((Length(substr) >= 7) and (Copy(substr, 1, 7) = 'TOORDER')) or ((Length(substr) >= 10) and (Copy(substr, 1, 10) = 'TOTHEORDER')) then
begin
{
if trim(DataSet.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
}
if trim(DataSet.fieldbyname('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
end
else
begin
{
if trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
}
if (trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').asstring) = '') and (trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '') then
begin
result := false;
MessageDlg('<27>ջ<EFBFBD><D5BB>˵绰<CBB5><E7BBB0><EFBFBD><EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
end;
if trim(GetpkgsEdi(DataSet.fieldbyname('<27><>װ').asstring)) = '' then
begin
result := false;
MessageDlg('<27><>װEDI<44><49><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD>!', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><>ͷ').asstring) = '' then
begin
result := false;
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger = 0 then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat = 0 then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
{
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat = 0 then
begin
result := false;
MessageDlg('<27>ܳ<EFBFBD><DCB3><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
}
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if trim(DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'D' then
begin
if Trim(DataSet.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if Trim(DataSet.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
if GetStrNum(Trim(DataSet.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)) <> 4 then
begin
result := false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD><34><CEBB><EFBFBD><EFBFBD>', mtWarning, [mbOk], 0);
end;
end;
if trim(DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'R' then
begin
if Trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
{
if Trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
}
end;
t_op_ctn.close;
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value := DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
t_op_ctn.open;
if t_op_ctn.IsEmpty then
begin
result := false;
MessageDlg('<27><>װ<EFBFBD><EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>', mtWarning, [mbOk], 0);
end;
t_op_ctn.First;
while not t_op_ctn.Eof do
begin
if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', mtWarning, [mbOk], 0);
end;
if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) = '' then
begin
result := false;
MessageDlg('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', mtWarning, [mbOk], 0);
end;
t_op_ctn.Next;
end;
if iszhongwen(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString) then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
if iszhongwen(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString) then
begin
result := false;
MessageDlg('<27>ջ<EFBFBD><D5BB>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
if iszhongwen(DataSet.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString) then
begin
result := false;
MessageDlg('֪ͨ<CDA8>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
if iszhongwen(DataSet.fieldbyname('<27><>ͷ').AsString) then
begin
result := false;
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
if iszhongwen(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) then
begin
result := false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>', mtWarning, [mbOk], 0);
end;
DataSet.Next;
end; //end of dataset
end;
function Tfrm_op_seae_edi_custom_hgydt.CreateSIEdiFile_MBL: TStrings;
var
str: Tstringlist;
Tempstr: TStrings;
Temprslt: string;
i, j, Count: integer;
strsql, strRmain: string;
rs, aQuery2: Tadoquery;
wide_str: widestring;
k: integer;
inifile1: Tinifile;
strType, XType, TransType: string;
strDatetime, IMO: string;
SenderCode, ReciverCode: string;
begin
if not isEditrue(frm_op_seae_edi_data.t_op_seae) then
begin
Exit;
end;
SenderCode := trim(edit1.Text);
ReciverCode := trim(edit2.Text);
if bsSkinRadioGroup1.ItemIndex = 0 then
strType := '9'
else if bsSkinRadioGroup1.ItemIndex = 1 then
strType := '2'
else if bsSkinRadioGroup1.ItemIndex = 2 then
strType := '3'
else if bsSkinRadioGroup1.ItemIndex = 3 then
strType := '5'
else if bsSkinRadioGroup1.ItemIndex = 4 then
strType := '0'
else if bsSkinRadioGroup1.ItemIndex = 5 then
strType := '11'
else
strType := '9';
{9 <20><>Ҫ
2 <20><><EFBFBD><EFBFBD>
3 ɾ<><C9BE>
5 <20><><EFBFBD><EFBFBD>
0 <20><>Ҫ
11 ָ<><D6B8>}
// ShowMessage(IntToStr(frm_op_seae_edi_data.dxdbgrid1.SelectedCount));
if frm_op_seae_edi_data.dxdbgrid1.SelectedCount <= 1 then
begin
str := Tstringlist.Create;
str.Clear;
str.Add('00:MT2101::' + trim(strType) + ':' + SenderCode + ':' + ReciverCode + ':' + GetDatetime(datetimetostr(now), 4) + ':1.0' + ':' + SenderCode + GetDatetime(datetimetostr(now), 4) + #39);
//
Count := 0;
str.Add('10' + ':' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>IMO').asstring // 2 <20><><EFBFBD><EFBFBD>IMO<4D><4F><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD>
+ ':' //4<><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //5<><35><EFBFBD><EFBFBD>
+ ':' //6 <20><><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD>
+ ':' //7 <20><><EFBFBD><EFBFBD>
+ ':' //8Ԥ<38>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + GetDatetime(DateToStr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+5), 1) + '086'//9 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>
+ ':CNQGD/4218' //+ frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring // 10<31><30><EFBFBD>۵ص<DBB5><D8B5><EFBFBD><EFBFBD><EFBFBD><EBA3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>غ<EFBFBD><D8BA>ش<EFBFBD><D8B4>
+ ':CNQGD' //+ frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring // 11 <20><><EFBFBD>۵ص<DBB5>
+ ':' //12 <20><>һ<EFBFBD>Ҹ۴<D2B8><DBB4><EFBFBD>
+ ':' //13 <20><>һ<EFBFBD>Ҹ<EFBFBD>
+ ':1' //14<31><34><EFBFBD>ʽ<E4B7BD><CABD><EFBFBD><EFBFBD>
+ #39);
str.Add('11' + ':' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString //2 <20><><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>
+ ':' //3 <20><><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
+ ':' + SenderCode //4<>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ???
+ ':' //5<><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
+ ':' + GetDatetime(DateToStr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+5), 3) //6<><36>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B9A4>ʱ<EFBFBD><CAB1>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //7<><37><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ؾ<EFBFBD><D8BE>ڵ<EFBFBD>һ<EFBFBD><D2BB>Ŀ<EFBFBD>ĸ۴<C4B8><DBB4><EFBFBD>
+ ':' + GetDatetime(DateToStr(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+5), 3)//8<><38><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ؾ<EFBFBD><D8BE>ڵ<EFBFBD>һ<EFBFBD><D2BB>Ŀ<EFBFBD>ĸ۵<C4B8><DBB5><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD><CAB1>
+ #39);
if pos('FREIGHT PREPAID', trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) > 0 then
XType := 'PP'
else if pos('FREIGHT COLLECT', trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) > 0 then
XType := 'CC'
else
XType := 'PP';
if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'CY-CY' then
TransType := '10'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'DOOR-DOOR' then
TransType := '27'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'DOOR-PIER' then
TransType := '28'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'PIER-DOOR' then
TransType := '29'
else
TransType := '10'; // PIER TO PIER
str.add('12:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //2<><32><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>
+ ':' //3 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //4 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B4AC>
+ ':' //5 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4BABD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) //6 <20>ջ<EFBFBD><D5BB>ش<EFBFBD><D8B4><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) //7<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':CNQGD/4218' //+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) //8װ<38><D7B0><EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
+ ':CNQGD' //+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) //9װ<39><D7B0><EFBFBD><EFBFBD>
+ ':' + TransType //10<31><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + XType //11<31><31><EFBFBD>ʽ<EEB7BD><CABD><EFBFBD>˷<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring, 1) + '086'//12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>
+ ':' //13<31><33><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD>
+ ':' //14ǩ<34><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //15<31><35><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4>
+ ':' //16 <20><><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //17 <20><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //18 <20><><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD>
+ ':' + trim(GetpkgsEdi(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring)) //19 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //20 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><C3AB>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //22 <20><><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>ֵ
+ ':' //23 <20><>ͷ<EFBFBD><CDB7>ҵָ<D2B5><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //24 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ ':' //25 ǰһ<C7B0><D2BB><EFBFBD>ص<EFBFBD>֤<EFBFBD><D6A4>
+ ':' //26 ǰһ<C7B0><D2BB><EFBFBD>ص<EFBFBD>֤<EFBFBD><D6A4><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>
+ ':001' //27 <20><><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>(1~99)
+ #39);
str.add('13:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //2ж<32><D0B6><EFBFBD>ش<EFBFBD><D8B4><EFBFBD> ???
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring) //3ж<33><D0B6><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) //4<><34><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) //5<><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' // 6 <20><>ת<EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
+ ':' // 7 <20><>ת<EFBFBD><D7AA>
+ ':' // 8 <20>ᵥǩ<E1B5A5><C7A9><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EBA3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵ػ<CBB5><D8BB>߹<EFBFBD><DFB9>Ҵ<EFBFBD><D2B4>
+ ':' // 9
+ ':' // 10
+ ':' + GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring, 0) // 11
+ ':' // 12
+ ':' // 13
+ #39);
str.add('16' + ':' //2 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ1').AsString) //4<><34><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>').AsString) //5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //6 ʡ<>ݴ<EFBFBD><DDB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //7 ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>').AsString) //8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString) //9 <20><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString) //10 <20><><EFBFBD><EFBFBD><EFBFBD>˵绰
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>').AsString) //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>EMAIL
+ ':' ///12 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
str.add('17' + ':' //2 <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ1').AsString) //4<>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˳<EFBFBD><CBB3><EFBFBD>').AsString) //5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //6 ʡ<>ݴ<EFBFBD><DDB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>').AsString) //7 ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').AsString) //8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString) //9 <20><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString) //10 <20>ջ<EFBFBD><D5BB>˵绰
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>').AsString) //11 <20>ջ<EFBFBD><D5BB><EFBFBD>EMAIL
+ ':' ///12 <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>
+ ':' ///13 <20>ջ<EFBFBD><D5BB>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' ///14 <20>ջ<EFBFBD><D5BB>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵绰
+ ':' ///15 <20>ջ<EFBFBD><D5BB>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>EMAIL
+ ':' ///16 <20>ջ<EFBFBD><D5BB>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
str.add('18' + ':' //2 ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵<EFBFBD>ַ1').AsString) //4֪ͨ<CDA8>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˳<EFBFBD><CBB3><EFBFBD>').AsString) //5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //6 ʡ<>ݴ<EFBFBD><DDB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>').AsString) //7 ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').AsString) //8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString) //9 <20><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵绰').AsString) //10 ֪ͨ<CDA8>˵绰
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>').AsString) //11 ֪ͨ<CDA8><D6AA>EMAIL
+ ':' ///12 ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
str.add('30' + ':' //2
+ ':' //3
+ ':' //4
+ ':' //5
+ #39);
str.add('31' + ':' //2
+ ':' //3
+ ':' //4
+ ':' //5
+ ':' //6
+ ':' //7
+ #39);
str.Add('41:1' //2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(GetpkgsEdi(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring)) //5 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring) // 6 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 7<><37>ë<EFBFBD><C3AB>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 8<><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 9<><39><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ʽ').asstring) // 10<31><30><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ʽ
+ ':' // 11<31><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' // 12ԭ<32><D4AD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
+ #39);
if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'D' then
begin
str.Add('43:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':none' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':none' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+ ':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+ ':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+ ':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+ ':' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+ ':' //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+ ':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+ ':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
end
else if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'R' then
begin
str.Add('43:' //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+ ':' //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+ ':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+ ':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+ ':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+ ':C' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+ ':' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+ ':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+ ':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
end
else
begin
str.Add('43:' //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+ ':' //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+ ':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+ ':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+ ':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+ ':' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+ ':' //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+ ':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+ ':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
end;
Temprslt := Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>ͷ').asstring);
Temprslt := StringReplace(Temprslt, #13#10, ' ', [rfReplaceAll]);
str.Add('44:' + Temprslt + #39);
Temprslt := Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
Temprslt := StringReplace(Temprslt, #13#10, ' ', [rfReplaceAll]);
str.Add('47:' + Temprslt + #39);
Count := Count + 10;
strsql := 'select * from t_op_ctn_edi ' + 'WHERE <20><><EFBFBD><EFBFBD>=' + #39 + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring + #39;
try
rs := Tadoquery.Create(application);
rs.Connection := frm_main.db;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
rs.First;
if not rs.IsEmpty then
begin
rs.First;
while not rs.Eof do
begin
str.Add('51' + ':' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //2<><32><EFBFBD><EFBFBD>
+ ':' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //3<><33>Ǧ<EFBFBD><C7A6><EFBFBD><EFBFBD>
+ ':' + GetCtnCode(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring, rs.fieldbyname('<27>ߴ<EFBFBD>').asstring) //4<><34>װ<EFBFBD><D7B0><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>GetCtnCode
+ ':8' //5<><35>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><DFBF><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>
+ ':' + trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger)) //6<><36><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //7<><37><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD>
+ ':0' //8<><38>Ƥ<EFBFBD><C6A4>
+ ':' + trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //9<><39><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //10
+ ':' //11
+ ':' //12
+ ':' // 13
+ ':' // 14
+ ':' // 15
+ ':2' // 16
+ #39);
str.Add('52' + ':M' //3 <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD>
+ ':CA' //4 ʩ<>ӷ<EFBFBD>־<EFBFBD><D6BE>
+ ':' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //2 <20><>־<EFBFBD><D6BE>
+ #39);
Count := Count + 1;
rs.Next;
end;
end;
rs.Close;
rs.Destroy;
except
on e: exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
str.Add('99:' + inttostr(Count + 2) + #39);
frm_op_seae_edi_data.t_op_seae.Edit;
frm_op_seae_edi_data.t_op_seae.FieldByName('EDI״̬').AsString := '<27>ѷ<EFBFBD><D1B7><EFBFBD>';
frm_op_seae_edi_data.t_op_seae.Post;
end
else
begin
str := Tstringlist.Create;
str.Clear;
str.Add('00:MT2101::' + trim(strType) + ':' + SenderCode + ':' + ReciverCode + ':' + GetDatetime(datetimetostr(now), 4) + ':1.0' + ':' + SenderCode + GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring, 1) + #39);
Count := 0;
str.Add('10' + ':' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>IMO').asstring // 2 <20><><EFBFBD><EFBFBD>IMO<4D><4F><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD>
+ ':' //4<><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //5<><35><EFBFBD><EFBFBD>
+ ':' //6 <20><><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD>
+ ':' //7 <20><><EFBFBD><EFBFBD>
+ ':' //8Ԥ<38>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring, 1) + '086'//9 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>
+ ':CNQGD/4218'// + frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring // 10<31><30><EFBFBD>۵ص<DBB5><D8B5><EFBFBD><EFBFBD><EFBFBD><EBA3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>غ<EFBFBD><D8BA>ش<EFBFBD><D8B4>
+ ':CNQGD' //+ frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring // 11 <20><><EFBFBD>۵ص<DBB5>
+ ':' //12 <20><>һ<EFBFBD>Ҹ۴<D2B8><DBB4><EFBFBD>
+ ':' //13 <20><>һ<EFBFBD>Ҹ<EFBFBD>
+ ':1' //14<31><34><EFBFBD>ʽ<E4B7BD><CABD><EFBFBD><EFBFBD>
+ #39);
str.Add('11' + ':' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString //2 <20><><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>
+ ':' //3 <20><><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
+ ':' + SenderCode //4<>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ???
+ ':' //5<><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
+ ':' + GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring, 3) //6<><36>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B9A4>ʱ<EFBFBD><CAB1>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //7<><37><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ؾ<EFBFBD><D8BE>ڵ<EFBFBD>һ<EFBFBD><D2BB>Ŀ<EFBFBD>ĸ۴<C4B8><DBB4><EFBFBD>
+ ':' + GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring, 3)//8<><38><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ؾ<EFBFBD><D8BE>ڵ<EFBFBD>һ<EFBFBD><D2BB>Ŀ<EFBFBD>ĸ۵<C4B8><DBB5><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD><CAB1>
+ #39);
if pos('FREIGHT PREPAID', trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) > 0 then
XType := 'PP'
else if pos('FREIGHT COLLECT', trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) > 0 then
XType := 'CC'
else
XType := 'PP';
for k := 0 to frm_op_seae_edi_data.dxdbgrid1.SelectedCount - 1 do
begin
frm_op_seae_edi_data.t_op_seae.GotoBookmark(pointer(frm_op_seae_edi_data.dxdbgrid1.selectedrows[k]));
if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'CY-CY' then
TransType := '10'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'DOOR-DOOR' then
TransType := '27'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'DOOR-PIER' then
TransType := '28'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'PIER-DOOR' then
TransType := '29'
else
TransType := '10'; // PIER TO PIER
str.add('12:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //2<><32><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>
+ ':' //3 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //4 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B4AC>
+ ':' //5 ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4BABD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) //6 <20>ջ<EFBFBD><D5BB>ش<EFBFBD><D8B4><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) //7<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':CNQGD/4218'// + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) //8װ<38><D7B0><EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
+ ':CNQGD' //+ trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) //9װ<39><D7B0><EFBFBD><EFBFBD>
+ ':' + TransType //10<31><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + XType //11<31><31><EFBFBD>ʽ<EEB7BD><CABD><EFBFBD>˷<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring, 1) + '086'//12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>
+ ':' //13<31><33><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD>
+ ':' //14ǩ<34><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //15<31><35><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4>
+ ':' //16 <20><><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //17 <20><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //18 <20><><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD>
+ ':' + trim(GetpkgsEdi(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring)) //19 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //20 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><C3AB>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //22 <20><><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>ֵ
+ ':' //23 <20><>ͷ<EFBFBD><CDB7>ҵָ<D2B5><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //24 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ ':' //25 ǰһ<C7B0><D2BB><EFBFBD>ص<EFBFBD>֤<EFBFBD><D6A4>
+ ':' //26 ǰһ<C7B0><D2BB><EFBFBD>ص<EFBFBD>֤<EFBFBD><D6A4><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>
+ ':001' //27 <20><><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD>(1~99)
+ #39);
str.add('13:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //2ж<32><D0B6><EFBFBD>ش<EFBFBD><D8B4><EFBFBD> ???
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring) //3ж<33><D0B6><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) //4<><34><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) //5<><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' // 6 <20><>ת<EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
+ ':' // 7 <20><>ת<EFBFBD><D7AA>
+ ':' // 8 <20>ᵥǩ<E1B5A5><C7A9><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EBA3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵ػ<CBB5><D8BB>߹<EFBFBD><DFB9>Ҵ<EFBFBD><D2B4>
+ ':' // 9
+ ':' // 10
+ ':' + GetDatetime(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring, 0) // 11
+ ':' // 12
+ ':' // 13
+ #39);
str.add('16' + ':' //2 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ1').AsString) //4<><34><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>').AsString) //5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //6 ʡ<>ݴ<EFBFBD><DDB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //7 ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>').AsString) //8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString) //9 <20><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString) //10 <20><><EFBFBD><EFBFBD><EFBFBD>˵绰
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>').AsString) //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>EMAIL
+ ':' ///12 <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
str.add('17' + ':' //2 <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ1').AsString) //4<>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˳<EFBFBD><CBB3><EFBFBD>').AsString) //5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //6 ʡ<>ݴ<EFBFBD><DDB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>').AsString) //7 ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>ʱ<EFBFBD>').AsString) //8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString) //9 <20><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString) //10 <20>ջ<EFBFBD><D5BB>˵绰
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>').AsString) //11 <20>ջ<EFBFBD><D5BB><EFBFBD>EMAIL
+ ':' ///12 <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>
+ ':' ///13 <20>ջ<EFBFBD><D5BB>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' ///14 <20>ջ<EFBFBD><D5BB>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵绰
+ ':' ///15 <20>ջ<EFBFBD><D5BB>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>EMAIL
+ ':' ///16 <20>ջ<EFBFBD><D5BB>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
str.add('18' + ':' //2 ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) //3֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵<EFBFBD>ַ1').AsString) //4֪ͨ<CDA8>˵<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˳<EFBFBD><CBB3><EFBFBD>').AsString) //5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //6 ʡ<>ݴ<EFBFBD><DDB4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>').AsString) //7 ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD>ʱ<EFBFBD>').AsString) //8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString) //9 <20><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵绰').AsString) //10 ֪ͨ<CDA8>˵绰
+ ':' + Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>').AsString) //11 ֪ͨ<CDA8><D6AA>EMAIL
+ ':' ///12 ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
str.add('30' + ':' //2
+ ':' //3
+ ':' //4
+ ':' //5
+ #39);
str.add('31' + ':' //2
+ ':' //3
+ ':' //4
+ ':' //5
+ ':' //6
+ ':' //7
+ #39);
str.Add('41:1' //2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(GetpkgsEdi(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring)) //5 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring) // 6 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 7<><37>ë<EFBFBD><C3AB>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 8<><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 9<><39><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' // 10<31><30><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' // 11<31><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' // 12ԭ<32><D4AD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
+ #39);
if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'D' then
begin
str.Add('43:' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':none' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+ ':' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':none' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+ ':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+ ':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+ ':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+ ':' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+ ':' //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+ ':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+ ':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
end
else if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'R' then
begin
str.Add('43:' //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+ ':' //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+ ':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+ ':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+ ':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+ ':C' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+ ':' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+ ':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+ ':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
end
else
begin
str.Add('43:' //2Σ<32><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':' //3Σ<33><CEA3>Ʒҳ<C6B7><D2B3>
+ ':' //4<><34><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
+ ':' //5Σ<35><CEA3>Ʒ<EFBFBD><C6B7>ǩ
+ ':' //6 Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //7 <20><><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3>ƷӦ<C6B7><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
+ ':' //8 ҽ<>Ƽ<EFBFBD><C6BC><EFBFBD>ָ<EFBFBD>Ϻ<EFBFBD>
+ ':' //9 Ӧ<><D3A6><EFBFBD><EFBFBD>ϵ
+ ':' //10 <20>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ
+ ':' //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //12 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //14 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //15 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˵绰
+ ':' //16 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>EMAIL
+ ':' //17 Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>
+ #39);
end;
Temprslt := Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>ͷ').asstring);
Temprslt := StringReplace(Temprslt, #13#10, ' ', [rfReplaceAll]);
str.Add('44:' + Temprslt + #39);
Temprslt := Changestr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
Temprslt := StringReplace(Temprslt, #13#10, ' ', [rfReplaceAll]);
str.Add('47:' + Temprslt + #39);
Count := Count + 10;
strsql := 'select * from t_op_ctn_edi ' + 'WHERE <20><><EFBFBD><EFBFBD>=' + #39 + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring + #39;
try
rs := Tadoquery.Create(application);
rs.Connection := frm_main.db;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
rs.First;
if not rs.IsEmpty then
begin
rs.First;
while not rs.Eof do
begin
str.Add('51' + ':' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //2<><32><EFBFBD><EFBFBD>
+ ':' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //3<><33>Ǧ<EFBFBD><C7A6><EFBFBD><EFBFBD>
+ ':' + GetCtnCode(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring, rs.fieldbyname('<27>ߴ<EFBFBD>').asstring) //4<><34>װ<EFBFBD><D7B0><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>GetCtnCode
+ ':8' //5<><35>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><DFBF><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>
+ ':' + trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger)) //6<><36><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' + trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //7<><37><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD>
+ ':0' //8<><38>Ƥ<EFBFBD><C6A4>
+ ':' + trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //9<><39><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ ':' //10
+ ':' //11
+ ':' //12
+ ':' // 13
+ ':' // 14
+ ':' // 15
+ ':2' // 16
+ #39);
str.Add('52' + ':M' //3 <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD>
+ ':CA' //4 ʩ<>ӷ<EFBFBD>־<EFBFBD><D6BE>
+ ':' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //2 <20><>־<EFBFBD><D6BE>
+ #39);
Count := Count + 1;
{
if rs.fieldbyname('hts<74><73>').asstring<>'' then
begin
str.Add ('53'
+':M' //3 <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD>
+':CA' //4 ʩ<>ӷ<EFBFBD>־<EFBFBD><D6BE>
+':'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //2 <20><>־<EFBFBD><D6BE>
+#39);
Count:=Count+1;
end;
}
rs.Next;
end;
end;
rs.Close;
rs.Destroy;
except
on e: exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
frm_op_seae_edi_data.t_op_seae.Edit;
frm_op_seae_edi_data.t_op_seae.FieldByName('EDI״̬').AsString := '<27>ѷ<EFBFBD><D1B7><EFBFBD>';
frm_op_seae_edi_data.t_op_seae.Post;
end;
str.Add('99:' + inttostr(Count + 2) + #39);
end;
Result := str;
close;
end;
//
function Tfrm_op_seae_edi_custom_hgydt.CreateSIEdiFile_XML: TStrings;
var
str: Tstringlist;
i, j, Count: integer;
strsql, strRmain: string;
rs: Tadoquery;
wide_str: widestring;
k: integer;
inifile1: Tinifile;
strType, XType, TransType: string;
strDatetime, IMO: string;
SenderCode, ReciverCode: string;
alist: TStringList;
begin
if not isEditrue(frm_op_seae_edi_data.t_op_seae) then
begin
Exit;
end;
SenderCode := trim(edit1.Text);
ReciverCode := trim(edit2.Text);
if bsSkinRadioGroup1.ItemIndex = 0 then
strType := '9'
else if bsSkinRadioGroup1.ItemIndex = 1 then
strType := '2'
else if bsSkinRadioGroup1.ItemIndex = 2 then
strType := '3'
else if bsSkinRadioGroup1.ItemIndex = 3 then
strType := '5'
else if bsSkinRadioGroup1.ItemIndex = 4 then
strType := '0'
else if bsSkinRadioGroup1.ItemIndex = 5 then
strType := '11'
else
strType := '9';
if frm_op_seae_edi_data.dxdbgrid1.SelectedCount <= 1 then
begin
str := Tstringlist.Create;
str.Clear;
str.Add('<?xml version="1.0" encoding="UTF-8" standalone="no"?>');
// str.Add('<?xml version="1.0" encoding="utf-8" ?>');
str.Add('<Manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1">');
str.Add('<Head>');
//<!--<2D><><EFBFBD>ı<EFBFBD><C4B1>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<MessageID>' + SenderCode + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + GetDatetime(datetimetostr(now), 4) + '</MessageID>');
//<!--<2D><><EFBFBD>Ĺ<EFBFBD><C4B9>ܴ<EFBFBD><DCB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<FunctionCode>' + strType + '</FunctionCode>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<MessageType>MT2101</MessageType>');
// <!--<2D><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<SenderID>' + SenderCode + '</SenderID>');
//<!--<2D><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ReceiverID>' + ReciverCode + '</ReceiverID>');
//<!--<2D><><EFBFBD><EFBFBD>ʱ<EFBFBD>䣨ѭ<E4A3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>þ<EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ʽΪCCYYMMDDHHmmssfff-->
str.Add('<SendTime>' + GetDatetime(datetimetostr(now), 4) + '</SendTime>');
//<!--<2D><><EFBFBD>İ汾<C4B0>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Version>1.0</Version>');
str.Add('</Head>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD>壨ѭ<E5A3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Declaration>');
// <!--<2D>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<RepresentativePerson>');
// <!--256 Representative person name <20>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Name>' + SenderCode + '</Name>');
str.Add('</RepresentativePerson>');
// <!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD>غ<EFBFBD><D8BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ExitCustomsOffice>');
// <!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD>غ<EFBFBD><D8BA>ش<EFBFBD><D8B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>CNQGD/4218</ID>');
// str.Add('<ID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) + '</ID>');
str.Add('</ExitCustomsOffice>');
// <!--<2D><><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Agent>');
// <!--<2D><><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + SenderCode + '</ID>');
str.Add('</Agent>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Carrier>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>').AsString + '</ID>');
str.Add('</Carrier>');
// <!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<BorderTransportMeans>');
// <!--<2D><><EFBFBD>κ<EFBFBD><CEBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<JourneyID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</JourneyID>');
// <!--<2D><><EFBFBD>ʽ<E4B7BD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeCode>1</TypeCode>');
// <!--<2D><><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>IMO').asstring) + '</ID>');
// <!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Name>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) + '</Name>');
{
// <!--<2D><><EFBFBD><EFBFBD>ߵִ<DFB5><D6B4>ؾ<EFBFBD><D8BE>ڵ<EFBFBD>һ<EFBFBD><D2BB>Ŀ<EFBFBD>ĸ۴<C4B8><DBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<FirstArrivalLocationID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</FirstArrivalLocationID>');
// <!--<2D><><EFBFBD><EFBFBD>ߵִ<DFB5><D6B4>ؾ<EFBFBD><D8BE>ڵ<EFBFBD>һ<EFBFBD><D2BB>Ŀ<EFBFBD>ĸ۵<C4B8><DBB5><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>䣨CCYYMMDDhhmmss<73><73><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ArrivalDateTime>' + GetDatetime(DateToStr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+5), 1) + '086' + '</ArrivalDateTime>');
//<!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>䣨CCYYMMDDhhmmss<73><73><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<DepartureDateTime>' + GetDatetime(DateToStr(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+5),1)+ '086' + '</DepartureDateTime>');
}
str.Add('</BorderTransportMeans>');
//<!--<2D><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1-9999<39><39>-->
str.Add('<Consignment>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TransportContractDocument>');
//<!--<2D><><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + '</ID>');
// <!--<2D><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
if bsSkinRadioGroup1.ItemIndex = 3 then
begin
for i := 0 to bsSkinCheckListBox1.Items.Count - 1 do
begin
if bsSkinCheckListBox1.Checked[i] then
begin
str.Add('<ChangeReasonCode>' + COPY(bsSkinCheckListBox1.Items[i], 1, Pos(':', bsSkinCheckListBox1.Items[i]) - 1) + '</ChangeReasonCode>');
end;
end;
end;
if pos('FREIGHT PREPAID', trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) > 0 then
XType := 'PP'
else if pos('FREIGHT COLLECT', trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) > 0 then
XType := 'CC'
else
XType := 'PP';
if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'CY-CY' then
TransType := '10'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'DOOR-DOOR' then
TransType := '27'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'DOOR-PIER' then
TransType := '28'
else if uppercase(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'PIER-DOOR' then
TransType := '29'
else
TransType := '10'; // PIER TO PIER
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ConditionCode>' + TransType + '</ConditionCode>');
//<!--ƴ<><C6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
{
str.Add('<Consolidator>');
// <!--ƴ<><C6B4><EFBFBD>˴<EFBFBD><CBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1)-->
str.Add('<ID></ID>');
str.Add('</Consolidator>');
}
str.Add('</TransportContractDocument>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
if trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) <> '' then
begin
str.Add('<AssociatedTransportDocument>');
//<!--<2D><><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + '</ID>');
str.Add('</AssociatedTransportDocument>');
end
else
begin
{
str.Add('<AssociatedTransportDocument>');
//<!--<2D><><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID></ID>');
str.Add('</AssociatedTransportDocument>');
}
end;
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<GrossVolumeMeasure>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</GrossVolumeMeasure>');
// <!--CurrencyTypeCode<64><65>ֵ<EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4>룬 ValueAmount<6E><74>ֵ<EFBFBD>ǻ<EFBFBD><C7BB><EFBFBD><EFBFBD><EFBFBD>ֵ <20><>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ValueAmount CurrencyTypeCode="CNY"></ValueAmount>');
// <!--װ<><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<LoadingLocation>');
//<!--װ<><D7B0><EFBFBD>ش<EFBFBD><D8B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) + '</ID>');
str.Add('<ID>CNQGD/4218</ID>');
// <!--<2D><><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B9A4>ʱ<EFBFBD>䣨ѭ<E4A3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<LoadingDate>'+FormatDateTime('yyyymmdd',frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+15) + '120000</LoadingDate>');
// str.Add('<LoadingDate></LoadingDate>');
str.Add('</LoadingLocation>');
// <!--ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<UnloadingLocation>');
// <!--ж<><D0B6><EFBFBD>ش<EFBFBD><D8B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</ID>');
// <!--<2D><><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(CCYYMMDD)<29><>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ArrivalDate></ArrivalDate>');
// str.Add('<ArrivalDate>' + GetDatetime(DateToStr(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+5), 0) + '</ArrivalDate>');
str.Add('</UnloadingLocation>');
// <!--<2D>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<GoodsReceiptPlace>');
// <!--<2D>ջ<EFBFBD><D5BB>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) + '</ID>');
// <!--<2D>ջ<EFBFBD><D5BB>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Name>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) + '</Name>');
str.Add('</GoodsReceiptPlace>');
if trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) <> '' then
begin
str.Add('<GoodsConsignedPlace>');
// <!--<2D>ջ<EFBFBD><D5BB>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>CN37</ID>');
str.Add('</GoodsConsignedPlace>');
end else begin
str.Add('<GoodsConsignedPlace>');
// <!--<2D>ջ<EFBFBD><D5BB>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>CNTAO</ID>');
str.Add('</GoodsConsignedPlace>');
end;
{
// <!--<2D><>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<TranshipmentLocation>');
// <!--<2D><>ת<EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID></ID>);
str.Add('</TranshipmentLocation>')
<!--<2D><>תĿ<D7AA>ĵ<EFBFBD><C4B5><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<TransitDestination>
<!--<2D><>תĿ<D7AA>ĵش<C4B5><D8B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<ID></ID>
</TransitDestination>
<!--;<><CDBE><EFBFBD><EFBFBD><EFBFBD>Ҵ<EFBFBD><D2B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-99<39><39>-->
<RoutingCountryCode></RoutingCountryCode>
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<GoodsConsignedPlace>
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵ĵص<C4B5><D8B5><EFBFBD><EFBFBD>߹<EFBFBD><DFB9>Ҵ<EFBFBD><D2B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<ID></ID>
</GoodsConsignedPlace>
<!--<2D><><EFBFBD><EFBFBD><EFBAA3>״̬<D7B4><CCAC><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-99<39><39>-->
<CustomsStatusCode></CustomsStatusCode>
<!--<2D><><EFBFBD><EFBFBD><EFBFBD>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<TransportSplitIndicator></TransportSplitIndicator>
}
str.Add('<CustomsStatusCode>001</CustomsStatusCode>');
// <!--<2D>˷<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<FreightPayment>');
//<!--<2D>˷<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<MethodCode>' + XType + '</MethodCode>');
str.Add('</FreightPayment>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD>/<2F><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ConsignmentPackaging>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<QuantityQuantity>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</QuantityQuantity>');
// <!--<2D><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<TypeCode>' + trim(GetpkgsEdi(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>װ').asstring)) + '</TypeCode>');
str.Add('</ConsignmentPackaging>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD>أ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TotalGrossMassMeasure>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</TotalGrossMassMeasure>');
{
<!--ǰһ<C7B0><D2BB><EFBFBD>ص<EFBFBD>֤<EFBFBD><D6A4>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<PreviousCustomsDocument>
<!--ǰһ<C7B0><D2BB><EFBFBD>ص<EFBFBD>֤<EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<ID></ID>
<!--ǰһ<C7B0><D2BB><EFBFBD>ص<EFBFBD>֤<EFBFBD><D6A4><EFBFBD>ʹ<EFBFBD><CDB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<TypeCode></TypeCode>
</PreviousCustomsDocument>
<!--<2D><><EFBFBD><EFBFBD><EFBDBB><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<DeliveryDestination>
<!--<2D><><EFBFBD><EFBFBD><EFBDBB>Ŀ<EFBFBD>ĵص<C4B5>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><E4A3A9>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<Line></Line>
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CityName></CityName>
<!--ʡ<>ݴ<EFBFBD><DDB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountrySubEntityID></CountrySubEntityID>
<!--ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountrySubEntityName></CountrySubEntityName>
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<PostcodeID></PostcodeID>
<!--<2D><><EFBFBD>Ҵ<EFBFBD><D2B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountryCode></CountryCode>
</DeliveryDestination>
<!--<2D><>ͷ<EFBFBD><CDB7>ҵ<EFBFBD><D2B5>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<Handling>
<!--<2D><>ͷ<EFBFBD><CDB7>ҵָ<D2B5><D6B8><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<InstructionsCodeCode></InstructionsCodeCode>
</Handling>
<!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<IntermediateCarrier>
<!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD>ʶ<EFBFBD><CAB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<ID></ID>
<!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
<Communication>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<ID></ID>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<TypeID></TypeID>
</Communication>
</IntermediateCarrier>
}
//<!--<2D>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Consignee>');
//<!--<2D>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ID>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString)) + '</ID>');
// str.Add('<ID></ID>');
//<!--<2D>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Name>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</Name>');
//<!--<2D>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ<EFBFBD><D6B7>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Address>');
//<!--<2D><>ϸ<EFBFBD><CFB8>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><E4A3A9>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Line>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ1').AsString)) + '</Line>');
{
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CityName></CityName>
<!--ʡ<>ݴ<EFBFBD><DDB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountrySubEntityID></CountrySubEntityID>
<!--ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountrySubEntityName></CountrySubEntityName>
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<PostcodeID></PostcodeID>
<!--<2D><><EFBFBD>Ҵ<EFBFBD><D2B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountryCode></CountryCode>
}
str.Add('<CountryCode>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)) + '</CountryCode>');
str.Add('</Address>');
if (frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString <> '') or (frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString <> '') then
begin
// <!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
str.Add('<Communication>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
if (frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString <> '') then
begin
str.Add('<ID>' + formatAfrstr(trim(formattel(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString))) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>TE</TypeID>');
end
else
begin
str.Add('<ID>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>EM</TypeID>');
end;
str.Add('</Communication>');
end;
{
<!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
<Communication>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<ID></ID>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<TypeID></TypeID>
</Communication>
<!--<2D>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<Contact>
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<Name></Name>
<Communication>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<ID></ID>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<TypeID></TypeID>
</Communication>
</Contact>
}
str.Add('</Consignee>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Consignor>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ID>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString)) + '</ID>');
// str.Add('<ID></ID>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Name>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</Name>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ<EFBFBD><D6B7>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Address>');
//<!--<2D><>ϸ<EFBFBD><CFB8>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><E4A3A9>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Line>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ1').AsString)) + '</Line>');
{
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CityName></CityName>
<!--ʡ<>ݴ<EFBFBD><DDB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountrySubEntityID></CountrySubEntityID>
<!--ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountrySubEntityName></CountrySubEntityName>
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<PostcodeID></PostcodeID>
<!--<2D><><EFBFBD>Ҵ<EFBFBD><D2B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountryCode></CountryCode>
}
str.Add('<CountryCode>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)) + '</CountryCode>');
str.Add('</Address>');
if (frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString <> '') or (frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString <> '') then
begin
// <!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
str.Add('<Communication>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
if (frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString <> '') then
begin
str.Add('<ID>' + formatAfrstr(trim(formattel(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString))) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>TE</TypeID>');
end
else
begin
str.Add('<ID>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>EM</TypeID>');
end;
str.Add('</Communication>');
end;
{
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
<Communication>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<ID></ID>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<TypeID></TypeID>
</Communication>
}
str.Add('</Consignor>');
//<!--֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<NotifyParty>');
//<!--֪ͨ<CDA8>˴<EFBFBD><CBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ID>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString)) + '</ID>');
// str.Add('<ID></ID>');
//<!--֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Name>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</Name>');
//<!--֪ͨ<CDA8>˵<EFBFBD>ַ<EFBFBD><D6B7>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Address>');
// <!--<2D><>ϸ<EFBFBD><CFB8>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><E4A3A9>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Line>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˵<EFBFBD>ַ1').AsString)) + '</Line>');
{
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CityName></CityName>
<!--ʡ<>ݴ<EFBFBD><DDB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountrySubEntityID></CountrySubEntityID>
<!--ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountrySubEntityName></CountrySubEntityName>
<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<PostcodeID></PostcodeID>
<!--<2D><><EFBFBD>Ҵ<EFBFBD><D2B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<CountryCode></CountryCode>
}
str.Add('<CountryCode>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)) + '</CountryCode>');
str.Add('</Address>');
{
<!--֪ͨ<CDA8><D6AA>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
<Communication>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<ID></ID>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<TypeID></TypeID>
</Communication>
}
if (frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString <> '') or (frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString <> '') then
begin
// <!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
str.Add('<Communication>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
if (frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString <> '') then
begin
str.Add('<ID>' + formatAfrstr(trim(formattel(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString))) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>TE</TypeID>');
end
else
begin
str.Add('<ID>' + formatAfrstr(trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>EM</TypeID>');
end;
str.Add('</Communication>');
end;
str.Add('</NotifyParty>');
{
<!--Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
<UNDGContact>
<!--Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>-->
<Name></Name>
<!--Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
<Communication>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<ID></ID>
<!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
<TypeID></TypeID>
</Communication>
</UNDGContact>
}
strsql := 'select * from t_op_ctn_edi ' + 'WHERE <20><><EFBFBD><EFBFBD>=' + #39 + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring + #39;
try
rs := CreateAdoQuery;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
rs.First;
if not rs.IsEmpty then
begin
rs.First;
while not rs.Eof do
begin
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-9999<39><39>-->
str.Add('<TransportEquipment>');
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1)-->
str.Add('<EquipmentIdentification>');
// <!-- <20><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring + '</ID>');
str.Add('</EquipmentIdentification>');
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<CharacteristicCode>' + GetCtnCode(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring, rs.fieldbyname('<27>ߴ<EFBFBD>').asstring) + '</CharacteristicCode>');
//<!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<SupplierPartyTypeCode>2</SupplierPartyTypeCode>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><DFBF><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
if rs.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־').AsString='<27><><EFBFBD><EFBFBD>' then str.Add('<FullnessCode>5</FullnessCode>')
else str.Add('<FullnessCode>8</FullnessCode>');
// <!--SealID<49><44>ֵ<EFBFBD>Ƿ<EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>,AgencyCode<64><65>ֵ<EFBFBD><D6B5>ʩ<EFBFBD>ӷ<EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-9<><39>-->
if trim(rs.fieldbyname('ʩ<><CAA9><EFBFBD><EFBFBD>').asstring) = '' then
begin
str.Add('<SealID AgencyCode="CA">M/' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</SealID>');
end
else
begin
str.Add('<SealID AgencyCode="' + trim(rs.fieldbyname('ʩ<><CAA9><EFBFBD><EFBFBD>').asstring) + '">M/' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</SealID>');
end;
str.Add('</TransportEquipment>');
rs.Next;
end;
end;
rs.Close;
rs.Destroy;
except
on e: exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
k := 1;
alist := TStringList.Create;
strsql := 'select * from t_op_ctn_edi ' + 'WHERE <20><><EFBFBD><EFBFBD>=' + #39 + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring + #39;
try
rs := CreateAdoQuery;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
rs.First;
if not rs.IsEmpty then
begin
rs.First;
while not rs.Eof do
begin
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1-999<39><39>-->
str.Add('<ConsignmentItem>');
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<SequenceNumeric>' + inttostr(k) + '</SequenceNumeric>');
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>װ<EFBFBD><D7B0>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ConsignmentItemPackaging>');
// <!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<QuantityQuantity>' + trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger)) + '</QuantityQuantity>');
// <!--<2D><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<TypeCode>' + trim(GetpkgsEdi(rs.fieldbyname('<27><>װ').asstring)) + '</TypeCode>');
alist.text := '';
if trim(rs.fieldbyname('<27><>ͷ').asstring) <> '' then
alist.text := trim(rs.fieldbyname('<27><>ͷ').asstring)
else
alist.text := trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><>ͷ').asstring);
// <!--<2D><>ͷ<EFBFBD><CDB7>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<MarksNumbers>' + formatAfrstr(alist.text) + '</MarksNumbers>');
str.Add('</ConsignmentItemPackaging>');
alist.text := '';
if trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) <> '' then
alist.text := trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
else
alist.text := trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Commodity>');
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<CargoDescription>' + formatAfrstr(alist.text) + '</CargoDescription>');
//<!--Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
if trim(frm_op_seae_edi_data.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'D' then
begin
str.Add('<UNDGCode>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) + '</UNDGCode>');
end;
//<!--<2D><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
if trim(rs.fieldbyname('HTS<54><53>').asstring) <> '' then
str.Add('<TariffClassificationCode>' + rs.fieldbyname('HTS<54><53>').asstring + '</TariffClassificationCode>')
else
begin
if trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ʽ').asstring) <> '' then
str.Add('<TariffClassificationCode>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD>ʽ').asstring) + '</TariffClassificationCode>');
end;
str.Add('</Commodity>');
//<!--<2D><>Ʒ<EFBFBD><EFBFBD><EEB2B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
{
str.Add('<AdditionalInformation>');
// <!--<2D><>ע<EFBFBD><D7A2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Content></Content>');
str.Add('</AdditionalInformation>');
}
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD>أ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<GoodsMeasure>');
// <!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD>أ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<GrossMassMeasure>' + trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) + '</GrossMassMeasure>');
str.Add('</GoodsMeasure>');
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-9999<39><39>-->
str.Add('<EquipmentIdentification>');
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</ID>');
str.Add('</EquipmentIdentification>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
{
str.Add('<CustomsProcedure>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<CurrentCode></CurrentCode>');
str.Add('</CustomsProcedure>');
}
{
//<!--Ψһ<CEA8><D2BB><EFBFBD>˱<EFBFBD><CBB1>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-99<39><39>-->
str.Add('<UCR>');
//<!--Ψһ<CEA8><D2BB><EFBFBD>˱<EFBFBD><CBB1>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID></ID>');
str.Add('</UCR>');
}
//<!--ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
{
str.Add('<Origin>');
//<!--ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<OriginCountryCode></OriginCountryCode>');
str.Add('</Origin>');
}
str.Add('</ConsignmentItem>');
k := k + 1;
rs.Next;
end;
end;
rs.Close;
rs.Destroy;
alist.Free;
except
on e: exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
str.Add('</Consignment>');
//<!--<2D><>ע<EFBFBD><D7A2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
{
str.Add('<AdditionalInformation>');
//<!--<2D><>ע<EFBFBD><D7A2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Content></Content>');
str.Add('</AdditionalInformation>');
}
str.Add('</Declaration>');
str.Add('</Manifest>');
frm_op_seae_edi_data.t_op_seae.Edit;
frm_op_seae_edi_data.t_op_seae.FieldByName('EDI״̬').AsString := '<27>ѷ<EFBFBD><D1B7><EFBFBD>';
frm_op_seae_edi_data.t_op_seae.Post;
end;
Result := str;
end;
//2018-8-2 <20><><EFBFBD><EFBFBD>֧<EFBFBD>ֶ<EFBFBD>Ʊҵ<C6B1><D2B5>
function Tfrm_op_seae_edi_custom_hgydt.CreateSIEdiFile_XML_Multi: TStrings;
var
str: Tstringlist;
i, j, Count: integer;
strsql, strRmain: string;
rs: Tadoquery;
wide_str: widestring;
k: integer;
inifile1: Tinifile;
strType, XType, TransType: string;
strDatetime, IMO: string;
SenderCode, ReciverCode: string;
alist: TStringList;
datacount, tmpint: Integer;
aQuery: TADOQuery;
bsnostr: WideString;
begin
//<2F>򿪶<EFBFBD>Ʊҵ<C6B1><D2B5>
for i := 0 to frm_op_seae_edi_data.dxDBGrid1.SelectedCount - 1 do
begin
frm_op_seae_edi_data.t_op_seae.GotoBookmark(pointer(frm_op_seae_edi_data.dxDBGrid1.selectedrows[i]));
if bsnostr = '' then
bsnostr := '''' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString + ''''
else
bsnostr := bsnostr + ',' + '''' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString + '''';
end;
aQuery := CreateAdoQuery;
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('select * from t_op_seae_edi where <20><><EFBFBD><EFBFBD> in (' + bsnostr + ')');
Open;
end;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊҵ<C6B1><D2B5><EFBFBD>Ƿ<EFBFBD><C7B7>Ϸ<EFBFBD>
if not isEditrue_Multi(aQuery) then
begin
Exit;
end;
SenderCode := trim(edit1.Text);
ReciverCode := trim(edit2.Text);
if bsSkinRadioGroup1.ItemIndex = 0 then
strType := '9'
else if bsSkinRadioGroup1.ItemIndex = 1 then
strType := '2'
else if bsSkinRadioGroup1.ItemIndex = 2 then
strType := '3'
else if bsSkinRadioGroup1.ItemIndex = 3 then
strType := '5'
else if bsSkinRadioGroup1.ItemIndex = 4 then
strType := '0'
else if bsSkinRadioGroup1.ItemIndex = 5 then
strType := '11'
else
strType := '9';
str := Tstringlist.Create;
str.Clear;
str.Add('<?xml version="1.0" encoding="gb2312" ?>');
// str.Add('<?xml version="1.0" encoding="UTF-8" standalone="no"?>');
str.Add('<Manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1">');
str.Add('<Head>');
//<!--<2D><><EFBFBD>ı<EFBFBD><C4B1>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<MessageID>' + SenderCode + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + GetDatetime(datetimetostr(now), 4) + '</MessageID>');
//<!--<2D><><EFBFBD>Ĺ<EFBFBD><C4B9>ܴ<EFBFBD><DCB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<FunctionCode>' + strType + '</FunctionCode>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<MessageType>MT2101</MessageType>');
// <!--<2D><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<SenderID>' + SenderCode + '</SenderID>');
//<!--<2D><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ReceiverID>' + ReciverCode + '</ReceiverID>');
//<!--<2D><><EFBFBD><EFBFBD>ʱ<EFBFBD>䣨ѭ<E4A3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>þ<EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ʽΪCCYYMMDDHHmmssfff-->
str.Add('<SendTime>' + GetDatetime(datetimetostr(now), 4) + '</SendTime>');
//<!--<2D><><EFBFBD>İ汾<C4B0>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Version>1.0</Version>');
str.Add('</Head>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD>壨ѭ<E5A3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Declaration>');
// <!--<2D>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<RepresentativePerson>');
// <!--256 Representative person name <20>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Name>' + ReciverCode + '</Name>');
str.Add('</RepresentativePerson>');
// <!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD>غ<EFBFBD><D8BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ExitCustomsOffice>');
// <!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD>غ<EFBFBD><D8BA>ش<EFBFBD><D8B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>CNQGD/4218</ID>');
str.Add('</ExitCustomsOffice>');
// <!--<2D><><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Agent>');
// <!--<2D><><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + SenderCode + '</ID>');
str.Add('</Agent>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Carrier>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + SenderCode+ '</ID>');
str.Add('</Carrier>');
// <!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<BorderTransportMeans>');
// <!--<2D><><EFBFBD>κ<EFBFBD><CEBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<JourneyID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</JourneyID>');
// <!--<2D><><EFBFBD>ʽ<E4B7BD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeCode>1</TypeCode>');
// <!--<2D><><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>IMO').asstring) + '</ID>');
// <!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Name>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) + '</Name>');
{
// <!--<2D><><EFBFBD><EFBFBD>ߵִ<DFB5><D6B4>ؾ<EFBFBD><D8BE>ڵ<EFBFBD>һ<EFBFBD><D2BB>Ŀ<EFBFBD>ĸ۴<C4B8><DBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<FirstArrivalLocationID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</FirstArrivalLocationID>');
// <!--<2D><><EFBFBD><EFBFBD>ߵִ<DFB5><D6B4>ؾ<EFBFBD><D8BE>ڵ<EFBFBD>һ<EFBFBD><D2BB>Ŀ<EFBFBD>ĸ۵<C4B8><DBB5><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>䣨CCYYMMDDhhmmss<73><73><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ArrivalDateTime>' + GetDatetime(DateToStr(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+5), 1) + '086' + '</ArrivalDateTime>');
//<!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>ʱ<EFBFBD>䣨CCYYMMDDhhmmss<73><73><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<DepartureDateTime>' + GetDatetime(DateToStr(frm_op_seae_edi_data.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+5), 1) + '086' + '</DepartureDateTime>');
}
str.Add('</BorderTransportMeans>');
//<2F>˴<EFBFBD><CBB4><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>Ӷ<EFBFBD>Ʊҵ<C6B1><D2B5>
aQuery.First;
while not aQuery.Eof do
begin
//<!--<2D><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1-9999<39><39>-->
str.Add('<Consignment>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TransportContractDocument>');
//<!--<2D><><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + '</ID>');
// <!--<2D><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
if bsSkinRadioGroup1.ItemIndex = 3 then
begin
for i := 0 to bsSkinCheckListBox1.Items.Count - 1 do
begin
if bsSkinCheckListBox1.Checked[i] then
begin
str.Add('<ChangeReasonCode>' + COPY(bsSkinCheckListBox1.Items[i], 1, Pos(':', bsSkinCheckListBox1.Items[i]) - 1) + '</ChangeReasonCode>');
end;
end;
end;
if pos('FREIGHT PREPAID', trim(aQuery.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) > 0 then
XType := 'PP'
else if pos('FREIGHT COLLECT', trim(aQuery.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)) > 0 then
XType := 'CC'
else
XType := 'PP';
if uppercase(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'CY-CY' then
TransType := '10'
else if uppercase(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'DOOR-DOOR' then
TransType := '27'
else if uppercase(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'DOOR-PIER' then
TransType := '28'
else if uppercase(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) = 'PIER-DOOR' then
TransType := '29'
else
TransType := '10'; // PIER TO PIER
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ConditionCode>' + TransType + '</ConditionCode>');
str.Add('</TransportContractDocument>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
if trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) <> '' then
begin
str.Add('<AssociatedTransportDocument>');
//<!--<2D><><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + '</ID>');
str.Add('</AssociatedTransportDocument>');
end;
{
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<GrossVolumeMeasure>' + trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</GrossVolumeMeasure>');
}
// <!--װ<><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<LoadingLocation>');
//<!--װ<><D7B0><EFBFBD>ش<EFBFBD><D8B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>CNQGD/4218</ID>');
// <!--<2D><><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B9A4>ʱ<EFBFBD>䣨ѭ<E4A3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<LoadingDate>' + GetDatetime(DateToStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+5), 1) + '086' + '</LoadingDate>');
str.Add('<LoadingDate>'+FormatDateTime('yyyymmdd',aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+15) + '120000</LoadingDate>');
str.Add('</LoadingLocation>');
// <!--ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<UnloadingLocation>');
// <!--ж<><D0B6><EFBFBD>ش<EFBFBD><D8B4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(aQuery.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</ID>');
// <!--<2D><><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(CCYYMMDD)<29><>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ArrivalDate>' + GetDatetime(DateToStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime+10), 0) + '</ArrivalDate>');
// str.Add('<ArrivalDate></ArrivalDate>');
str.Add('</UnloadingLocation>');
// <!--<2D>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<GoodsReceiptPlace>');
// <!--<2D>ջ<EFBFBD><D5BB>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>' + trim(aQuery.fieldbyname('Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>').asstring) + '</ID>');
// <!--<2D>ջ<EFBFBD><D5BB>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Name>' + trim(aQuery.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) + '</Name>');
str.Add('</GoodsReceiptPlace>');
if trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) <> '' then
begin
str.Add('<GoodsConsignedPlace>');
// <!--<2D>ջ<EFBFBD><D5BB>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>CN37</ID>');
str.Add('</GoodsConsignedPlace>');
end else begin
str.Add('<GoodsConsignedPlace>');
// <!--<2D>ջ<EFBFBD><D5BB>ص<EFBFBD><D8B5><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>CNTAO</ID>');
str.Add('</GoodsConsignedPlace>');
end;
str.Add('<CustomsStatusCode>001</CustomsStatusCode>');
// <!--<2D>˷<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<FreightPayment>');
//<!--<2D>˷<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<MethodCode>' + XType + '</MethodCode>');
str.Add('</FreightPayment>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD>/<2F><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ConsignmentPackaging>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<QuantityQuantity>' + trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</QuantityQuantity>');
// <!--<2D><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<TypeCode>' + trim(GetpkgsEdi(aQuery.fieldbyname('<27><>װ').asstring)) + '</TypeCode>');
str.Add('</ConsignmentPackaging>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD>أ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TotalGrossMassMeasure>' + trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</TotalGrossMassMeasure>');
//<!--<2D>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Consignee>');
//<!--<2D>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ID></ID>');
//<!--<2D>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Name>' + formatAfrstr(trim(aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</Name>');
//<!--<2D>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ<EFBFBD><D6B7>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Address>');
//<!--<2D><>ϸ<EFBFBD><CFB8>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><E4A3A9>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Line>' + formatAfrstr(trim(aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˵<EFBFBD>ַ1').AsString)) + '</Line>');
str.Add('<CountryCode>' + formatAfrstr(trim(aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)) + '</CountryCode>');
str.Add('</Address>');
if (aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString <> '') or (aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString <> '') then
begin
// <!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
str.Add('<Communication>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
if (aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString <> '') then
begin
str.Add('<ID>' + formatAfrstr(trim(formattel(aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˵绰').AsString))) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>TE</TypeID>');
end
else
begin
str.Add('<ID>' + formatAfrstr(trim(aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>EM</TypeID>');
end;
str.Add('</Communication>');
end;
str.Add('</Consignee>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Consignor>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ID></ID>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Name>' + formatAfrstr(trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</Name>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ<EFBFBD><D6B7>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Address>');
//<!--<2D><>ϸ<EFBFBD><CFB8>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><E4A3A9>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Line>' + formatAfrstr(trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>ַ1').AsString)) + '</Line>');
str.Add('<CountryCode>' + formatAfrstr(trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)) + '</CountryCode>');
str.Add('</Address>');
if (aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString <> '') or (aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString <> '') then
begin
// <!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
str.Add('<Communication>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
if (aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString <> '') then
begin
str.Add('<ID>' + formatAfrstr(trim(formattel(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵绰').AsString))) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>TE</TypeID>');
end
else
begin
str.Add('<ID>' + formatAfrstr(trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>EM</TypeID>');
end;
str.Add('</Communication>');
end;
str.Add('</Consignor>');
//<!--֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<NotifyParty>');
//<!--֪ͨ<CDA8>˴<EFBFBD><CBB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
// str.Add('<ID></ID>');
//<!--֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Name>' + formatAfrstr(trim(aQuery.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</Name>');
//<!--֪ͨ<CDA8>˵<EFBFBD>ַ<EFBFBD><D6B7>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<Address>');
// <!--<2D><>ϸ<EFBFBD><CFB8>ַ<EFBFBD><D6B7><EFBFBD>ֵ<EFBFBD>,<2C><><EFBFBD><EFBFBD><E4A3A9>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Line>' + formatAfrstr(trim(aQuery.fieldbyname('֪ͨ<CDA8>˵<EFBFBD>ַ1').AsString)) + '</Line>');
str.Add('<CountryCode>' + formatAfrstr(trim(aQuery.fieldbyname('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString)) + '</CountryCode>');
str.Add('</Address>');
if (aQuery.fieldbyname('֪ͨ<CDA8>˵绰').AsString <> '') or (aQuery.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString <> '') then
begin
// <!--<2D>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-3<><33>-->
str.Add('<Communication>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
if (aQuery.fieldbyname('֪ͨ<CDA8>˵绰').AsString <> '') then
begin
str.Add('<ID>' + formatAfrstr(trim(formattel(aQuery.fieldbyname('֪ͨ<CDA8>˵绰').AsString))) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>TE</TypeID>');
end
else
begin
str.Add('<ID>' + formatAfrstr(trim(aQuery.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>EM</TypeID>');
end;
str.Add('</Communication>');
end;
str.Add('</NotifyParty>');
if trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'D' then
begin
str.Add('<UNDGContact>');
str.Add('<Name>' + formatAfrstr(trim(formattel(aQuery.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7>ϵ<EFBFBD><CFB5>').AsString))) + '</Name>');
str.Add('<Communication>');
str.Add('<ID>' + formatAfrstr(trim(aQuery.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD>绰').AsString)) + '</ID>');
// <!--ͨѶ<CDA8><D1B6>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TypeID>TE</TypeID>');
str.Add('</Communication>');
str.Add('</UNDGContact>');
END;
strsql := 'select * from t_op_ctn_edi ' + 'WHERE <20><><EFBFBD><EFBFBD>=' + #39 + aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring + #39;
try
rs := CreateAdoQuery;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
rs.First;
if not rs.IsEmpty then
begin
rs.First;
while not rs.Eof do
begin
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-9999<39><39>-->
str.Add('<TransportEquipment>');
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1)-->
str.Add('<EquipmentIdentification>');
// <!-- <20><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring + '</ID>');
str.Add('</EquipmentIdentification>');
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<CharacteristicCode>' + GetCtnCode(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring, rs.fieldbyname('<27>ߴ<EFBFBD>').asstring) + '</CharacteristicCode>');
//<!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<SupplierPartyTypeCode>2</SupplierPartyTypeCode>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD><DFBF><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
if rs.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־').AsString='<27><><EFBFBD><EFBFBD>' then str.Add('<FullnessCode>5</FullnessCode>')
else str.Add('<FullnessCode>8</FullnessCode>');
// <!--SealID<49><44>ֵ<EFBFBD>Ƿ<EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>,AgencyCode<64><65>ֵ<EFBFBD><D6B5>ʩ<EFBFBD>ӷ<EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-9<><39>-->
if trim(rs.fieldbyname('ʩ<><CAA9><EFBFBD><EFBFBD>').asstring) = '' then
begin
str.Add('<SealID AgencyCode="CA">M/' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</SealID>');
end
else
begin
str.Add('<SealID AgencyCode="' + trim(rs.fieldbyname('ʩ<><CAA9><EFBFBD><EFBFBD>').asstring) + '">M/' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</SealID>');
end;
str.Add('</TransportEquipment>');
rs.Next;
end;
end;
rs.Close;
rs.Destroy;
except
on e: exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
k := 1;
alist := TStringList.Create;
strsql := 'select * from t_op_ctn_edi ' + 'WHERE <20><><EFBFBD><EFBFBD>=' + #39 + aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring + #39;
try
rs := CreateAdoQuery;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
rs.First;
if not rs.IsEmpty then
begin
rs.First;
while not rs.Eof do
begin
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1-999<39><39>-->
str.Add('<ConsignmentItem>');
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<SequenceNumeric>' + inttostr(k) + '</SequenceNumeric>');
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>װ<EFBFBD><D7B0>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ConsignmentItemPackaging>');
// <!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<QuantityQuantity>' + trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger)) + '</QuantityQuantity>');
// <!--<2D><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<TypeCode>' + trim(GetpkgsEdi(rs.fieldbyname('<27><>װ').asstring)) + '</TypeCode>');
alist.text := '';
if trim(rs.fieldbyname('<27><>ͷ').asstring) <> '' then
alist.text := trim(rs.fieldbyname('<27><>ͷ').asstring)
else
alist.text := trim(aQuery.fieldbyname('<27><>ͷ').asstring);
// <!--<2D><>ͷ<EFBFBD><CDB7>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<MarksNumbers>' + formatAfrstr(alist.text) + '</MarksNumbers>');
str.Add('</ConsignmentItemPackaging>');
alist.text := '';
if trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) <> '' then
alist.text := trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
else
alist.text := trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Commodity>');
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<CargoDescription>' + formatAfrstr(alist.text) + '</CargoDescription>');
//<!--Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
if trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) = 'D' then
begin
str.Add('<UNDGCode>' + trim(aQuery.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) + '</UNDGCode>');
end;
//<!--<2D><><EFBFBD><EFBFBD>˰<EFBFBD><CBB0><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
if trim(rs.fieldbyname('HTS<54><53>').asstring) <> '' then
str.Add('<TariffClassificationCode>' + rs.fieldbyname('HTS<54><53>').asstring + '</TariffClassificationCode>')
else
begin
if trim(aQuery.fieldbyname('<27><><EFBFBD>ʽ').asstring) <> '' then
str.Add('<TariffClassificationCode>' + trim(aQuery.fieldbyname('<27><><EFBFBD>ʽ').asstring) + '</TariffClassificationCode>');
end;
str.Add('</Commodity>');
//<!--<2D><>Ʒ<EFBFBD><EFBFBD><EEB2B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
{
str.Add('<AdditionalInformation>');
// <!--<2D><>ע<EFBFBD><D7A2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Content></Content>');
str.Add('</AdditionalInformation>');
}
//<!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD>أ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<GoodsMeasure>');
// <!--<2D><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD>أ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<GrossMassMeasure>' + trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) + '</GrossMassMeasure>');
str.Add('</GoodsMeasure>');
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-9999<39><39>-->
str.Add('<EquipmentIdentification>');
// <!--<2D><>װ<EFBFBD><EFBFBD><E4A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</ID>');
str.Add('</EquipmentIdentification>');
str.Add('</ConsignmentItem>');
k := k + 1;
rs.Next;
end;
end;
rs.Close;
rs.Destroy;
alist.Free;
except
on e: exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
str.Add('</Consignment>');
aQuery.Next;
end;
//<!--<2D><>ע<EFBFBD><D7A2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
{
str.Add('<AdditionalInformation>');
//<!--<2D><>ע<EFBFBD><D7A2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Content></Content>');
str.Add('</AdditionalInformation>');
}
str.Add('</Declaration>');
str.Add('</Manifest>');
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('update t_op_seae_edi set EDI״̬=''<27>ѷ<EFBFBD><D1B7><EFBFBD>'' where <20><><EFBFBD><EFBFBD> in ('+bsnostr+')');
ExecSQL;
end;
FreeAndNil(aQuery);
{ frm_op_seae_edi_data.t_op_seae.Edit;
frm_op_seae_edi_data.t_op_seae.FieldByName('EDI״̬').AsString := '<27>ѷ<EFBFBD><D1B7><EFBFBD>';
frm_op_seae_edi_data.t_op_seae.Post;
}
Result := str;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetCntrEdi(cntrsize: string): string;
var
aQuery: TADOQuery;
SL:TStringList;
begin
aQuery := CreateAdoQuery;
try
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('Select Edi<64><69><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>=''' + cntrsize + '''');
Open;
if IsEmpty then
Result := ''
else
Result := FieldByName('Edi<64><69><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetpkgsEdi(pkgs: string): string;
var
aQuery: TADOQuery;
begin
aQuery := CreateAdoQuery;
try
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('Select Edi<64><69><EFBFBD><EFBFBD> from t_code_package where <20><><EFBFBD><EFBFBD>=''' + pkgs + '''');
Open;
if IsEmpty then
Result := ''
else
Result := FieldByName('Edi<64><69><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetlineEdi(aline: string): string;
var
aQuery: TADOQuery;
begin
aQuery := CreateAdoQuery;
try
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('Select Edi<64><69><EFBFBD><EFBFBD> from t_code_trade where <20><><EFBFBD><EFBFBD>=''' + aline + '''');
Open;
if IsEmpty then
Result := ''
else
Result := FieldByName('Edi<64><69><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_custom_hgydt.GetvesselEdi(avessel: string): string;
var
aQuery: TADOQuery;
begin
aQuery := CreateAdoQuery;
try
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_code_vessel where Ӣ<>Ĵ<EFBFBD><C4B4><EFBFBD>=''' + avessel + '''');
Open;
if IsEmpty then
Result := ''
else
Result := FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_op_seae_edi_custom_hgydt.bsSkinButton4Click(Sender: TObject);
begin
if frm_op_seae_edi_custom_hgydt.Height = 349 then
frm_op_seae_edi_custom_hgydt.Height := 200
else
begin
frm_op_seae_edi_custom_hgydt.Height := 349;
bsSkinCheckListBox1.Visible := False;
bsSkinGroupBox1.Visible := True;
end;
end;
procedure Tfrm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1Click(Sender: TObject);
begin
if bsSkinRadioGroup1.ItemIndex = 3 then
begin
frm_op_seae_edi_custom_hgydt.Height := 550;
bsSkinCheckListBox1.Visible := True;
bsSkinGroupBox1.Visible := False;
Memo2.Visible:=false;
Label17.Visible:=false;
Memo1.Visible:=false;
Label16.Visible:=false;
end
else if bsSkinRadioGroup1.ItemIndex = 2 then
begin
frm_op_seae_edi_custom_hgydt.Height := 350;
bsSkinCheckListBox1.Visible := False;
bsSkinGroupBox1.Visible := False;
Memo2.Visible:=True;
Label17.Visible:=True;
Memo1.Visible:=false;
Label16.Visible:=false;
end
else begin
frm_op_seae_edi_custom_hgydt.Height := 350;
bsSkinCheckListBox1.Visible := False;
Memo2.Visible:=false;
Label17.Visible:=false;
Memo1.Visible:=True;
Label16.Visible:=True;
end;
end;
procedure Tfrm_op_seae_edi_custom_hgydt.getwebservice_ds;
begin
try
mHttpRIO_ds := THTTPRIO.Create(nil);
mHttpRIO_ds.WSDLLocation := 'http://221.3.83.5:8090/webservice/DsWebService.asmx?WSDL';
mHttpRIO_ds.URL := 'http://221.3.83.5:8090/webservice/DsWebService.asmx';
mHttpRIO_ds.Port := 'DsWebServiceSoap';
mHttpRIO_ds.Service := 'DsWebService';
mHttpRIO_ds.HTTPWebNode.UseUTF8InHeader := true;
mServiceSoap_Ds := mHttpRIO_ds as DsWebServiceSoap;
InvRegistry.RegisterInvokeOptions(TypeInfo(DsWebServiceSoap), ioDocument); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
except
on E: Exception do
begin
ShowMessage(e.Message);
exit;
end;
end;
end;
procedure Tfrm_op_seae_edi_custom_hgydt.bsSkinButton5Click(Sender: TObject);
var
MultiPartFormDataStream: TIdMultiPartFormDataStream;
Str: TStrings;
inifile1: Tinifile;
i: integer;
numunzipped: integer;
fileType,ScriptPath,mblno: string;
str_file:widestring;
IdHTTP1:TIdHTTP;
begin
if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 0 then
fileType := '-9'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 1 then
fileType := '-2'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 2 then
fileType := '-3'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 3 then
fileType := '-5'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 4 then
fileType := '-0'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 5 then
fileType := '-11'
else
fileType := '-9';
inifile1 := Tinifile.Create(ExtractFilePath(application.ExeName) + 'main.ini');
inifile1.WriteString('customHGYDT', 'SEND', frm_op_seae_edi_custom_hgydt.edit1.text);
inifile1.WriteString('customHGYDT', 'RECIEVE', frm_op_seae_edi_custom_hgydt.edit2.text);
inifile1.WriteString('customHGYDT', 'SENDNAME', frm_op_seae_edi_custom_hgydt.edit3.text);
inifile1.WriteString('customHGYDT', 'FTPSERVER', frm_op_seae_edi_custom_hgydt.edit4.text);
inifile1.WriteString('customHGYDT', 'FTPPATH', frm_op_seae_edi_custom_hgydt.edit5.text);
inifile1.WriteString('customHGYDT', 'FTPNAME', frm_op_seae_edi_custom_hgydt.edit6.text);
inifile1.WriteString('customHGYDT', 'FTPPASS', frm_op_seae_edi_custom_hgydt.edit7.text);
inifile1.WriteString('customHGYDT', 'SENDDEPT', frm_op_seae_edi_custom_hgydt.edit8.text);
inifile1.WriteString('customHGYDT', 'SENDATTN', frm_op_seae_edi_custom_hgydt.edit9.text);
inifile1.WriteString('customHGYDT', 'SENDTEL', frm_op_seae_edi_custom_hgydt.edit10.text);
inifile1.WriteString('customHGYDT', 'SENDFAX', frm_op_seae_edi_custom_hgydt.edit11.text);
inifile1.WriteString('customHGYDT', 'SENDEMAIL', frm_op_seae_edi_custom_hgydt.edit12.text);
inifile1.WriteString('customHGYDT', 'SENDFILETYPE', frm_op_seae_edi_custom_hgydt.ComboBox1.text);
inifile1.WriteString('customHGYDT','ESINAME',frm_op_seae_edi_custom_hgydt.edit13.text);
inifile1.WriteString('customHGYDT','ESIPASS',frm_op_seae_edi_custom_hgydt.edit14.text);
Memo1.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+'CNTRSTR.txt');
inifile1.free;
Str := Tstringlist.Create;
try
if (frm_op_seae_edi_custom_hgydt.ComboBox1.Text = '') or (frm_op_seae_edi_custom_hgydt.ComboBox1.Text = 'txt') then
Str := frm_op_seae_edi_custom_hgydt.CreateSIEdiFile_MBL
else
begin
if frm_op_seae_edi_custom_hgydt.bsSkinCheckRadioBox2.Checked then Str := frm_op_seae_edi_custom_hgydt.CreateSIEdiFile_XML_Multi
else Str := frm_op_seae_edi_custom_hgydt.CreateSIEdiFile_xml;
end;
for i := 0 to Str.Count - 1 do
begin
if frm_op_seae_edi_custom_hgydt.IsZhongwen(Str[i]) then
begin
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>', mtWarning, [mbYes, mbNo], 0) = mrNo then
exit;
end;
end;
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
if (frm_op_seae_edi_custom_hgydt.ComboBox1.Text = '') or (frm_op_seae_edi_custom_hgydt.ComboBox1.Text = 'txt') then begin
str_file:=ScriptPath
+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+ fileType+'.txt';
Str.SaveToFile(str_file);
end else begin
str_file:=ScriptPath
+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+ fileType+'.xml';
if (fileType='-3') then begin
SaveUTF8File(Str.Text,str_file);
end else begin
Str.SaveToFile(str_file);
end;
// Str.SaveToFile(str_file);
end;
mblno:=frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'(һ<><D2BB>ͨ)';
TDsThread.create(str_file,'WLXXDR','',frm_op_seae_edi_custom_hgydt.Edit13.Text,frm_op_seae_edi_custom_hgydt.Edit14.Text);
// TMyThread.create(str_file,'text/xml','WLXXDR',frm_op_seae_edi_custom_hgydt.Edit14.Text,mblno,'dzka');
{
MultiPartFormDataStream := TIdMultiPartFormDataStream.Create;
IdHTTP1:=TIdHTTP.Create(Application);
mblno:= frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
try
IdHttp1.Request.Accept := '*/*';
IdHttp1.Request.AcceptLanguage:='zh-CN';
IdHttp1.Request.ContentType := MultiPartFormDataStream.RequestContentType;
MultiPartFormDataStream.AddFormField('username',frm_op_seae_edi_custom_hgydt.Edit13.Text);
MultiPartFormDataStream.AddFormField('password',frm_op_seae_edi_custom_hgydt.Edit14.Text);
MultiPartFormDataStream.AddFormField('action','dzka');
MultiPartFormDataStream.AddFormField('encode','1');
MultiPartFormDataStream.AddFile('filename',str_file,'text/xml');
MultiPartFormDataStream.Position := 0;
ShowMessage(mblno+'---'+UnicodeToChinese(IdHTTP1.Post('http://47.94.19.3:8111/cdpost.ashx', MultiPartFormDataStream)));
finally
MultiPartFormDataStream.Free;
FreeAndNil(IdHTTP1);
end;
}
finally
FreeAndNil(Str)
end;
close;
end;
procedure Tfrm_op_seae_edi_custom_hgydt.bsSkinButton3Click(
Sender: TObject);
//function PlateThreadFun(p: Pointer): Integer; stdcall;
var
MultiPartFormDataStream: TIdMultiPartFormDataStream;
Str: TStrings;
inifile1: Tinifile;
i: integer;
numunzipped: integer;
fileType,ScriptPath,mblno: string;
str_file:widestring;
IdHTTP1:TIdHTTP;
begin
if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 0 then
fileType := '-9'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 1 then
fileType := '-2'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 2 then
fileType := '-3'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 3 then
fileType := '-5'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 4 then
fileType := '-0'
else if frm_op_seae_edi_custom_hgydt.bsSkinRadioGroup1.ItemIndex = 5 then
fileType := '-11'
else
fileType := '-9';
inifile1 := Tinifile.Create(ExtractFilePath(application.ExeName) + 'main.ini');
inifile1.WriteString('customHGYDT', 'SEND', frm_op_seae_edi_custom_hgydt.edit1.text);
inifile1.WriteString('customHGYDT', 'RECIEVE', frm_op_seae_edi_custom_hgydt.edit2.text);
inifile1.WriteString('customHGYDT', 'SENDNAME', frm_op_seae_edi_custom_hgydt.edit3.text);
inifile1.WriteString('customHGYDT', 'FTPSERVER', frm_op_seae_edi_custom_hgydt.edit4.text);
inifile1.WriteString('customHGYDT', 'FTPPATH', frm_op_seae_edi_custom_hgydt.edit5.text);
inifile1.WriteString('customHGYDT', 'FTPNAME', frm_op_seae_edi_custom_hgydt.edit6.text);
inifile1.WriteString('customHGYDT', 'FTPPASS', frm_op_seae_edi_custom_hgydt.edit7.text);
inifile1.WriteString('customHGYDT', 'SENDDEPT', frm_op_seae_edi_custom_hgydt.edit8.text);
inifile1.WriteString('customHGYDT', 'SENDATTN', frm_op_seae_edi_custom_hgydt.edit9.text);
inifile1.WriteString('customHGYDT', 'SENDTEL', frm_op_seae_edi_custom_hgydt.edit10.text);
inifile1.WriteString('customHGYDT', 'SENDFAX', frm_op_seae_edi_custom_hgydt.edit11.text);
inifile1.WriteString('customHGYDT', 'SENDEMAIL', frm_op_seae_edi_custom_hgydt.edit12.text);
inifile1.WriteString('customHGYDT', 'SENDFILETYPE', frm_op_seae_edi_custom_hgydt.ComboBox1.text);
inifile1.WriteString('customHGYDT','ESINAME',frm_op_seae_edi_custom_hgydt.edit13.text);
inifile1.WriteString('customHGYDT','ESIPASS',frm_op_seae_edi_custom_hgydt.edit14.text);
Memo1.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+'CNTRSTR.txt');
inifile1.free;
Str := Tstringlist.Create;
try
if (frm_op_seae_edi_custom_hgydt.ComboBox1.Text = '') or (frm_op_seae_edi_custom_hgydt.ComboBox1.Text = 'txt') then
Str := frm_op_seae_edi_custom_hgydt.CreateSIEdiFile_MBL
else
begin
if (fileType='-3') then begin
Str := frm_op_seae_edi_custom_hgydt.CreateSIEdiFile_XML_Del;
end else begin
if frm_op_seae_edi_custom_hgydt.bsSkinCheckRadioBox2.Checked then Str := frm_op_seae_edi_custom_hgydt.CreateSIEdiFile_XML_Multi
else Str := frm_op_seae_edi_custom_hgydt.CreateSIEdiFile_xml;
end;
end;
for i := 0 to Str.Count - 1 do
begin
if frm_op_seae_edi_custom_hgydt.IsZhongwen(Str[i]) then
begin
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>', mtWarning, [mbYes, mbNo], 0) = mrNo then
exit;
end;
end;
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
if (frm_op_seae_edi_custom_hgydt.ComboBox1.Text = '') or (frm_op_seae_edi_custom_hgydt.ComboBox1.Text = 'txt') then begin
str_file:=ScriptPath
+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'%'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring
+'%'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'%'
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+ fileType+'.txt';
Str.SaveToFile(str_file);
end else begin
if (fileType='-3') then begin
str_file:=ScriptPath
+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'delete.xml';
SaveUTF8File(Str.Text,str_file);
end else begin
str_file:=ScriptPath
+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'%'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring
+'%'+frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'%'
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+ fileType+'.xml';
Str.SaveToFile(str_file);
end;
//
end;
// mblno:=frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'(һ<><D2BB>ͨ)';
// TMyThread.create(str_file,'text/xml',frm_op_seae_edi_custom_hgydt.Edit13.Text,frm_op_seae_edi_custom_hgydt.Edit14.Text,mblno,'dzka');
TDsThread.create(str_file,'WLXX','',frm_op_seae_edi_custom_hgydt.Edit13.Text,frm_op_seae_edi_custom_hgydt.Edit14.Text);
{
MultiPartFormDataStream := TIdMultiPartFormDataStream.Create;
IdHTTP1:=TIdHTTP.Create(Application);
mblno:= frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
try
IdHttp1.Request.Accept := '*/*';
IdHttp1.Request.AcceptLanguage:='zh-CN';
IdHttp1.Request.ContentType := MultiPartFormDataStream.RequestContentType;
MultiPartFormDataStream.AddFormField('username',frm_op_seae_edi_custom_hgydt.Edit13.Text);
MultiPartFormDataStream.AddFormField('password',frm_op_seae_edi_custom_hgydt.Edit14.Text);
MultiPartFormDataStream.AddFormField('action','dzka');
MultiPartFormDataStream.AddFormField('encode','1');
MultiPartFormDataStream.AddFile('filename',str_file,'text/xml');
MultiPartFormDataStream.Position := 0;
ShowMessage(mblno+'---'+UnicodeToChinese(IdHTTP1.Post('http://47.94.19.3:8111/cdpost.ashx', MultiPartFormDataStream)));
finally
MultiPartFormDataStream.Free;
FreeAndNil(IdHTTP1);
end;
}
finally
FreeAndNil(Str)
end;
close;
end;
{
procedure Tfrm_op_seae_edi_custom_hgydt.bsSkinButton3Click(
Sender: TObject);
var
ID: DWORD;
begin
if hThread>0 then begin
showmessage('<27>н<EFBFBD><D0BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD><DAB7><EFBFBD>,<2C><><EFBFBD>ܷ<EFBFBD><DCB7>ͣ<EFBFBD>');
Exit;
end;
try
hThread := CreateThread(nil, 0, @PlateThreadFun, nil, CREATE_SUSPENDED, ID);
ResumeThread(hThread);
except
if hThread>0 then TerminateThread(hThread,0);
end;
end;
}
function Tfrm_op_seae_edi_custom_hgydt.formattel(str: string): string;
begin
Result := Trim(str);
Result := StringReplace(Result, '+', '', [rfReplaceAll]);
Result := StringReplace(Result, '-', '', [rfReplaceAll]);
end;
function Tfrm_op_seae_edi_custom_hgydt.CreateSIEdiFile_XML_Del: TStrings;
var
str: Tstringlist;
i, j, Count: integer;
strsql, strRmain: string;
rs: Tadoquery;
wide_str: widestring;
k: integer;
inifile1: Tinifile;
strType, XType, TransType: string;
strDatetime, IMO: string;
SenderCode, ReciverCode: string;
alist: TStringList;
datacount, tmpint: Integer;
aQuery: TADOQuery;
bsnostr: WideString;
begin
//<2F>򿪶<EFBFBD>Ʊҵ<C6B1><D2B5>
for i := 0 to frm_op_seae_edi_data.dxDBGrid1.SelectedCount - 1 do
begin
frm_op_seae_edi_data.t_op_seae.GotoBookmark(pointer(frm_op_seae_edi_data.dxDBGrid1.selectedrows[i]));
if bsnostr = '' then
bsnostr := '''' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString + ''''
else
bsnostr := bsnostr + ',' + '''' + frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString + '''';
end;
aQuery := CreateAdoQuery;
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('select * from t_op_seae_edi where <20><><EFBFBD><EFBFBD> in (' + bsnostr + ')');
Open;
end;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊҵ<C6B1><D2B5><EFBFBD>Ƿ<EFBFBD><C7B7>Ϸ<EFBFBD>
SenderCode := trim(edit1.Text);
ReciverCode := trim(edit2.Text);
if bsSkinRadioGroup1.ItemIndex = 0 then
strType := '9'
else if bsSkinRadioGroup1.ItemIndex = 1 then
strType := '2'
else if bsSkinRadioGroup1.ItemIndex = 2 then
strType := '3'
else if bsSkinRadioGroup1.ItemIndex = 3 then
strType := '5'
else if bsSkinRadioGroup1.ItemIndex = 4 then
strType := '0'
else if bsSkinRadioGroup1.ItemIndex = 5 then
strType := '11'
else
strType := '9';
str := Tstringlist.Create;
str.Clear;
str.Add('<?xml version="1.0" encoding="UTF-8" ?>');
str.Add('<Manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1">');
str.Add('<Head>');
//<!--<2D><><EFBFBD>ı<EFBFBD><C4B1>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<MessageID>' + SenderCode + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + GetDatetime(datetimetostr(now), 4) + '</MessageID>');
//<!--<2D><><EFBFBD>Ĺ<EFBFBD><C4B9>ܴ<EFBFBD><DCB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<FunctionCode>' + strType + '</FunctionCode>');
//<!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<MessageType>MT2101</MessageType>');
// <!--<2D><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<SenderID>' + SenderCode + '</SenderID>');
//<!--<2D><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ReceiverID>' + ReciverCode + '</ReceiverID>');
//<!--<2D><><EFBFBD><EFBFBD>ʱ<EFBFBD>䣨ѭ<E4A3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>þ<EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ʽΪCCYYMMDDHHmmssfff-->
str.Add('<SendTime>' + GetDatetime(datetimetostr(now), 4) + '</SendTime>');
//<!--<2D><><EFBFBD>İ汾<C4B0>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Version>1.0</Version>');
str.Add('</Head>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD>壨ѭ<E5A3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Declaration>');
// <!--<2D>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<RepresentativePerson>');
// <!--256 Representative person name <20>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<Name>' + SenderCode + '</Name>');
str.Add('</RepresentativePerson>');
// <!--<2D><><EFBFBD><EFBFBD><E4B9A4><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<BorderTransportMeans>');
// <!--<2D><><EFBFBD>κ<EFBFBD><CEBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<JourneyID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</JourneyID>');
// <!--<2D><><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4>루ѭ<EBA3A8><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
str.Add('<ID>' + trim(frm_op_seae_edi_data.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>IMO').asstring) + '</ID>');
str.Add('</BorderTransportMeans>');
//<2F>˴<EFBFBD><CBB4><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>Ӷ<EFBFBD>Ʊҵ<C6B1><D2B5>
aQuery.First;
while not aQuery.Eof do
begin
//<!--<2D><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶΣ<DDB6>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1-9999<39><39>-->
str.Add('<Consignment>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<TransportContractDocument>');
//<!--<2D><><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + '</ID>');
str.Add('<ChangeReasonCode>999</ChangeReasonCode>');
str.Add('</TransportContractDocument>');
// <!--<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0-1<><31>-->
if trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) <> '' then
begin
str.Add('<AssociatedTransportDocument>');
//<!--<2D><><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD>ţ<EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>-->
str.Add('<ID>' + trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + '</ID>');
str.Add('</AssociatedTransportDocument>');
end;
str.Add('</Consignment>');
aQuery.Next;
end;
str.Add('<AdditionalInformation>');
str.Add('<Reason>' + trim(Memo2.Lines.CommaText) + '</Reason>');
str.Add('<ContactName>' + employee+ '</ContactName>');
str.Add('<ContactTel>' + empmobil + '</ContactTel>');
str.Add('<Content>' + trim(Memo2.Lines.CommaText) + '</Content>');
str.Add('</AdditionalInformation>');
str.Add('</Declaration>');
str.Add('</Manifest>');
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('update t_op_seae_edi set EDI״̬=''<27>ѷ<EFBFBD><D1B7><EFBFBD>'' where <20><><EFBFBD><EFBFBD> in ('+bsnostr+')');
ExecSQL;
end;
FreeAndNil(aQuery);
Result := str;
end;
end.