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.

4075 lines
132 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_op_seae_edi_one;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,IdFTP,IdFTPCommon,
Dialogs, BusinessSkinForm, StdCtrls, bsSkinCtrls,inifiles, DB, ADODB,
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,IdGlobal,
FtpCli, IdExplicitTLSClientServerBase;
type
Tfrm_op_seae_edi_one = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
Label2: TLabel;
Edit2: TEdit;
Edit1: TEdit;
Label1: TLabel;
SaveDialog1: TSaveDialog;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
t_op_ctn: TADOQuery;
t_op_ctn1: TDataSource;
bsSkinRadioGroup1: TbsSkinRadioGroup;
Label3: TLabel;
Edit3: TEdit;
bsSkinGroupBox1: TbsSkinGroupBox;
bsSkinButton4: TbsSkinButton;
Label4: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Label5: TLabel;
Label6: TLabel;
Edit6: TEdit;
Label7: TLabel;
Edit7: TEdit;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
FtpClient1: TFtpClient;
bsSkinButton5: TbsSkinButton;
IdFTP1: TIdFTP;
CheckBox1: TCheckBox;
bsSkinButton6: TbsSkinButton;
bsSkinButton7: TbsSkinButton;
Label8: TLabel;
Edit8: TEdit;
Edit9: TEdit;
Label9: TLabel;
Label10: TLabel;
Edit10: TEdit;
bsSkinButton8: TbsSkinButton;
procedure bsSkinButton2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure bsSkinButton4Click(Sender: TObject);
procedure FtpClient1Error(Sender: TObject; var Msg: String);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
private
function isEditrue(DataSet:TDataSet): boolean;
function GetStrNum(str:String):integer;
function FormatListString(Old:TStrings;mCount,Strlength:integer):String;
function FormatEdiString(old:String;Strlength:integer=0):String;
function CreateEdiFile:TStrings;
function CreateZHUEdiFile:TStrings;
function GetCntrEdi(cntrsize: String):String;
function GetpkgsEdi(pkgs:String):String;
function GetlineEdi(aline:String):String;
procedure GetLengthTString(var sl: TStringList; l: integer);
function GetLengthword(var s: String; l: Integer;str:String): String;
function GetcustEdi(cust: String): String;
function GetvesselEdi(avessel: String): String;
function GetTransPortEdi(port:string):string;
function GetCTN(BusinessID:string):TStringList;
function IsHasCtn(BusinessID:string):Boolean;
function cutpkgs(kindpkg:string):string;
function cutmblno(mblno:string):string;
{ Private declarations }
public
{ Public declarations }
function GetShipEdiNO(Ship:String): String;
function CreateVgmEdiFile:TStrings;
function CreateSIEdiFile_MBL:string;
end;
var
frm_op_seae_edi_one: Tfrm_op_seae_edi_one;
implementation
uses u_op_seae, u_main, my_sys_function, u_data_share, u_op_seae_assistant;
{$R *.dfm}
function Tfrm_op_seae_edi_one.IsHasCtn(BusinessID:string):Boolean;
var
aQuery:TADOQuery;
begin
Result:=False;
aQuery:=CreateAdoQuery;
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('select Row_Number()over(order by ctn_id) as <20><><EFBFBD><EFBFBD>,* from t_op_ctn_detail where ctn_id in ('
+'select ctn_id from t_op_ctn where <20><><EFBFBD><EFBFBD>='+QuotedStr(BusinessID)+')');
Open;
end;
if aQuery.RecordCount>0 then Result:=True;
FreeAndNil(aQuery);
end;
function Tfrm_op_seae_edi_one.GetTransPortEdi(port:string):string;
var
aQuery:TADOQuery;
begin
Result:='';
aQuery:=CreateAdoQuery;
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('select a.<2E><><EFBFBD≯ۿ<CCB8>,b.EDI<44><49><EFBFBD><EFBFBD> from t_op_seae a left join '
+' (SELECT EDI<44><49><EFBFBD><EFBFBD><><D3A2><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><><CAA1>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C>ۿ<EFBFBD>ȫ<EFBFBD><C8AB>,<2C>ۿڴ<DBBF><DAB4><EFBFBD> FROM t_code_disport) b '
+' on a.<2E><><EFBFBD≯ۿ<CCB8>=b.Ӣ<><D3A2><EFBFBD><EFBFBD> where a.<2E><><EFBFBD≯ۿ<CCB8>='+QuotedStr(port) );
Open;
end;
Result:=aQuery.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').AsString;
FreeAndNil(aQuery);
end;
function Tfrm_op_seae_edi_one.GetShipEdiNO(Ship:String): String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD>,EDI<44><49><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><C2BC><EFBFBD><EFBFBD><><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_crm_client');
SQL.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>''Ŀ<><C4BF>'' and <20><><EFBFBD><EFBFBD>˾=1 and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Ship+'''');
SQL.Add('order by <20><><EFBFBD><EFBFBD>');
Open;
if not IsEmpty then
Result:=Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
else
Result:='';
end;
finally
FreeAndNil(aQuery);
end;
end;
function Tfrm_op_seae_edi_one.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:='a'
else
Result:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_op_seae_edi_one.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_one.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;
function Tfrm_op_seae_edi_one.FormatEdiString(old:String;Strlength:integer=0):String;
var
i:integer;
begin
Result:=Trim(Old);
Result:=StringReplace(Result,'?','??',[rfReplaceAll]);
Result:=StringReplace(Result,':','?:',[rfReplaceAll]);
Result:=StringReplace(Result,'''','?''',[rfReplaceAll]);
Result:=StringReplace(Result,'+','?+',[rfReplaceAll]);
end;
function Tfrm_op_seae_edi_one.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
if (Trim(old.Strings[i])<>'') and (Trim(old.Strings[i])<>#10) then
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+FormatEdiString(NewStrs.Strings[i],Strlength);
end;
if i<mCount-1 then
Result:=Result+':';
end;
finally
FreeAndNil(NewStrs);
end;
end;
function Tfrm_op_seae_edi_one.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_one.bsSkinButton2Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_op_seae_edi_one.FormShow(Sender: TObject);
var
inifile1:Tinifile;
begin
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
edit1.text:=inifile1.ReadString('ONEEDI','SEND','');
edit2.text:=inifile1.ReadString('ONEEDI','RECIEVE','');
edit3.text:=inifile1.ReadString('ONEEDI','SENDNAME','');
edit4.text:=inifile1.ReadString('ONEEDI','FTPSERVER','');
edit5.text:=inifile1.ReadString('ONEEDI','FTPPATH','/');
edit6.text:=inifile1.ReadString('ONEEDI','FTPNAME','');
edit7.text:=inifile1.ReadString('ONEEDI','FTPPASS','');
edit8.text:=inifile1.ReadString('ONEEDI','NVONO','');
edit9.text:=inifile1.ReadString('ONEEDI','SENDEMAIL','');
edit10.text:=inifile1.ReadString('ONEEDI','CONTRACTOR','');
inifile1.free;
end;
function Tfrm_op_seae_edi_one.GetCTN(BusinessID:string):TStringList;
var
Tempstr:Tstringlist;
aQuery,bQuery:TADOQuery;
str:TStrings;
M,L,i:integer;
S:string;
begin
Result:=Tstringlist.Create;
if Trim(BusinessID)='' then
begin
ShowMessage('û<><C3BB><EFBFBD>ҵ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>');
Exit;
end;
Tempstr:=Tstringlist.Create;
str:= Tstringlist.Create;
aQuery:=CreateAdoQuery;
bQuery:=CreateAdoQuery;
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('select Row_Number()over(order by ctn_id) as <20><><EFBFBD><EFBFBD>,* from t_op_ctn_detail where ctn_id in ('
+'select ctn_id from t_op_ctn where <20><><EFBFBD><EFBFBD>='+QuotedStr(BusinessID)+')');
Open;
end;
if aQuery.RecordCount=0 then
begin
Exit;
end;
if aQuery.RecordCount>0 then
begin
aQuery.First;
while not aQuery.Eof do
begin
with bQuery do
begin
Close;
SQL.Clear;
SQL.Add('select * from t_op_ctn where ctn_id ='+QuotedStr(aQuery.FieldByName('ctn_id').AsString));
Open;
end;
Result.Add ('41'
+':'+Trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) //2 <20><><EFBFBD><EFBFBD> // 2
+':'+Trim(aQuery.FieldByName('HTS').AsString) // 3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) // 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
+':'+Trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) // 5
+':'+trim(GetpkgsEdi(aQuery.FieldByName('<27><>װ').AsString)) // 6
+':'+cutpkgs(trim(aQuery.FieldByName('<27><>װ').AsString)) // 7
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27>ܼ<EFBFBD>').asstring) //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5> 8
+':'+trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring) //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5> 9
+':' // 10
+':' // 11
+':' // 12
+':' // 13
+':' // 14
+':'+trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring) // 15
+':' // 16
+':' // 17
+':' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> // 18
+#39);
if bsSkinCheckRadioBox1.Checked then begin
Result.Add ('42'
+':'+Trim(bQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) //2 <20><><EFBFBD><EFBFBD> // 2
+':'+Trim(Trim(GetCntrEdi(bQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))) // 3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
+':'+trim(bQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
+':'+Trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) // 5
+':'+Trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) // 5
+':' // 7
+':'+trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring) //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5> 9
+#39);
end;
IF trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' THEN
BEGIN
Result.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>
+':'
+':'
+':'
+':'
+':'
+':'
+':'
+'::'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring) +':'
+'C:'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+'::::'
+#39);
END;
IF trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D'THEN
BEGIN
Result.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>
+trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
+':'
+':'
+':'
+':'
+'::'
+':'
+':'
+':'
+':'
+':::::'
+#39);
END;
if not bsSkinCheckRadioBox2.Checked then
begin
if (Trim(bQuery.FieldByName('<27><>ͷ').AsString )='') or (bQuery.RecordCount=0)
then Tempstr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').AsString
else Tempstr.Text:= bQuery.FieldByName('<27><>ͷ').AsString;
GetLengthTString(Tempstr,35);
str.text:='';
for L:=0 to Tempstr.Count-1 do
begin
if Trim(Tempstr.Strings[L])<>'' then str.Add(Tempstr.Strings[L]);
end;
M:=1;
for L:=0 to str.Count-1 do
begin
if M<=10 then
begin
if M=1 then
begin
s:='44:'+FormatEdiString(str.Strings[L],0)+':';
end
else
begin
if M=10 then
s:=s+FormatEdiString(str.Strings[L],0)
else
s:=s+FormatEdiString(str.Strings[L],0)+':';
end;
end
else
begin
S:=S+'''';
Result.Add(S);
M:=1;
s:='44:'+FormatEdiString(str.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Result.Add(S);
if (Trim(aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString )='')
then Tempstr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString
else Tempstr.Text:=aQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
GetLengthTString(Tempstr,70);
str.text:='';
for L:=0 to Tempstr.Count-1 do
begin
if Trim(Tempstr.Strings[L])<>'' then str.Add(Tempstr.Strings[L]);
end;
M:=1;
for L:=0 to str.Count-1 do
begin
if M<=5 then
begin
if M=1 then
begin
s:='47:'+FormatEdiString(str.Strings[L],0)+':';
end
else
begin
if M=5 then
s:=s+FormatEdiString(str.Strings[L],0)
else
s:=s+FormatEdiString(str.Strings[L],0)+':';
end;
end
else
begin
S:=S+'''';
Result.Add(S);
M:=1;
s:='47:'+FormatEdiString(str.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Result.Add(S);
end;
aQuery.Next;
end;
end;
FreeAndNil(aQuery);
FreeAndNil(bQuery);
end;
procedure Tfrm_op_seae_edi_one.bsSkinButton1Click(Sender: TObject);
var
Str:TStrings;
inifile1:Tinifile;
i:integer;
SenderCode,ReciverCode,strType:String;
begin
if bsSkinCheckRadioBox2.Checked then
begin
if frm_op_seae_assistant=nil then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><>к<EFBFBD><D0BA>ᵥ)<29><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>ͷֵ<CDB7>Edi');
exit;
end
end;
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
begin
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
begin
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
if not isEditrue(frm_op_seae.t_op_seae) then exit;
end;
end
else
begin
if not isEditrue(frm_op_seae.t_op_seae) then exit;
end;
str:=Tstringlist.Create;
try
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:='4'
else strType:='9';
if bsSkinCheckRadioBox1.Checked then
str.Add('00:IFTMIN:BOOKING:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39)
else
str.Add('00:IFTMBF:BOOKING:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39);
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
begin
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
begin
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
if Trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
Str.AddStrings(CreateEdiFile)
else if Pos('<27><>Ʊ',(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring))>0 then
Str.addstrings(CreateZHUEdiFile)
else begin
Exit;
end;
end;
end
else
begin
if Trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
Str.AddStrings(CreateEdiFile)
else if Pos('<27><>Ʊ',(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring))>0 then
Str.AddStrings(CreateZHUEdiFile)
else begin
Exit;
end;
end;
I:=str.Count;
str.Add('99:'+intToStr(i+1)+'''');
for i:=0 to Str.Count-1 do begin
if IsZhongwen(Str[i])<>'' then begin
MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41>Ȳ<EFBFBD><C8B2><EFBFBD>ַ<EFBFBD>,<2C><>ȥ<EFBFBD><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>',mtWarning,[mbYes],0);
exit;
end;
end;
SaveDialog1.FileName:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
if SaveDialog1.Execute then
begin
str.SaveToFile(SaveDialog1.FileName+'.txt');
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_one.isEditrue(DataSet:TDataSet): boolean;
var
cntrs:String;
begin
result:=true;
if not bsSkinCheckRadioBox2.Checked then
begin
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)='' then
begin
result:=false;
MessageDlg('<27><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
end
else
begin
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)='' then
begin
result:=false;
MessageDlg('<27><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
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);
exit;
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);
exit;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
}
if trim(DataSet.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('װ<>۴<EFBFBD><DBB4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('װ<><D7B0><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('<27>ܼ<EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װƤ<D7B0>ز<EFBFBD><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
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);
exit;
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><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
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);
exit;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('Ŀ<>ĵز<C4B5><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'' then begin
if (GetvesselEdi(trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)))='' then
begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
end;
{if trim(DataSet.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)='' then
begin
result:=false;
MessageDlg('δ<><EFBFBD><E8B6A8>ת<EFBFBD><D7AA>',mtWarning,[mbOk],0);
Exit;
end;
if GetTransPortEdi(trim(DataSet.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring))='' then
begin
result:=false;
MessageDlg('<27><>ת<EFBFBD><D7AA>δ<EFBFBD>趨EDI<44><49><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
Exit;
end; }
{
if trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if trim(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asstring)='' then begin
result:=false;
MessageDlg('EDI<44><49>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
}
if trim(DataSet.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('ǩ<><C7A9><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if not bsSkinCheckRadioBox2.Checked then
begin
if trim(GetpkgsEdi(DataSet.fieldbyname('<27><>װ').asstring))='' then begin
result:=false;
MessageDlg('<27><>װEDI<44><49><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD>!',mtWarning,[mbOk],0);
exit;
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);
exit;
end;
if trim(DataSet.fieldbyname('<27><>ͷ').asstring)='' then begin
result:=false;
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
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);
exit;
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);
exit;
end;
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat=0 then begin
result:=false;
MessageDlg('<27>ܳ<EFBFBD><DCB3><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
end
else
begin
if trim(GetpkgsEdi(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring))='' then begin
result:=false;
MessageDlg('<27><>װEDI<44><49><EFBFBD><EFBFBD><EBB2BB><EFBFBD><EFBFBD>!',mtWarning,[mbOk],0);
exit;
end;
if trim(frm_op_seae_assistant.t_op_seae_assistant.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);
exit;
end;
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>ͷ').asstring)='' then begin
result:=false;
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger=0 then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if frm_op_seae_assistant.t_op_seae_assistant.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);
exit;
end;
if frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat=0 then begin
result:=false;
MessageDlg('<27>ܳ<EFBFBD><DCB3><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
end;
if trim(frm_op_seae.t_op_seae.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);
exit;
end;
if trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D' then begin
if Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if GetStrNum(Trim(frm_op_seae.t_op_seae.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);
exit;
end;
end;
if trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' then begin
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if Trim(frm_op_seae.t_op_seae.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
else
begin
end;
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
result:=false;
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
end;
if not bsSkinCheckRadioBox2.Checked then
begin
t_op_ctn.Close;t_op_ctn.SQL.Clear;
t_op_ctn.SQL.Add('select * from t_op_ctn');
t_op_ctn.SQL.Add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
t_op_ctn.SQL.Add('order by <20><><EFBFBD><EFBFBD>');
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
end
else
begin
t_op_ctn.Close;t_op_ctn.SQL.Clear;
t_op_ctn.SQL.Add('select * from t_op_ctn_fendan');
t_op_ctn.SQL.Add('where AS_ID=:AS_ID');
t_op_ctn.SQL.Add('order by <20><><EFBFBD><EFBFBD>');
t_op_ctn.Parameters.ParamByName('AS_ID').Value:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('AS_ID').AsInteger;
end;
t_op_ctn.open;
if t_op_ctn.IsEmpty then begin
result:=false;
MessageDlg('<27><>װ<EFBFBD><EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
exit;
end;
t_op_ctn.First;
while not t_op_ctn.Eof do begin
if Trim(GetCntrEdi(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))='' then begin
result:=false;
MessageDlg('<27><>װ<EFBFBD><D7B0>EDI<44><49><EFBFBD><EFBFBD><EBB2BB><EFBFBD>ڣ<EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
t_op_ctn.Next;
end;
end;
function Tfrm_op_seae_edi_one.CreateEdiFile:TStrings;
var
str,sl1:Tstringlist;
sl:TStrings;
i,j,Count,l,M:integer;
strsql,strRmain,strtemp,S,strtemp2:string;
rs,aQuery2,aQueryCtnDetail,ctnquery:Tadoquery;
wide_str:widestring;
k:integer;
strType,strorderno,strcntrno:string;
strDatetime:string;
SenderCode,ReciverCode:string;
function GetRemarksString:String;
var
TempStr:TStrings;
begin
TempStr:=TStringList.Create;
try
if not bsSkinCheckRadioBox2.Checked then
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').AsString
else TempStr.Text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('EDI<44><49>ע').AsString;
Result:='17:';
Result:=Result+FormatListString(TempStr,5,35)+'''';
finally
FreeAndNil(TempStr);
end;
end;
function GetShipperString:String;
var
TempStr:TStringlist;
aQuery:TADOQuery;
M,L:integer;
S:String;
begin
TempStr:=TStringList.Create;
aQuery:=CreateAdoQuery;
try
if bsSkinCheckRadioBox2.Checked then begin
with aQuery do begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD> from t_op_seae_assistant where AS_ID='+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('AS_ID').AsString+'');
// SQL.Add('select <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD> from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''');
open;
if not IsEmpty then
TempStr.Text:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString
else
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString;
end;
end else
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
if Tempstr.Count<=9 then begin
Result:='20:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
end else begin
M:=1;
for L:=0 to Tempstr.Count-1 do begin
if M<=9 then begin
if M=1 then begin
s:='20:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end else begin
if M=9 then
s:=s+FormatEdiString(Tempstr.Strings[L],0)
else
s:=s+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='20:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
result:='';
end;
finally
FreeAndNil(TempStr);
end;
end;
function GetConsigneString:String;
var
TempStr:TStringlist;
aQuery:TADOQuery;
M,L:integer;
S:String;
begin
TempStr:=TStringList.Create;
aQuery:=CreateAdoQuery;
try
if bsSkinCheckRadioBox2.Checked then begin
with aQuery do begin
Close;
SQL.Clear;
SQL.Add('select <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD> from t_op_seae_assistant where AS_ID='+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('AS_ID').AsString+'');
open;
if not IsEmpty then
TempStr.Text:=fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString
else
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString;
end;
end
else
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
if Tempstr.Count<=9 then begin
Result:='21:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
end else begin
M:=1;
for L:=0 to Tempstr.Count-1 do begin
if M<=9 then begin
if M=1 then begin
s:='21:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end else begin
if M=9 then
s:=s+FormatEdiString(Tempstr.Strings[L],0)
else
s:=s+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='21:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
result:='';
end;
finally
FreeAndNil(TempStr);
end;
end;
function GetNOTIFYString:String;
var
TempStr:TStringlist;
aQuery:TADOQuery;
M,L:integer;
S:String;
begin
TempStr:=TStringList.Create;
aQuery:=CreateAdoQuery;
try
if bsSkinCheckRadioBox2.Checked then begin
with aQuery do begin
Close;
SQL.Clear;
SQL.Add('select ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD> from t_op_seae_assistant where AS_ID='+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('AS_ID').AsString+'');
// SQL.Add('select ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD> from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''');
open;
if not IsEmpty then
TempStr.Text:=fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString
else
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString;
end;
end else
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
if Tempstr.Count<=9 then begin
Result:='22:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
end else begin
M:=1;
for L:=0 to Tempstr.Count-1 do begin
if M<=9 then begin
if M=1 then begin
s:='22:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end else begin
if M=9 then
s:=s+FormatEdiString(Tempstr.Strings[L],0)
else
s:=s+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='22:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
result:='';
end;
finally
FreeAndNil(TempStr);
end;
end;
//
function GetNOTIFYTwoString:String;
var
TempStr:TStringlist;
aQuery:TADOQuery;
M,L:integer;
S:String;
begin
TempStr:=TStringList.Create;
aQuery:=CreateAdoQuery;
try
if bsSkinCheckRadioBox2.Checked then begin
with aQuery do begin
Close;
SQL.Clear;
SQL.Add('select <20>ڶ<EFBFBD>֪ͨ<CDA8><D6AA> from t_op_seae_assistant where AS_ID='+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('AS_ID').AsString+'');
// SQL.Add('select ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD> from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''');
open;
if not IsEmpty then
TempStr.Text:=fieldbyname('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').AsString
else
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').AsString;
end;
end else
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').AsString;
if trim(TempStr.Text)='' then Exit;
GetLengthTString(TempStr,35);
if Tempstr.Count<=6 then begin
Result:='22:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
end else begin
M:=1;
for L:=0 to Tempstr.Count-1 do begin
if M<=6 then begin
if M=1 then begin
s:='22:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end else begin
if M=6 then
s:=s+FormatEdiString(Tempstr.Strings[L],0)
else
s:=s+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='22:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
result:='';
end;
finally
FreeAndNil(TempStr);
end;
end;
//
function GetAMSShipperString:String;
var
TempStr:TStringlist;
M,L:integer;
S:String;
begin
TempStr:=TStringList.Create;
try
TempStr.Text:=frm_op_seae.t_op_AMS.fieldbyname('AMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
if Tempstr.Count<=9 then begin
Result:='23:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
end else begin
M:=1;
for L:=0 to Tempstr.Count-1 do begin
if M<=9 then begin
if M=1 then begin
s:='23:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end else begin
if M=9 then
s:=s+FormatEdiString(Tempstr.Strings[L],0)
else
s:=s+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='23:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
result:='';
end;
finally
FreeAndNil(TempStr);
end;
end;
function GetAMSConsigneString:String;
var
TempStr:TStringlist;
M,L:integer;
S:String;
begin
TempStr:=TStringList.Create;
try
TempStr.Text:=frm_op_seae.t_op_AMS.fieldbyname('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
if Tempstr.Count<=9 then begin
Result:='24:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
end else begin
M:=1;
for L:=0 to Tempstr.Count-1 do begin
if M<=9 then begin
if M=1 then begin
s:='24:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end else begin
if M=9 then
s:=s+FormatEdiString(Tempstr.Strings[L],0)
else
s:=s+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='24:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
result:='';
end;
finally
FreeAndNil(TempStr);
end;
end;
function GetAMSNOTIFYString:String;
var
TempStr:TStringlist;
M,L:integer;
S:String;
begin
TempStr:=TStringList.Create;
try
TempStr.Text:=frm_op_seae.t_op_AMS.fieldbyname('AMS֪ͨ<CDA8><D6AA>').AsString;
GetLengthTString(TempStr,35);
if Tempstr.Count<=9 then begin
Result:='25:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
end else begin
M:=1;
for L:=0 to Tempstr.Count-1 do begin
if M<=9 then begin
if M=1 then begin
s:='25:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end else begin
if M=9 then
s:=s+FormatEdiString(Tempstr.Strings[L],0)
else
s:=s+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='25:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
result:='';
end;
finally
FreeAndNil(TempStr);
end;
end;
{
function GetMARKSString:String;
var
TempStr:TStrings;
k,j:integer;
s:string;
begin
TempStr:=TStringList.Create;
try
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').AsString;
k:=1;
for j:=0 to TempStr.Count-1 do begin
if k<=10 then begin
if k=1 then begin
s:='44:'+FormatEdiString(sl.Strings[j],35)+':';
end else begin
if K=5 then
s:=s+FormatEdiString(sl.Strings[j],35)
else
s:=s+FormatEdiString(sl.Strings[j],35)+':';
end;
end else begin
S:=S+'''';
EdiStrings.Add(S);
k:=1;
s:='44:'+FormatEdiString(sl.Strings[j],35)+':';
end;
k:=k+1;
end;
S:=S+'''';
Result:='44:';
Result:=Result+FormatListString(TempStr,10,35)+'''';
finally
FreeAndNil(TempStr);
end;
end;
}
{
function GetCARGODESCRIPTIONString:String;
var
TempStr:TStrings;
i:integer;
begin
TempStr:=TStringList.Create;
try
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
for i:=0 to TempStr.Count-1 do begin
if i=0 then
Result:='47:'+FormatEdiString(TempStr.Strings[i],70)
else
Result:=Result+':'+FormatEdiString(TempStr.Strings[i],70);
end;
Result:=Result+'''';
finally
FreeAndNil(TempStr);
end;
end;
}
begin
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:='4'
else strType:='9';
str:=Tstringlist.Create;
sl:=Tstringlist.Create;
sl1:=Tstringlist.Create;
aQuery2:=CreateAdoQuery;
if bsSkinCheckRadioBox2.Checked then begin
with aQuery2 do begin
Close; SQL.Clear;
SQL.Add('select * from t_op_seae_assistant where AS_ID='''+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('AS_ID').AsString+'''');
// SQL.Add('select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''');
open;
end;
end;
if bsSkinCheckRadioBox1.Checked then
if not frm_op_seae.t_op_ams.Active then frm_op_seae.t_op_ams.open;
str.Clear;
Count:=0;
if bsSkinCheckRadioBox1.Checked then begin
if frm_op_seae.t_op_ams.FieldByName('AMS<4D><53><EFBFBD><EFBFBD>').AsString<>'' then
strtemp:=':'+frm_op_seae.t_op_ams.FieldByName('AMS<4D><53><EFBFBD><EFBFBD>').AsString
else
strtemp:='';
end else begin
strtemp:=':'+edit9.Text;
end;
strorderno:='';
{
if frm_op_seae.t_op_seae.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring<>'' then
strorderno:=Trim(frm_op_seae.t_op_seae.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring)
else
}
strorderno:=Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring);
if bsSkinCheckRadioBox1.Checked then // bsSkinCheckRadioBox1 SI bsSkinCheckRadioBox2 <20><><EFBFBD><EFBFBD> <20>ֵ<EFBFBD>
begin
if not bsSkinCheckRadioBox2.Checked then //<2F><><EFBFBD><EFBFBD>
begin
str.Add ('02:'+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>յ<EFBFBD><D5B5><EFBFBD>').asstring)+':'
+ cutmblno(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)) +':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+ trim(Edit3.Text) +':'
+ ReciverCode+':'
+ ':::::::'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+':'
+ ':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+':'
+':'+strtemp+#39);
end
else
begin
str.Add ('02:'+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>յ<EFBFBD><D5B5><EFBFBD>').asstring)+':'
+ cutmblno(trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)) +':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+ trim(Edit3.Text) +':'
+ ReciverCode+':'
+ ':::::::'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+':'
+ ':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+':'
+':'+strtemp+#39);
end;
end else begin
if not bsSkinCheckRadioBox2.Checked then //<2F><><EFBFBD><EFBFBD>
begin
str.Add ('02:'+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)+':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) +':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+ trim(Edit3.Text) +':'
+ ReciverCode+':'
+ ':::::::'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+'::'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+':'
+ ':'
+strtemp+#39);
end
else
begin
str.Add ('02:'+ trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)+':'
+ trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) +':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+ trim(Edit3.Text) +':'
+ ReciverCode+':'
+ ':::::::'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+'::'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+':'
+':'+strtemp+#39);
end;
end;
if (trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>') OR (trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ') then
strtemp:='ORI'
else if trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
strtemp:='TER'
else
strtemp:='EXP';
str.add('03:'+strtemp+':'
+':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) +':'
+ GetDatetime(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),0)+':'
+ get_fenshu(trim(frm_op_seae.t_op_seae.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring))+':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring) +':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+#39);
// + get_fenshu(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring))+#39);
str.Add('11:'
+ trim(GetvesselEdi(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))+':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'
+'::'
+ ReciverCode +':'
+ '::::::' +#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
if bsSkinCheckRadioBox1.Checked then begin
str.Add ('12:'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+':'
+Trim(GetTransPortEdi(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)))+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)+#39);
end else begin
str.Add ('12:'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+':'
+Trim(GetTransPortEdi(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)))+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) +':'
+trim(GetcustEdi(frm_op_seae.t_op_seae.fieldbyname('<27><>վ').asstring))+#39);
end;
if frm_data_share.t_code_free.locate('<27><><EFBFBD>ѷ<EFBFBD>ʽ',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring,[]) then
begin
str.Add ('14:'+frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)+#39);
str.Add('15:'
+'::'
+trim(frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'
+'::'
+ '::::' +#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
end
else
begin
str.Add ('14:'+'P'+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)+#39);
str.Add('15:'
+'::'
+'P:'
+'::'
+ '::::' +#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
end;
{
if not bsSkinCheckRadioBox1.Checked then begin
strtemp:='';
if not bsSkinCheckRadioBox2.Checked then
sl1.Text:=frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').AsString
else sl1.Text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('EDI<44><49>ע').AsString;
if (sl1.Text<>'') then begin
strtemp:='17:';
strtemp:=strtemp+FormatListString(sl1,5,35);
end;
if Trim(frm_op_seae.t_op_ams.FieldByName('<27><><EFBFBD><EFBFBD>װ<EFBFBD>ش<EFBFBD><D8B4><EFBFBD>').AsString)<>'' then begin
if strtemp<>'' then
strtemp:=strtemp+'::::'+Trim(frm_op_seae.t_op_ams.FieldByName('<27><><EFBFBD><EFBFBD>װ<EFBFBD>ش<EFBFBD><D8B4><EFBFBD>').AsString)+#39
else strtemp:=strtemp+'17:::::::::'+Trim(frm_op_seae.t_op_ams.FieldByName('<27><><EFBFBD><EFBFBD>װ<EFBFBD>ش<EFBFBD><D8B4><EFBFBD>').AsString)+#39
end else begin
if strtemp<>'' then
strtemp:=strtemp+#39;
end;
if strtemp<>'' then
Str.Add(strtemp);
end else begin
}
if not bsSkinCheckRadioBox2.Checked then //<2F><><EFBFBD><EFBFBD>
begin
if trim(frm_op_seae.t_op_seae.fieldbyname('EDI<44><49>ע').asstring)<>'' then
Str.Add(GetRemarksString);
end
else
begin
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('EDI<44><49>ע').asstring)<>'' then
Str.Add(GetRemarksString);
end;
// end;
if not bsSkinCheckRadioBox1.Checked then begin
frm_op_seae.t_op_ams.Close;
frm_op_seae.t_op_ams.Open;
if Trim(frm_op_seae.t_op_ams.FieldByName('NVONO').AsString)<>'' then begin
str.Add ('18:'+'NVO'+':'
+Trim(frm_op_seae.t_op_ams.FieldByName('NVONO').AsString)+#39);
end;
end;
strtemp:=GetShipperString;
if strtemp<>'' then
Str.Add(strtemp);
strtemp:=GetConsigneString;
if strtemp<>'' then
Str.Add(strtemp);
strtemp:=GetNOTIFYString;
if strtemp<>'' then
Str.Add(strtemp);
strtemp:=GetNOTIFYTwoString;
if strtemp<>'' then
Str.Add(strtemp);
if bsSkinCheckRadioBox1.Checked then
if frm_op_seae.t_op_ams.FieldByName('AMS<4D><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>'' then begin
strtemp:=GetAMSShipperString;
if strtemp<>'' then
Str.Add(strtemp);
end;
if bsSkinCheckRadioBox1.Checked then
if frm_op_seae.t_op_ams.FieldByName('AMS<4D>ջ<EFBFBD><D5BB><EFBFBD>').AsString<>'' then begin
strtemp:=GetAMSConsigneString;
if strtemp<>'' then
Str.Add(strtemp);
end;
if bsSkinCheckRadioBox1.Checked then
if frm_op_seae.t_op_ams.FieldByName('AMS֪ͨ<CDA8><D6AA>').AsString<>'' then begin
strtemp:=GetAMSNOTIFYString;
if strtemp<>'' then
Str.Add(strtemp);
end;
{
str.Add ('20:'+':'
+Changestr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring) +#39);
str.Add ('21:'+':'
+Changestr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring) +#39);
str.Add ('22:'+':'
+Changestr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring) +#39);
}
if not bsSkinCheckRadioBox2.Checked then
begin
if IsHasCtn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) then
begin
if Getctn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString).Count>0 then
begin
for i:=0 to Getctn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString).Count-1 do
str.Add(getctn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString).Strings[i]);
end;
end
else
begin
str.Add ('41:1:'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ʽ').asstring)+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)+':' // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':'
+trim(GetpkgsEdi(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring))+':'
+cutpkgs(trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring)) +':' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
+trim(frm_op_seae.t_op_seae.fieldbyname('<27>ܼ<EFBFBD>').asstring) +':' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +'::::::' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װƤ<D7B0><C6A4>
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':::' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
+#39);
end;
end
else
begin
str.Add ('41:1:'+trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('HS<48><53><EFBFBD><EFBFBD>').asstring)+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)+':' // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
+trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':'
+trim(GetpkgsEdi(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring))+':'
+cutpkgs(trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring)) +':' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
+trim(frm_op_seae.t_op_seae.fieldbyname('<27>ܼ<EFBFBD>').asstring) +':' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
+trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +'::::::' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װƤ<D7B0><C6A4>
+trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':::' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
+#39);
end;
if (bsSkinCheckRadioBox1.Checked) and (not IsHasCtn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)) then begin
ctnquery:=CreateAdoQuery;
try
with ctnquery do
begin
Close;
SQL.Clear;
if bsSkinCheckRadioBox2.Checked then
SQL.Add('select * from t_op_ctn_fendan where <20><><EFBFBD><EFBFBD> ='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString))
else
SQL.Add('select * from t_op_ctn where <20><><EFBFBD><EFBFBD> ='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString));
Open;
first;
while not Eof do begin
str.Add ('42'
+':'+Trim(ctnquery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) //2 <20><><EFBFBD><EFBFBD> // 2
+':'+Trim(Trim(GetCntrEdi(ctnquery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))) // 3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
+':'+trim(ctnquery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
+':'+Trim(ctnquery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) // 5
+':'+Trim(ctnquery.FieldByName('<27><><EFBFBD><EFBFBD>').AsString) // 5
+':' // 7
+':'+trim(ctnquery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring) //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5> 9
+#39);
Next;
end;
end;
finally
FreeAndNil(ctnquery);
end;
end;
if not IsHasCtn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) then begin
IF trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' THEN
BEGIN
str.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>
+':'
+':'
+':'
+':'
+':'
+':'
+':'
+'::'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring) +':'
+'C:'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+'::::'
+#39);
END;
IF trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D'THEN
BEGIN
str.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>
+trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
+':'
+':'
+':'
+':'
+'::'
+':'
+':'
+':'
+':'
+':::::'
+#39);
END;
end;
if (not IsHasCtn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)) and (not bsSkinCheckRadioBox2.Checked) then
begin
sl1.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').AsString;
GetLengthTString(sl1,35);
sl.text:='';
for L:=0 to sl1.Count-1 do begin
if Trim(sl1.Strings[L])<>'' then
sl.Add(sl1.Strings[L]);
end;
M:=1;
for L:=0 to sl.Count-1 do begin
if M<=10 then begin
if M=1 then begin
s:='44:'+FormatEdiString(sl.Strings[L],0)+':';
end else begin
if M=10 then
s:=s+FormatEdiString(sl.Strings[L],0)
else
s:=s+FormatEdiString(sl.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='44:'+FormatEdiString(sl.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
sl1.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
GetLengthTString(sl1,70);
sl.text:='';
for L:=0 to sl1.Count-1 do begin
if Trim(sl1.Strings[L])<>'' then
sl.Add(sl1.Strings[L]);
end;
M:=1;
for L:=0 to sl.Count-1 do begin
if M<=5 then begin
if M=1 then begin
s:='47:'+FormatEdiString(sl.Strings[L],0)+':';
end else begin
if M=5 then
s:=s+FormatEdiString(sl.Strings[L],0)
else
s:=s+FormatEdiString(sl.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='47:'+FormatEdiString(sl.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
end;
if bsSkinCheckRadioBox2.Checked then
begin
sl1.Text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>ͷ').AsString ;
GetLengthTString(sl1,35);
sl.text:='';
for L:=0 to sl1.Count-1 do begin
if Trim(sl1.Strings[L])<>'' then
sl.Add(sl1.Strings[L]);
end;
M:=1;
for L:=0 to sl.Count-1 do begin
if M<=10 then begin
if M=1 then begin
s:='44:'+FormatEdiString(sl.Strings[L],0)+':';
end else begin
if M=10 then
s:=s+FormatEdiString(sl.Strings[L],0)
else
s:=s+FormatEdiString(sl.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='44:'+FormatEdiString(sl.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
end;
if bsSkinCheckRadioBox2.Checked then
begin
sl1.Text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString ;
// else
// sl1.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
GetLengthTString(sl1,70);
sl.text:='';
for L:=0 to sl1.Count-1 do begin
if Trim(sl1.Strings[L])<>'' then
sl.Add(sl1.Strings[L]);
end;
M:=1;
for L:=0 to sl.Count-1 do begin
if M<=5 then begin
if M=1 then begin
s:='47:'+FormatEdiString(sl.Strings[L],0)+':';
end else begin
if M=5 then
s:=s+FormatEdiString(sl.Strings[L],0)
else
s:=s+FormatEdiString(sl.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='47:'+FormatEdiString(sl.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
end;
// Str.Add(GetCARGODESCRIPTIONString);
IF frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsBoolean THEN
strtemp2:='Y'
else strtemp2:='N';
Count:=Count+11;
strRmain:='';
if trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
begin
if frm_data_share.t_crm_client_changzhan.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.fieldbyname('<27><>վ').asstring,[])then
begin
if not bsSkinCheckRadioBox2.Checked then
strRmain:=strRmain+'F:'+':'+':'+frm_data_share.t_crm_client_changzhan.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+':'+':'+strtemp2
else strRmain:=strRmain+'L:'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)+':'+':'+frm_data_share.t_crm_client_changzhan.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+':'+':'+strtemp2;
end
else
begin
if not bsSkinCheckRadioBox2.Checked then
strRmain:=strRmain+'F:'+':'+':'+':'+':'+strtemp2
else strRmain:=strRmain+'L:'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)+':'+':'+':'+':'+strtemp2;
end;
if bsSkinCheckRadioBox1.Checked then
begin
strRmain:=strRmain+#39;
end else begin
strcntrno:='';
IF frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsBoolean THEN begin
strsql:='select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='
+#39+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
aQueryCtnDetail:=CREATEADOQUERY;
try
aQueryCtnDetail.close;
aQueryCtnDetail.sql.text:=strsql;
aQueryCtnDetail.open;
if not aQueryCtnDetail.IsEmpty then begin
aQueryCtnDetail.First;
while not aQueryCtnDetail.Eof do begin
if (strcntrno='') then
strcntrno:=aQueryCtnDetail.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString
else strcntrno:=strcntrno+','+aQueryCtnDetail.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
aQueryCtnDetail.Next;
end;
end;
finally
FreeAndNil(aQueryCtnDetail);
end;
end;
strRmain:=strRmain+':'+strcntrno;
strRmain:=strRmain+':'+frm_op_seae.t_op_ams.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ').AsString+':'+frm_op_seae.t_op_ams.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־').AsString;
IF trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' THEN
strRmain:=strRmain+':Y'
else
strRmain:=strRmain+':N';
IF trim(frm_op_seae.t_op_ams.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־').AsString)<>'' then begin
strRmain:=strRmain+'::'+trim(frm_op_seae.t_op_ams.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־').AsString)+#39;
end else strRmain:=strRmain+#39;
end;
if not bsSkinCheckRadioBox2.Checked then
begin
strsql:='select <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from t_op_ctn group by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD> having <20><><EFBFBD><EFBFBD>='
+#39+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
end
else
begin
strsql:='select <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from t_op_ctn_fendan where AS_ID='
+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('AS_ID').AsString
+' group by <20><><EFBFBD><EFBFBD>';
end;
try
rs:=CreateAdoQuery;
rs.Close;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;rs.First;
while not rs.Eof do
begin
str.Add ('48:'+Trim(GetCntrEdi(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))+':'+
trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'+
strRmain);
Count:=Count+1;
rs.Next;
end;
if bsSkinCheckRadioBox1.Checked then
begin
if not bsSkinCheckRadioBox2.Checked then
begin
strsql:='select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='
+#39+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
end
else
begin
strsql:='select * from t_op_ctn_fendan where AS_ID='
+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('AS_ID').AsString;
end;
rs.Close;rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
if not rs.IsEmpty then
begin
if rs.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger>0 then
begin
rs.First;
aQueryCtnDetail:=CREATEADOQUERY;
try
while not rs.Eof do begin
str.Add ('51:'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'+Trim(GetCntrEdi(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))+':'+
trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'+trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger))+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))+':'+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))+''''
);
aQueryCtnDetail.close;
aQueryCtnDetail.sql.text:='select * from t_op_ctn_detail WHERE ctn_id='+ rs.fieldbyname('ctn_id').asstring;
aQueryCtnDetail.open;
if not aQueryCtnDetail.IsEmpty then begin
aQueryCtnDetail.First;
while not aQueryCtnDetail.Eof do begin
str.Add ('53'
+':'+trim(aQueryCtnDetail.fieldbyname('HTS').asstring)
+':'+trim(IntToStr(aQueryCtnDetail.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger))
+':'+trim(FloatToStr(aQueryCtnDetail.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))
+':'+trim(FloatToStr(aQueryCtnDetail.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))
+':'+trim(GetpkgsEdi(aQueryCtnDetail.fieldbyname('<27><>װ').asstring))
+':'+trim(aQueryCtnDetail.fieldbyname('<27><>װ').asstring)
+':'
+':'
+'''');
sl1.Text:=aQueryCtnDetail.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
GetLengthTString(sl1,70);
sl.text:='';
for L:=0 to sl1.Count-1 do
begin
if Trim(sl1.Strings[L])<>'' then
sl.Add(sl1.Strings[L]);
end;
M:=1;
for L:=0 to sl.Count-1 do
begin
if M<=5 then
begin
if M=1 then
begin
s:='54:'+FormatEdiString(sl.Strings[L],0)+':';
end
else
begin
if M=5 then
s:=s+FormatEdiString(sl.Strings[L],0)
else
s:=s+FormatEdiString(sl.Strings[L],0)+':';
end;
end
else
begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='54:'+FormatEdiString(sl.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
aQueryCtnDetail.Next;
end;
end;
rs.Next;
end;
finally
freeandnil(aQueryCtnDetail);
end;
end;
end;
end;
rs.Close;
rs.Free;
except
on e:exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
end
else
begin
if frm_data_share.t_crm_client_changzhan.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.fieldbyname('<27><>վ').asstring,[])then
begin
strRmain:=strRmain+'L:'+':'+':'+frm_data_share.t_crm_client_changzhan.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+':'+':'+'N'+#39;
end
else
begin
strRmain:=strRmain+'L:'+':'+':'+':'+':'+'N'+#39;
end;
str.Add('48:'+':'+':'+strRmain);
Count:=Count+1;
end;
Result:=str;
end;
function Tfrm_op_seae_edi_one.CreateZHUEdiFile:TStrings;
var
str,sl1:Tstringlist;
sl:TStrings;
i,j,Count,l,M:integer;
first:Boolean;
strsql,strRmain,strtemp:string;
rs,aQuery:Tadoquery;
wide_str:widestring;
k:integer;
strType,s:string;
strDatetime:string;
SenderCode,ReciverCode:string;
function GetRemarksString:String;
var
TempStr:TStrings;
begin
TempStr:=TStringList.Create;
try
TempStr.Text:=aQuery.fieldbyname('EDI<44><49>ע').AsString;
Result:='17:';
Result:=Result+FormatListString(TempStr,5,35)+'''';
finally
FreeAndNil(TempStr);
end;
end;
function GetShipperString:String;
var
TempStr:TStringlist;
aQuery2:TAdoQuery;
begin
aQuery2:=CreateAdoQuery;
TempStr:=TStringList.Create;
try
if bsSkinCheckRadioBox2.Checked then begin
with aQuery2 do begin
Close;
SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD> from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''');
open;
if not IsEmpty then
TempStr.Text:=fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString
else
TempStr.Text:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString;
end;
end else
TempStr.Text:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
Result:='20:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
finally
FreeAndNil(TempStr);
end;
end;
function GetConsigneString:String;
var
TempStr:TStringlist;
aQuery2:TAdoQuery;
begin
aQuery2:=CreateAdoQuery;
TempStr:=TStringList.Create;
try
if bsSkinCheckRadioBox2.Checked then begin
with aQuery2 do begin
Close;
SQL.Clear;
SQL.Add('select <20>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD> from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''');
open;
if not IsEmpty then
TempStr.Text:=fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString
else
TempStr.Text:=aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString;
end;
end else
TempStr.Text:=aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
Result:='21:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
finally
FreeAndNil(TempStr);
end;
end;
function GetNOTIFYString:String;
var
TempStr:TStringlist;
aQuery2:TAdoQuery;
begin
aQuery2:=CreateAdoQuery;
TempStr:=TStringList.Create;
try
if bsSkinCheckRadioBox2.Checked then begin
with aQuery2 do begin
Close;
SQL.Clear;
SQL.Add('select ֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD> from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'''');
open;
if not IsEmpty then
TempStr.Text:=fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString
else
TempStr.Text:=aQuery.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString;
end;
end else
TempStr.Text:=aQuery.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
Result:='22:';
Result:=Result+':';
Result:=Result+FormatListString(TempStr,9,35)+'''';
finally
FreeAndNil(TempStr);
end;
end;
function GetMARKSString:String;
var
TempStr:TStringlist;
begin
TempStr:=TStringList.Create;
try
TempStr.Text:=aQuery.fieldbyname('<27><>ͷ').AsString;
GetLengthTString(TempStr,35);
Result:='44:';
Result:=Result+FormatListString(TempStr,10,35)+'''';
finally
FreeAndNil(TempStr);
end;
end;
function GetCARGODESCRIPTIONString:String;
var
TempStr:TStrings;
begin
TempStr:=TStringList.Create;
try
TempStr.Text:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
Result:='47:';
Result:=Result+FormatListString(TempStr,5,70)+'''';
finally
FreeAndNil(TempStr);
end;
end;
begin
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:='4'
else strType:='9';
str:=Tstringlist.Create;
sl:=Tstringlist.Create;
sl1:=Tstringlist.Create;
str.Clear;
Count:=0;
aQuery:=CreateAdoQuery;
try
aQuery.Close;aQuery.sql.Clear;
aQuery.SQL.Add('select * from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD>');
aQuery.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
aQuery.Open;
if not aQuery.IsEmpty then begin
if not isEditrue(aQuery) then exit;
aQuery.first;
first:=true;
while not aQuery.eof do begin
if first then begin
str.Add ('02:'+ trim(frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)+':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) +':'
+ trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +'::'
+ ReciverCode+':'
+ ':::::::'
+ '::'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+':'
+':'+ #39);
end else begin
str.Add ('02:'+ trim(aQuery.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)+':'
+ trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) +':'
+ trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+ trim(Edit3.Text) +':'
+ ReciverCode+':'
+ ':::::::'
+ '::'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)+':'
+':'+ #39);
end;
strtemp:='ORI';
str.add('03:'+strtemp+':'
+':'
+ trim(aQuery.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) +':'
+ GetDatetime(trim(aQuery.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),0)+':'
+ get_fenshu(trim(aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring))+':'
+ trim(aQuery.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring) +':'
+ trim(aQuery.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring) +#39);
str.Add('11:'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1><EFBFBD>').asstring)+':'
+ trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':'
+ trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'
+'::'
+ ReciverCode +':'
+ '::::::' +#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
if bsSkinCheckRadioBox1.Checked then begin
str.Add ('12:'+trim(aQuery.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(aQuery.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(aQuery.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(aQuery.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(aQuery.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+':'
+Trim(GetTransPortEdi(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)))+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)+':'
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)+#39);
end else begin
str.Add ('12:'+trim(aQuery.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(aQuery.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(aQuery.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(aQuery.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(aQuery.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+':'
+Trim(GetTransPortEdi(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)))+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)+':'
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) +':'
+trim(GetcustEdi(aQuery.fieldbyname('<27><>վ').asstring))+#39);
end;
if frm_data_share.t_code_free.locate('<27><><EFBFBD>ѷ<EFBFBD>ʽ',aQuery.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring,[]) then
begin
str.Add ('14:'+frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+':'
+trim(aQuery.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)+#39);
str.Add('15:'
+'::'
+trim(frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'
+'::'
+ '::::' +#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
end
else
begin
str.Add ('14:'+'P'+':'
+trim(aQuery.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)+#39);
str.Add('15:'
+'::'
+'P:'
+'::'
+ '::::' +#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
end;
if trim(aQuery.fieldbyname('EDI<44><49>ע').asstring)<>'' then
Str.Add(GetRemarksString);
if not bsSkinCheckRadioBox1.Checked then begin
frm_op_seae.t_op_ams.Close;
frm_op_seae.t_op_ams.Open;
if frm_op_seae.t_op_ams.FieldByName('NVONO').AsString<>'' then begin
str.Add ('18:'+'NVO'+':'
+trim(frm_op_seae.t_op_ams.FieldByName('NVONO').AsString)+#39);
end;
end;
Str.Add(GetShipperString);
Str.Add(GetConsigneString);
Str.Add(GetNOTIFYString);
if IsHasCtn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) then
begin
if Getctn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString).Count>0 then
begin
for i:=0 to Getctn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString).Count-1 do
str.Add(getctn(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString).Strings[i]);
end;
end
else
begin
str.Add ('41:1::'+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)+':' // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ S/R/D/O
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':'
+trim(GetpkgsEdi(aQuery.fieldbyname('<27><>װ').asstring))+':'
+trim(aQuery.fieldbyname('<27><>װ').asstring) +':' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
+trim(aQuery.fieldbyname('<27>ܼ<EFBFBD>').asstring) +':' //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5>
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +'::::::' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װƤ<D7B0><C6A4>
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':::' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
+#39);
end;
IF trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R'THEN
BEGIN
str.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>
+':'
+':'
+':'
+':'
+':'
+':'
+':'
+'::'
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring) +':'
+'C:'
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+'::::'
+#39);
END;
IF trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D'THEN
BEGIN
str.Add ('43:' // Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>
+trim(aQuery.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
+':'
+trim(aQuery.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) +':'
+':'
+':'
+':'
+':'
+'::'
+':'
+':'
+':'
+':'
+':::::'
+#39);
END;
sl1.Text:=aQuery.fieldbyname('<27><>ͷ').AsString;
GetLengthTString(sl1,35);
sl.text:='';
for L:=0 to sl1.Count-1 do begin
if Trim(sl1.Strings[L])<>'' then
sl.Add(sl1.Strings[L]);
end;
M:=1;
for L:=0 to sl.Count-1 do begin
if M<=10 then begin
if M=1 then begin
s:='44:'+FormatEdiString(sl.Strings[L],0)+':';
end else begin
if M=10 then
s:=s+FormatEdiString(sl.Strings[L],0)
else
s:=s+FormatEdiString(sl.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='44:'+FormatEdiString(sl.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);// Str.Add(GetCARGODESCRIPTIONString);
sl1.Text:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
sl.text:='';
for L:=0 to sl1.Count-1 do begin
if Trim(sl1.Strings[L])<>'' then
sl.Add(sl1.Strings[L]);
end;
M:=1;
for L:=0 to sl.Count-1 do begin
if M<=5 then begin
if M=1 then begin
s:='47:'+FormatEdiString(sl.Strings[L],0)+':';
end else begin
if M=5 then
s:=s+FormatEdiString(sl.Strings[L],0)
else
s:=s+FormatEdiString(sl.Strings[L],0)+':';
end;
end else begin
S:=S+'''';
Str.Add(S);
M:=1;
s:='47:'+FormatEdiString(sl.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
Count:=Count+11;
strRmain:='';
if first then
strRmain:=strRmain+'L:'+':'+':'+':'+':'+'N'+#39
else
strRmain:=strRmain+'L:'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)+':'+':'+':'+':'+'N'+#39;
strsql:='select <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from t_op_ctn group by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD> having <20><><EFBFBD><EFBFBD>='
+#39+frm_op_seae.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;
while not rs.Eof do
begin
str.Add ('48:'+Trim(GetCntrEdi(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))+':'+
trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'+
strRmain);
Count:=Count+1;
rs.Next;
end;
if bsSkinCheckRadioBox1.Checked then begin
strsql:='select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='
+#39+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
rs.Close;
rs.sql.clear;
rs.sql.add(strsql);
rs.Open;
if not rs.IsEmpty then begin
if rs.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger>0 then begin
rs.First;
while not rs.Eof do begin
str.Add ('51:'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'+Trim(GetCntrEdi(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))+':'+
trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)+':'+trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger))+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))+':'+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat))+''''
);
rs.Next;
end;
end;
end;
end;
rs.Close;
rs.Destroy;
except
on e:exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
aQuery.Next;
first:=False;
end;
end;
finally
FreeAndNil(aQuery);
end;
Result:=str;
end;
function Tfrm_op_seae_edi_one.GetCntrEdi(cntrsize: String):String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD>MOL 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_one.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_one.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;
procedure Tfrm_op_seae_edi_one.bsSkinButton3Click(Sender: TObject);
var
str:widestring;
str_file:widestring;
ftpar,ftpname,ftppass,ftppath,ScriptPath:String;
StrL:TStrings;
i:integer;
SenderCode,ReciverCode,strType:String;
begin
ftpar:=Trim(edit4.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ<EFBFBD><D6B7>',mtWarning,[mbOk],0);
exit;
end;
ftpname:=Trim(edit6.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
ftppass:=Trim(edit7.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD>룡',mtWarning,[mbOk],0);
exit;
end;
ftppath:=Trim(edit5.Text);
FtpClient1.UserName:=ftpname;
FtpClient1.PassWord:=ftppass;
FtpClient1.HostName:=ftpar;
FtpClient1.Passive:=CheckBox1.Checked;
FtpClient1.MultiThreaded:=True;
FtpClient1.Port:='21';
FtpClient1.DisplayFileFlag:=True;
FtpClient1.Timeout:=5;
try
if (FtpClient1.Open) and (FtpClient1.User) and (FtpClient1.Pass) then
begin
//<2F><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>
frm_op_seae_edi_one.Caption:='<27>û<EFBFBD><C3BB><EFBFBD><EFBFBD>ӳɹ<D3B3><C9B9><EFBFBD>';
FtpClient1.HostDirName:=ftppath;
if FtpClient1.Cwd then
end else begin
showmessage('<27>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!');
end;
except
on e:exception do
begin
FtpClient1.Abort;
frm_op_seae_edi_one.Caption:='<27>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>';
end;
end;
{
with idftp1 do
begin
Username:=ftpname;
Password:=ftppass;
Host:=ftpar;
Passive:=CheckBox1.Checked;
try
finally
Connect;
end;
if Connected then
begin
showmessage('Ftp<74><70><EFBFBD>ӳɹ<D3B3><C9B9><EFBFBD>');
ChangeDir(ftppath);
TransferType:=ftBinary;
end
else
showmessage('Ftp<74><70><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD>');
end;
}
end;
procedure Tfrm_op_seae_edi_one.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
var
inifile1:Tinifile;
begin
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
inifile1.WriteString('ONEEDI','SEND',edit1.text);
inifile1.WriteString('ONEEDI','RECIEVE',edit2.text);
inifile1.WriteString('ONEEDI','SENDNAME',edit3.text);
inifile1.WriteString('ONEEDI','FTPSERVER',edit4.text);
inifile1.WriteString('ONEEDI','FTPPATH',edit5.text);
inifile1.WriteString('ONEEDI','FTPNAME',edit6.text);
inifile1.WriteString('ONEEDI','FTPPASS',edit7.text);
inifile1.WriteString('ONEEDI','NVONO',edit8.text);
inifile1.WriteString('ONEEDI','SENDEMAIL',edit9.text);
inifile1.WriteString('ONEEDI','CONTRACTOR',edit10.text);
inifile1.free;
end;
procedure Tfrm_op_seae_edi_one.bsSkinButton4Click(Sender: TObject);
begin
if frm_op_seae_edi_one.Height=390 then
frm_op_seae_edi_one.Height:=244
else
frm_op_seae_edi_one.Height:=390;
end;
function Tfrm_op_seae_edi_one.GetcustEdi(cust: String): String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.CLEAR;
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Cust+'''');
Open;
if not IsEmpty then
result:=fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_op_seae_edi_one.FtpClient1Error(Sender: TObject;
var Msg: String);
begin
ShowMessage(Msg);
end;
procedure Tfrm_op_seae_edi_one.bsSkinButton5Click(Sender: TObject);
var
str:widestring;
str_file:widestring;
ftpar,ftpname,ftppass,ftppath,ScriptPath:String;
StrL:TStrings;
i,i_soi:integer;
SenderCode,ReciverCode,strType:String;
dsstr,PostUrl:WideString;
begin
i_soi:=0;
if bsSkinCheckRadioBox2.Checked then
begin
if frm_op_seae_assistant=nil then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><>к<EFBFBD><D0BA>ᵥ)<29><><EFBFBD><EFBFBD>ͷֵ<CDB7>Edi');
exit;
end
end;
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
begin
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
begin
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
if not isEditrue(frm_op_seae.t_op_seae) then exit;
end;
end
else
begin
if not isEditrue(frm_op_seae.t_op_seae) then exit;
end;
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
ftpar:=Trim(edit4.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ<EFBFBD><D6B7>',mtWarning,[mbOk],0);
exit;
end;
ftpname:=Trim(edit6.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
ftppass:=Trim(edit7.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD>룡',mtWarning,[mbOk],0);
exit;
end;
ftppath:=Trim(edit5.Text);
str:=ScriptPath
+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
str_file:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
strL:=Tstringlist.Create;
try
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:='4'
else strType:='9';
if bsSkinCheckRadioBox1.Checked then
strL.Add('00:IFTMIN:BOOKING:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39)
else
strL.Add('00:IFTMBF:BOOKING:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39);
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
begin
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
begin
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
if Trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
StrL.AddStrings(CreateEdiFile)
else if Pos('<27><>Ʊ',(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring))>0 then
StrL:=CreateZHUEdiFile
else begin
Exit;
end;
end;
end
else
begin
if Trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
StrL.AddStrings(CreateEdiFile)
else if Pos('<27><>Ʊ',(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring))>0 then
StrL:=CreateZHUEdiFile
else begin
Exit;
end;
end;
I:=strL.Count;
strL.Add('99:'+intToStr(i+1)+'''');
for i:=0 to StrL.Count-1 do begin
if IsZhongwen(StrL[i])<>'' then begin
MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41>Ȳ<EFBFBD><C8B2><EFBFBD>ַ<EFBFBD>,<2C><>ȥ<EFBFBD><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>',mtWarning,[mbYes],0);
exit;
end;
end;
strL.SaveToFile(str);
finally
FreeAndNil(StrL)
end;
if FtpClient1.Connected then
begin
try
FtpClient1.TransferMode := ftpTransModeStream;
FtpClient1.LocalFileName:=str;
FtpClient1.HostFileName:= str_file;
try
if FtpClient1.Put then
begin
ShowMessage('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD>');
frm_op_seae_edi_one.Caption:='<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>';
end;
except
FtpClient1.Abort;
ShowMessage('<27>ϴ<EFBFBD>ʧ<EFBFBD><CAA7>!');
frm_op_seae_edi_one.Caption:='<27>ϴ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>';
i_soi:=1;
end;
finally
FtpClient1.Abort;
end;
end;
if i_soi=0 then
if bsSkinCheckRadioBox1.Checked then
UpdateSOIStatus(1,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
else UpdateSOIStatus(0,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
dsstr:=CreateSIEdiFile_MBL();
PostUrl:=get_parameters_value(2123,'http://www.myshipping.net:8657/Booking/ReceiveBookingData');
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then begin
TDsDjyThread.create(PostUrl,dsstr,'');
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
end;
if (not bsSkinCheckRadioBox1.Checked) and (frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger=10) then begin
dsstr:='{';
dsstr:=dsstr+'"orderNo":"'+frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString+'"';
dsstr:=dsstr+',"status":"N"';
dsstr:=dsstr+',"bookingId":"'+frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'"';
dsstr:=dsstr+',"bookingIdDate":"'+FormatDateTime('YYYY-MM-DD hh:mm:ss',frm_op_seae.t_op_seae.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime)+'"';
dsstr:=dsstr+'}';
PostUrl:=get_parameters_value(2124,'http://47.104.90.170:6857/api/clp/bookingMsgReceipt');
TDsHaierThread.create(PostUrl,dsstr,'',frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString);
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
end;
{
if not idftp1.Connected then
with idftp1 do
begin
Username:=ftpname;
Password:=ftppass;
Host:=ftpar;
Passive:=CheckBox1.Checked;
try
finally
Connect;
end;
if Connected then
begin
showmessage('Ftp<74><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳɹ<D3B3><C9B9><EFBFBD>');
ChangeDir(ftppath);
TransferType:=ftBinary;
end
else
showmessage('Ftp<74><70><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD>');
end;
if MessageDlg('ȷʵҪ<CAB5>ϴ<EFBFBD>EID<49><44><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbNo],0)=mryes then
begin
try
if idftp1.Connected then
begin
idftp1.Put(str,str_file);
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>');
idftp1.Disconnect;
end
else
begin
showmessage('Ftpû<70><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
except
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
}
end;
function Tfrm_op_seae_edi_one.CreateVgmEdiFile:TStrings;
var
str,sl,sl1:Tstringlist;
i,j,Count,l,M:integer;
strsql,strRmain,strtemp,S,fenshu:string;
rs:Tadoquery;
wide_str,str_shr,str_con,str_not:widestring;
k:integer;
strType,SM:string;
strDatetime,shipname,shipaddr:string;
SenderCode,ReciverCode:string;
firstcon:boolean;
begin
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:='4'
else strType:='9';
str:=Tstringlist.Create;
sl:=Tstringlist.Create;
sl1:=Tstringlist.Create;
str.Clear;
str.Add('00:IFTVGM:BOOKING:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39);
Count:=0;
str.Add ('02:'+ Copy(trim(frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),3,20)+':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) +#39);
str.Add('11:'
+ trim(GetvesselEdi(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))+':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) +':'
+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
// +':'+GetShipEdiNO(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring)
+#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
str.Add ('12:'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)+':'
+Trim(GetTransPortEdi(trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)))+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD≯ۿ<CCB8>').asstring)+':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) +':'
+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) +#39);
Count:=Count+4;
if 1=1 then
begin
strsql:='select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='
+#39+frm_op_seae.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
if (rs.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').asstring<>'') or (rs.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').asstring<>'<27><>') then
begin
if Trim(rs.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').asstring)='<27>ۼ<EFBFBD>' then
SM:='SM2'
else if Trim(rs.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
SM:='SM1';
str.Add ('51:'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //2
+':'+Trim(GetCntrEdi(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)) //3
+':'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 4
+':'+trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger)) //5
+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //6
+'::' +trim(floatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').Asfloat)) //78
+'::::::' //9-14
+':'+rs.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring //15
+':'+GetDatetime(datetimetostr(now),1) //16
+':'+SM //17
+'''');
sl.Text:=FormatEdiString(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring,0);
shipname:='';
if sl.Count>=1 then
shipname:=Copy(sl[0],1,20);
shipaddr:='';
if sl.Count>=2 then
shipaddr:=sl[1];
if sl.Count>=3 then
shipaddr:=shipaddr+' '+sl[2];
if sl.Count>=4 then
shipaddr:=shipaddr+' '+sl[3];
if sl.Count>=5 then
shipaddr:=shipaddr+' '+sl[4];
str.Add ('58:'+shipname //2
+':'+shipaddr //3
+':'+rs.fieldbyname('VGM<47><4D>ϵ<EFBFBD><CFB5>').asString // 4
+':'+'' //5
+':'+rs.fieldbyname('VGM<47><4D>ϵ<EFBFBD><CFB5>ϵ<EFBFBD><CFB5>ʽ').asString //6
+':'+rs.fieldbyname('VGM<47><4D>ϵ<EFBFBD><CFB5>').asString //7
+':' +rs.fieldbyname('VGMǩ<4D><C7A9>').asString //8
+':' +'certificate ID' //9
+'''');
end;
rs.Next;
end;
end;
rs.Close;
rs.Destroy;
except
on e:exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
end;
I:=str.Count;
str.Add('99:'+intToStr(i+1)+'''');
Result:=str;
end;
procedure Tfrm_op_seae_edi_one.bsSkinButton7Click(Sender: TObject);
var
str:widestring;
str_file:widestring;
ftpar,ftpname,ftppass,ftppath,ScriptPath:String;
StrL:TStrings;
i,i_soi:integer;
SenderCode,ReciverCode,strType:String;
SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE:string;
edi:WideString;
begin
i_soi:=0;
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
ftpar:=Trim(edit4.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ<EFBFBD><D6B7>',mtWarning,[mbOk],0);
exit;
end;
ftpname:=Trim(edit6.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
ftppass:=Trim(edit7.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD>룡',mtWarning,[mbOk],0);
exit;
end;
ftppath:=Trim(edit5.Text);
str:=ScriptPath
+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
str_file:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
StrL:=Tstringlist.Create;
try
StrL:=CreateVgmEdiFile;
edi:=StrL.Text;
strL.SaveToFile(str);
finally
FreeAndNil(StrL)
end;
if FtpClient1.Connected then
begin
try
FtpClient1.TransferMode := ftpTransModeStream;
FtpClient1.LocalFileName:=str;
FtpClient1.HostFileName:= str_file;
try
if FtpClient1.Put then
begin
ShowMessage('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD>');
frm_op_seae_edi_one.Caption:='<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>';
end;
except
FtpClient1.Abort;
ShowMessage('<27>ϴ<EFBFBD>ʧ<EFBFBD><CAA7>!');
frm_op_seae_edi_one.Caption:='<27>ϴ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>';
i_soi:=1;
end;
finally
FtpClient1.Abort;
end;
end;
{
if i_soi=0 then
if bsSkinCheckRadioBox1.Checked then
UpdateSOIStatus(1,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
else UpdateSOIStatus(0,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
}
//
if bsSkinCheckRadioBox1.Checked then
SIO:='SI'
else SIO:='SO';
if bsSkinRadioGroup1.ItemIndex=0 then
ORG:='ORG'
else ORG:='AMEND';
IF bsSkinCheckRadioBox2.Checked then
begin
MBL:='<27>ֵ<EFBFBD>';
MBLNO:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
end
else
begin
MBL:='<27><><EFBFBD><EFBFBD>';
MBLNO:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
end;
CARR:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring;
CORP:=frm_op_seae.t_op_seae.fieldbyname('ί<>е<EFBFBD>λ').asstring;
EMP:=employee;
EMPDAE:=FormatDateTime('YYYY-MM-DD hh:mm:ss',now);
ETD:=FormatDateTime('YYYY-MM-DD',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').value);
Insertt_op_Edi_Log(SIO,ORG,MBL,CARR,MBLNO,ETD,CORP,EMP,EMPDAE,str,edi);
end;
procedure Tfrm_op_seae_edi_one.bsSkinButton6Click(Sender: TObject);
var
Str:TStrings;
i:integer;
begin
// if not isEditrue(frm_op_seae.t_op_seae) then exit;
try
Str:=CreateVgmEdiFile;
SaveDialog1.FileName:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring;
if SaveDialog1.Execute then
begin
str.SaveToFile(SaveDialog1.FileName+'.txt');
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;
end;
function Tfrm_op_seae_edi_one.cutpkgs(kindpkg: string): string;
var
s:string;
l:Integer;
begin
if (kindpkg='') or (Length(kindpkg)=0) then
result:=kindpkg;
s:=kindpkg;
l:=Length(kindpkg);
if Copy(kindpkg,l,1)='S' THEN
result:=Copy(kindpkg,1,l-1);
end;
function Tfrm_op_seae_edi_one.cutmblno(mblno: string): string;
var
s:string;
l,j:Integer;
begin
if (mblno='') or (Length(mblno)=0) then
result:=mblno;
s:=mblno;
l:=Length(mblno);
if Copy(mblno,1,4)='ONEY' THEN
result:=Copy(mblno,5,l-4)
else result:=mblno;
end;
procedure Tfrm_op_seae_edi_one.bsSkinButton8Click(Sender: TObject);
var
str:widestring;
str_file:widestring;
ftpar,ftpname,ftppass,ftppath,ScriptPath:String;
StrL:TStrings;
i,j,i_soi:integer;
SenderCode,ReciverCode,strType:String;
dsstr,PostUrl:WideString;
begin
i_soi:=0;
if bsSkinCheckRadioBox2.Checked then
begin
if frm_op_seae_assistant=nil then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><>к<EFBFBD><D0BA>ᵥ)<29><><EFBFBD><EFBFBD>ͷֵ<CDB7>Edi');
exit;
end
end;
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
begin
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
begin
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
if not isEditrue(frm_op_seae.t_op_seae) then exit;
end;
end
else
begin
if not isEditrue(frm_op_seae.t_op_seae) then exit;
end;
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
ftpar:=Trim(edit4.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ<EFBFBD><D6B7>',mtWarning,[mbOk],0);
exit;
end;
ftpname:=Trim(edit6.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
exit;
end;
ftppass:=Trim(edit7.Text);
if ftpar='' then begin
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD>룡',mtWarning,[mbOk],0);
exit;
end;
ftppath:=Trim(edit5.Text);
strL:=Tstringlist.Create;
try
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:='4'
else strType:='9';
if frm_op_seae.dxdbgrid1.SelectedCount>1 then
begin
for i:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
begin
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[i]));
str:=ScriptPath
+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
str_file:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
StrL.Clear;
if bsSkinCheckRadioBox1.Checked then
strL.Add('00:IFTMIN:BOOKING:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39)
else
strL.Add('00:IFTMBF:BOOKING:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39);
if Trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
StrL.AddStrings(CreateEdiFile)
else if Pos('<27><>Ʊ',(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring))>0 then
StrL:=CreateZHUEdiFile
else begin
Exit;
end;
j:=strL.Count;
strL.Add('99:'+intToStr(j+1)+'''');
for j:=0 to StrL.Count-1 do begin
if IsZhongwen(StrL[j])<>'' then begin
MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41>Ȳ<EFBFBD><C8B2><EFBFBD>ַ<EFBFBD>,<2C><>ȥ<EFBFBD><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>',mtWarning,[mbYes],0);
exit;
end;
end;
strL.SaveToFile(str);
if FtpClient1.Connected then
begin
try
FtpClient1.TransferMode := ftpTransModeStream;
FtpClient1.LocalFileName:=str;
FtpClient1.HostFileName:= str_file;
try
if FtpClient1.Put then
begin
// ShowMessage('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD>');
frm_op_seae_edi_one.Caption:='<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>';
end;
except
FtpClient1.Abort;
// ShowMessage('<27>ϴ<EFBFBD>ʧ<EFBFBD><CAA7>!');
frm_op_seae_edi_one.Caption:='<27>ϴ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>';
i_soi:=1;
end;
finally
FtpClient1.Abort;
end;
end;
if i_soi=0 then
if bsSkinCheckRadioBox1.Checked then
UpdateSOIStatus(1,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
else UpdateSOIStatus(0,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
dsstr:=CreateSIEdiFile_MBL();
PostUrl:=get_parameters_value(2123,'http://www.myshipping.net:8657/Booking/ReceiveBookingData');
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then begin
TDsDjyThread.create(PostUrl,dsstr,'');
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
end;
if (not bsSkinCheckRadioBox1.Checked) and (frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger=10) then begin
dsstr:='{';
dsstr:=dsstr+'"orderNo":"'+frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString+'"';
dsstr:=dsstr+',"status":"N"';
dsstr:=dsstr+',"bookingId":"'+frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'"';
dsstr:=dsstr+',"bookingIdDate":"'+FormatDateTime('YYYY-MM-DD hh:mm:ss',frm_op_seae.t_op_seae.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime)+'"';
dsstr:=dsstr+'}';
PostUrl:=get_parameters_value(2124,'http://47.104.90.170:6857/api/clp/bookingMsgReceipt');
TDsHaierThread.create(PostUrl,dsstr,'',frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString);
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
end;
end;
ShowMessage('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD>');
end
else
begin
str:=ScriptPath
+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
str_file:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring
+FormatDateTime('yyyy',now)
+FormatDateTime('mm',now)
+FormatDateTime('dd',now)
+FormatDateTime('hh',now)
+FormatDateTime('nn',now)+'.txt';
StrL.Clear;
if bsSkinCheckRadioBox1.Checked then
strL.Add('00:IFTMIN:BOOKING:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39)
else
strL.Add('00:IFTMBF:BOOKING:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39);
if Trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
StrL.AddStrings(CreateEdiFile)
else if Pos('<27><>Ʊ',(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring))>0 then
StrL:=CreateZHUEdiFile
else begin
Exit;
end;
I:=strL.Count;
strL.Add('99:'+intToStr(i+1)+'''');
for j:=0 to StrL.Count-1 do begin
if IsZhongwen(StrL[j])<>'' then begin
MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41>Ȳ<EFBFBD><C8B2><EFBFBD>ַ<EFBFBD>,<2C><>ȥ<EFBFBD><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>',mtWarning,[mbYes],0);
exit;
end;
end;
strL.SaveToFile(str);
if FtpClient1.Connected then
begin
try
FtpClient1.TransferMode := ftpTransModeStream;
FtpClient1.LocalFileName:=str;
FtpClient1.HostFileName:= str_file;
try
if FtpClient1.Put then
begin
frm_op_seae_edi_one.Caption:='<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>';
end;
except
FtpClient1.Abort;
ShowMessage('<27>ϴ<EFBFBD>ʧ<EFBFBD><CAA7>!');
frm_op_seae_edi_one.Caption:='<27>ϴ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>';
i_soi:=1;
end;
finally
FtpClient1.Abort;
end;
end;
if i_soi=0 then
if bsSkinCheckRadioBox1.Checked then
UpdateSOIStatus(1,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)
else UpdateSOIStatus(0,frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
dsstr:=CreateSIEdiFile_MBL();
PostUrl:=get_parameters_value(2123,'http://www.myshipping.net:8657/Booking/ReceiveBookingData');
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring<>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then begin
TDsDjyThread.create(PostUrl,dsstr,'');
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
end;
if (not bsSkinCheckRadioBox1.Checked) and (frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger=10) then begin
dsstr:='{';
dsstr:=dsstr+'"orderNo":"'+frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString+'"';
dsstr:=dsstr+',"status":"N"';
dsstr:=dsstr+',"bookingId":"'+frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+'"';
dsstr:=dsstr+',"bookingIdDate":"'+FormatDateTime('YYYY-MM-DD hh:mm:ss',frm_op_seae.t_op_seae.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime)+'"';
dsstr:=dsstr+'}';
PostUrl:=get_parameters_value(2124,'http://47.104.90.170:6857/api/clp/bookingMsgReceipt');
TDsHaierThread.create(PostUrl,dsstr,'',frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString);
InsertSysLog('<27>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ',frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
end;
end;
finally
FreeAndNil(StrL)
end;
end;
function Tfrm_op_seae_edi_one.CreateSIEdiFile_MBL: string;
var
str,str2,codetype,codestr,strsql,typestr:string;
aAdoQuery:TAdoQuery;
isfirst:Boolean;
TempStr:TStringlist;
function getcustedi(cust:string):string;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
result:='';
try
aQuery.Close;
aQuery.SQL.Text:='select <20><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD> EDI<44><49><EFBFBD><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+cust+'''';
aQuery.Open;
if not aQuery.IsEmpty then
result:=aQuery.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').AsString;
if Result='' then result:=cust;
finally
FreeAndNil(aQuery);
end;
end;
function getempemail(emp:string):string;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
result:='';
try
aQuery.Close;
aQuery.SQL.Text:='select <20><><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+emp+'''';
aQuery.Open;
if not aQuery.IsEmpty then
result:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
finally
FreeAndNil(aQuery);
end;
end;
begin
str:=str+'{';
str:=str+'"COMPANY_NAME":"'+frm_data_share.t_sys_company.fieldbyname('ȫ<><C8AB>').AsString+'"';
str:=str+',"BOOKINGS":[';
str:=str+'{';
aAdoQuery:=CreateAdoQuery;
TempStr:=TStringList.Create;
try
if not bsSkinCheckRadioBox2.checked then
begin
str:=str+'"BSNO":"'+ frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"CUST_NO":"'+ frm_op_seae.t_op_seae.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"MBLNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'"';
str:=str+',"HBLNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'"';
str:=str+',"CONTRACTNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"SHIPPER":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"CONSIGNEE":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"NOTIFYPARTY":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"NOTIFYPARTY2":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"YARD":"'+getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring)+'"';
str:=str+',"VESSEL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"VOYNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"VoynoInner":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>κ<EFBFBD>').asstring+'"';
str:=str+',"ETD":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"CLOSINGDATE":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"CLOSEDOCDATE":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"ETA":"'+ frm_op_seae.t_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PLACERECEIPTID":""';
str:=str+',"PLACERECEIPT":""';
str:=str+',"PORTLOADID":"CNTAO"';
str:=str+',"PORTLOAD":"QINGDAO,CHINA"';
str:=str+',"PORTDISCHARGEID":"'+ frm_op_seae.t_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PORTDISCHARGE":"'+ frm_op_seae.t_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PLACEDELIVERYID":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PLACEDELIVERY":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring+'"';
str:=str+',"DESTINATIONID":"'+ frm_op_seae.t_op_seae.FieldByName('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring+'"';
str:=str+',"DESTINATION":"'+ frm_op_seae.t_op_seae.FieldByName('Ŀ<>ĵ<EFBFBD>').asstring+'"';
str:=str+',"NOBILL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"COPYNOBILLL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"ISSUETYPE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring+'"';
str:=str+',"ISSUEDATE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
// str:=str+',"ISSUEPLACEID":"'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring))+'"';
str:=str+',"ISSUEPLACE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring+'"';
str:=str+',"BLFRT":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring+'"';
str:=str+',"PREPARDAT":"'+ frm_op_seae.t_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring+'"';
str:=str+',"PAYABLEAT":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring+'"';
str:=str+',"SERVICE":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"MARKS":"'+StringReplace(frm_op_seae.t_op_seae.FieldByName('<27><>ͷ').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"HSCODE":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ʽ').asstring+'"';
str:=str+',"DESCRIPTION":"'+ StringReplace(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"PKGS":'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
str:=str+',"KINDPKGS":"'+ frm_op_seae.t_op_seae.FieldByName('<27><>װ').asstring+'"';
str:=str+',"KGS":'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
str:=str+',"CBM":'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
str:=str+',"CARRIER":"'+frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring+'"';
str:=str+',"CARGOID":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring+'"';
str:=str+',"DCLASS":"'+ frm_op_seae.t_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"DUNNO":"'+ frm_op_seae.t_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"DPAGE":""';
str:=str+',"DLABEL":""';
str:=str+',"LINKMAN":""';
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') then
str:=str+',"TEMPID":"C"'
else str:=str+',"TEMPID":""';
str:=str+',"TEMPSET":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"REEFERF":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"HUMIDITY":"'+ frm_op_seae.t_op_seae.FieldByName('ʪ<><CAAA>').asstring+'"';
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
str:=str+',"ISCONTAINERSOC":true'
else
str:=str+',"ISCONTAINERSOC":false';
strsql:='select * from t_op_ams where <20><><EFBFBD><EFBFBD>='
+#39+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
aAdoQuery.Close;
aAdoQuery.SQL.Text:=strsql;
aAdoQuery.Open;
str:=str+',"REMARK":"'+aAdoQuery.FieldByName('SI<53><49>ע').asstring+'"';
str:=str+',"EDIREMARK":"'+ frm_op_seae.t_op_seae.FieldByName('EDI<44><49>ע').asstring+'"';
str:=str+',"YardRemark":"'+ frm_op_seae.t_op_seae.FieldByName('<27><>ע').asstring+'"';
str:=str+',"PONO":"'+ frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring+'"';
str:=str+',"TOTALNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').asstring+'"';
str:=str+',"TEMPMIN":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"TEMPMAX":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"OP":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ͷ<EFBFBD>Ա').asstring+'"';
str:=str+',"DOC":""';
str:=str+',"SALE":""';
str:=str+',"CUSTSERVICE":""';
str:=str+',"VGM_TIME":""';
str:=str+',"CUSTOMERNAME":"'+ frm_op_seae.t_op_seae.FieldByName('ί<>е<EFBFBD>λ').asstring+'"';
str:=str+',"EMAIL":"'+getempemail(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>Ա').asstring)+'"';
str:=str+',"FORWARDER":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾').asstring+'"';
str:=str+',"SHIPAGENCY":""';
str:=str+',"CUSTOMSER":""';
str:=str+',"TRUCKER":""';
str:=str+',"AGENTID":""';
str:=str+',"CARRIERID":"'+ getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring)+'"';
str:=str+',"YARDID":"'+ getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring)+'"';
str:=str+',"YardContract":"'+ frm_op_seae.t_op_seae.FieldByName('<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>').asstring+'"';
str:=str+',"CUSTOMERID":""';
str:=str+',"FORWARDERID":""';
str:=str+',"SHIPAGENCYID":"'+frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"CUSTOMSERID":""';
str:=str+',"TRUCKERID":""';
str:=str+',"AGENTNAME":""';
str:=str+',"WEITUO":""';
str:=str+',"EDIATTN":""';
str:=str+',"EDIATTNTEL":""';
str:=str+',"EDIATTNEMAIL":""';
str:=str+',"CONSIGNEEDOORADDR":""';
str:=str+',"SHIPPERDOORADDR":""';
str:=str+',"SCACCODE":""';
str:=str+',"ITNCODE":""';
// str:=str+',"PREPARDAT_ID":"'+GetPortEdiID(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+'"';
str:=str+',"PAYABLEAT_ID":"'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring)+'"';
if (frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring='<27>۽ݷ᳡վ(FF)') or (frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring='<27>ݷ᳡վ') then begin
if (frm_op_seae.t_op_seae.FieldByName('<27><>α').AsBoolean) then
str:=str+',"FEE_SELF":true'
else
str:=str+',"FEE_SELF":false';
end else begin
str:=str+',"FEE_SELF":true';
end;
strsql:='select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='
+#39+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
aAdoQuery.Close;
aAdoQuery.SQL.Text:=strsql;
aAdoQuery.Open;
aAdoQuery.First;
str:=str+',"CtrnList":[';
isfirst:=true;
while not aAdoQuery.Eof do begin
if (isfirst) then str:=str+'{' else str:=str+',{';
str:=str+'"CTNALL":"'+StringReplace(aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asstring,'''','',[])+'"';
str:=str+',"CTNNUM":'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
str:=str+',"CNTRNO":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"SEALNO":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PKGS":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"KINDPKGS":"'+aAdoQuery.FieldByName('<27><>װ').asstring+'"';
str:=str+',"KGS":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"CBM":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"TAREWEIGHT":'+aAdoQuery.FieldByName('<27><>Ƥ<EFBFBD><C6A4>').asstring;
str:=str+',"WEIGHTYPE":"<22>ۼ<EFBFBD>"';
str:=str+',"WEIGHKGS":'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
str:=str+',"REMARK":""';
str:=str+'}';
isfirst:=false;
aAdoQuery.Next;
end;
str:=str+']';
end else begin
str:=str+'"BSNO":"'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'"';
str:=str+',"CUST_NO":"'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'"';
str:=str+',"MBLNO":"'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'"';
str:=str+',"HBLNO":"'+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring+'"';
str:=str+',"CONTRACTNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"SHIPPER":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"CONSIGNEE":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"NOTIFYPARTY":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"NOTIFYPARTY2":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"YARD":"'+getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring)+'"';
str:=str+',"VESSEL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"VOYNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"VoynoInner":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>κ<EFBFBD>').asstring+'"';
str:=str+',"ETD":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"CLOSINGDATE":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"CLOSEDOCDATE":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"ETA":"'+ frm_op_seae.t_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PLACERECEIPTID":""';
str:=str+',"PLACERECEIPT":""';
str:=str+',"PORTLOADID":"CNTAO"';
str:=str+',"PORTLOAD":"QINGDAO,CHINA"';
str:=str+',"PORTDISCHARGEID":"'+ frm_op_seae.t_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PORTDISCHARGE":"'+ frm_op_seae.t_op_seae.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PLACEDELIVERYID":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PLACEDELIVERY":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring+'"';
str:=str+',"DESTINATIONID":"'+ frm_op_seae.t_op_seae.FieldByName('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring+'"';
str:=str+',"DESTINATION":"'+ frm_op_seae.t_op_seae.FieldByName('Ŀ<>ĵ<EFBFBD>').asstring+'"';
str:=str+',"NOBILL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"COPYNOBILLL":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"ISSUETYPE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring+'"';
str:=str+',"ISSUEDATE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
// str:=str+',"ISSUEPLACEID":"'+GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring))+'"';
str:=str+',"ISSUEPLACE":"'+ frm_op_seae.t_op_seae.FieldByName('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring+'"';
str:=str+',"BLFRT":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring+'"';
str:=str+',"PREPARDAT":"'+ frm_op_seae.t_op_seae.FieldByName('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring+'"';
str:=str+',"PAYABLEAT":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring+'"';
str:=str+',"SERVICE":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"MARKS":"'+StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><>ͷ').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"HSCODE":"'+ frm_op_seae_assistant.t_op_seae_assistant.FieldByName('HS<48><53><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"DESCRIPTION":"'+ StringReplace(frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'"','\"',[rfReplaceAll])+'"';
str:=str+',"PKGS":'+ frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
str:=str+',"KINDPKGS":"'+frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><>װ').asstring+'"';
str:=str+',"KGS":'+ frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
str:=str+',"CBM":'+ frm_op_seae_assistant.t_op_seae_assistant.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
str:=str+',"CARRIER":"'+frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring+'"';
str:=str+',"CARGOID":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring+'"';
str:=str+',"DCLASS":"'+ frm_op_seae.t_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"DUNNO":"'+ frm_op_seae.t_op_seae.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"DPAGE":""';
str:=str+',"DLABEL":""';
str:=str+',"LINKMAN":""';
if (frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring='R') then
str:=str+',"TEMPID":"C"'
else str:=str+',"TEMPID":""';
str:=str+',"TEMPSET":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"REEFERF":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"HUMIDITY":"'+ frm_op_seae.t_op_seae.FieldByName('ʪ<><CAAA>').asstring+'"';
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
str:=str+',"ISCONTAINERSOC":true'
else
str:=str+',"ISCONTAINERSOC":false';
str:=str+',"REMARK":""';
str:=str+',"EDIREMARK":"'+frm_op_seae_assistant.t_op_seae_assistant.FieldByName('EDI<44><49>ע').asstring+'"';
str:=str+',"PONO":"'+ frm_op_seae.t_op_seae.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').asstring+'"';
str:=str+',"TOTALNO":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').asstring+'"';
str:=str+',"TEMPMIN":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"TEMPMAX":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"OP":"'+ frm_op_seae.t_op_seae.FieldByName('<27>ͷ<EFBFBD>Ա').asstring+'"';
str:=str+',"DOC":""';
str:=str+',"SALE":""';
str:=str+',"CUSTSERVICE":""';
str:=str+',"VGM_TIME":""';
str:=str+',"CUSTOMERNAME":"'+ frm_op_seae.t_op_seae.FieldByName('ί<>е<EFBFBD>λ').asstring+'"';
str:=str+',"EMAIL":"'+getempemail(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>Ա').asstring)+'"';
str:=str+',"FORWARDER":"'+ frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾').asstring+'"';
str:=str+',"SHIPAGENCY":""';
str:=str+',"CUSTOMSER":""';
str:=str+',"TRUCKER":""';
str:=str+',"AGENTID":""';
str:=str+',"CARRIERID":"'+ getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>˾').asstring)+'"';
str:=str+',"YARDID":"'+ getcustedi(frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring)+'"';
str:=str+',"CUSTOMERID":""';
str:=str+',"FORWARDERID":""';
str:=str+',"SHIPAGENCYID":"'+frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"CUSTOMSERID":""';
str:=str+',"TRUCKERID":""';
str:=str+',"AGENTNAME":""';
str:=str+',"WEITUO":""';
str:=str+',"EDIATTN":""';
str:=str+',"EDIATTNTEL":""';
str:=str+',"EDIATTNEMAIL":""';
str:=str+',"CONSIGNEEDOORADDR":""';
str:=str+',"SHIPPERDOORADDR":""';
str:=str+',"SCACCODE":""';
str:=str+',"ITNCODE":""';
// str:=str+',"PREPARDAT_ID":"'+GetPortEdiID(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring)+'"';
str:=str+',"PAYABLEAT_ID":"'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>').asstring)+'"';
if (frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring='<27>۽ݷ᳡վ(FF)') or (frm_op_seae.t_op_seae.FieldByName('<27><>վ').asstring='<27>ݷ᳡վ') then begin
if (frm_op_seae.t_op_seae.FieldByName('<27><>α').AsBoolean) then
str:=str+',"FEE_SELF":true'
else
str:=str+',"FEE_SELF":false';
end else begin
str:=str+',"FEE_SELF":true';
end;
strsql:='select * from t_op_ctn_fendan where <20><><EFBFBD><EFBFBD>='
+#39+frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('as_id').asstring+#39;
aAdoQuery.Close;
aAdoQuery.SQL.Text:=strsql;
aAdoQuery.Open;
aAdoQuery.First;
str:=str+',"CtrnList":[';
isfirst:=true;
while not aAdoQuery.Eof do begin
if (isfirst) then str:=str+'{' else str:=str+',{';
str:=str+'"CTNALL":"'+StringReplace(aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asstring,'''','',[])+'"';
str:=str+',"CTNNUM":'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
str:=str+',"CNTRNO":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"SEALNO":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"PKGS":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"KINDPKGS":"'+aAdoQuery.FieldByName('<27><>װ').asstring+'"';
str:=str+',"KGS":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"CBM":"'+aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD>').asstring+'"';
str:=str+',"TAREWEIGHT":0';
str:=str+',"WEIGHTYPE":"<22>ۼ<EFBFBD>"';
str:=str+',"WEIGHKGS":0';
str:=str+',"REMARK":""';
str:=str+'}';
isfirst:=false;
aAdoQuery.Next;
end;
str:=str+']';
end;
if (frm_data_share.t_crm_client_all.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae.FieldByName('ί<>е<EFBFBD>λ').asstring,[])) then begin
str:=str+',"CUSTOMER_INFO":{';
str:=str+'"CODENAME":"'+frm_data_share.t_crm_client_all.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString+'"';
str:=str+',"SHORTNAME":"'+frm_data_share.t_crm_client_all.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString+'"';
str:=str+',"DESCRIPTION":"'+frm_data_share.t_crm_client_all.fieldbyname('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString+'"';
str:=str+',"CONTRACT_LIST":[';
if (frm_op_seae.t_op_seae.FieldByName('<27>ͻ<EFBFBD><CDBB>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString<>'') then begin
aAdoQuery.Close;
aAdoQuery.SQL.Clear;
aAdoQuery.SQL.Add('select * from t_code_cust_mailproject_detail where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+frm_op_seae.t_op_seae.FieldByName('<27>ͻ<EFBFBD><CDBB>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>').AsString+''' and (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD><EFBFBD>֪ͨ'' or <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><EFBFBD><E1B5A5><EFBFBD>»<EFBFBD>ֽ'' or <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>'' )');
aAdoQuery.Open;
aAdoQuery.First;
isfirst:=true;
typestr:='BC';
while not aAdoQuery.Eof do begin
if (isfirst) then str:=str+'{' else str:=str+',{';
str:=str+'"EMAIL":"'+aAdoQuery.FieldByName('<27>ռ<EFBFBD><D5BC><EFBFBD>').asstring+'"';
if (aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>֪ͨ') then typestr:='BC';
if (aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><EFBFBD><E1B5A5><EFBFBD>»<EFBFBD>ֽ') then typestr:='TD';
if (aAdoQuery.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring='<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>') then typestr:='ZD';
str:=str+',"TYPE":"'+typestr+'"';
str:=str+'}';
isfirst:=false;
aAdoQuery.Next;
end;
end;
str:=str+']';
str:=str+'}';
end;
str:=str+'}';
str:=str+']';
str:=str+'}';
finally
FreeAndNil(aAdoQuery);
FreeAndNil(TempStr);
end;
Result:=str;
end;
end.