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.

2637 lines
97 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 crm_spxcompany;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, BusinessSkinForm, bsSkinCtrls, dxExEdtr, dxCntner, dxTL,
dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, Grids, DBGridEh, StdCtrls, Mask,
bsSkinBoxCtrls, u_op_seae_DsWebService, SoapHTTPClient, InvokeRegistry, Menus,
kbmMemTable, DBGrids, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdExplicitTLSClientServerBase, IdMessageClient, IdSMTPBase,
IdSMTP, IdMessage, IdAttachmentFile, FtpCli;
type
Tfrm_crm_spxcompany = class(TForm)
t_crm_spxcompany: TADOQuery;
t_crm_spxcompany1: TDataSource;
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinPanel2: TbsSkinPanel;
bsSkinPanel3: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
getseaeinfoqry: TADOQuery;
MT1: TkbmMemTable;
MT1Field: TStringField;
MT1Field2: TStringField;
MT1gs: TStringField;
MT1lxr: TStringField;
GetCtnQry: TADOQuery;
GetCompanyQry: TADOQuery;
edt1: TEdit;
MT1Field3: TStringField;
MT2: TkbmMemTable;
MT1UserID: TStringField;
MT1USERNAME: TStringField;
MT1Mobile: TStringField;
DS2: TDataSource;
MT2ORDER: TIntegerField;
GetEmployeeQry: TADOQuery;
bsSkinButton2: TbsSkinButton;
dxDBGrid2: TdxDBGrid;
dxDBGrid2Column1: TdxDBGridColumn;
dxDBGrid1: TdxDBGrid;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGrid2Column2: TdxDBGridColumn;
GetHDGSQry: TADOQuery;
MT2Email: TStringField;
MT1Email: TStringField;
SMTP1: TIdSMTP;
IdMsg: TIdMessage;
MT2DeptName: TStringField;
MT2Duty: TStringField;
dxDBGrid2Column3: TdxDBGridColumn;
dxDBGrid2Column4: TdxDBGridColumn;
Getctnds: TDataSource;
MT1Field4: TStringField;
dxDBGrid2Column5: TdxDBGridColumn;
FtpClient1: TFtpClient;
procedure FormShow(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinEdit1KeyPress(Sender: TObject; var Key: Char);
procedure bsSkinEdit2KeyPress(Sender: TObject; var Key: Char);
procedure bsSkinEdit3KeyPress(Sender: TObject; var Key: Char);
procedure bsSkinButton2Click(Sender: TObject);
procedure GetCompanyInfo(str: string);
procedure dxDBGrid1Click(Sender: TObject);
procedure edt1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure DBGrid1CellClick(Column: TColumn);
procedure dxDBGrid2DblClick(Sender: TObject);
procedure dxDBGrid2Click(Sender: TObject);
procedure SendEmail(sender, sendercompany, receiver, receivercompany: string);
private
mServiceSoap_Ds: DsWebServiceSoap;
mHttpRIO_ds: THTTPRIO;
hdgsSPXNO: string;
SPXUSER: string;
SenderCode,ReciverCode:string;
FtpAdress,FtpUser,FtpPassWord,FtpPath:string;
function formatAfrstr(str: string): string;
function isEditrue(EdiType,BillType:string;DataSet:TDataSet): boolean;
public
{ Public declarations }
moduleNames: string;
SOSI: integer;
procedure getwebservice_ds;
function AnsiStringToWideString(const strAnsi: AnsiString; codepage: word): WideString;
procedure GetUserInfo(str: string);
procedure SetCompany(str: string);
procedure SetHDGS(str: string);
procedure SetCurrCompany;
procedure SetSPXUSER(str: string);
procedure SetCanSearch(_cansearch:boolean);
procedure SetEmployee;
procedure SendMail(BSNO: string);
procedure SendMail_SI(BSNO: string);
function GetStrNum(str:String):integer;
function FormatListString(Old:TStrings;mCount,Strlength:integer):String;
function FormatEdiString(old:String;Strlength:integer):String;
function CreateEdiFile(EdiType,BillType:string):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 GetvesselEdi(avessel: String): String;
procedure SendSpBoxSO;
procedure SendWySo;
end;
var
frm_crm_spxcompany: Tfrm_crm_spxcompany;
dep_emp_insert: boolean;
dep_emp_name: string;
implementation
uses
u_main, my_sys_function, u_data_share, u_sys_dep_emp_delete, u_sys_progress,
u_sys_dep_emp_department, u_op_seae, u_tree_main, U_SelectLinkMan,
U_SetCompany, sys_regu, u_op_seae_edi_waiyun, u_op_seae_assistant;
{$R *.dfm}
function Tfrm_crm_spxcompany.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;
function Tfrm_crm_spxcompany.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_crm_spxcompany.FormatEdiString(old:String;Strlength:integer):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_crm_spxcompany.GetCntrEdi(cntrsize: 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_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_crm_spxcompany.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_crm_spxcompany.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_crm_spxcompany.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_crm_spxcompany.GetLengthword(var s: String; l: Integer;str:String): String;
var
i:Integer;
b:Boolean;
begin
s:='';
if Length(str)<l then begin
result:=str;
end else begin
b:=true;
s:=Copy(str,l+1,Length(str)-l);
str:=Copy(str,1,l);
result:='';
for i:=Length(str) downto 1 do begin
if ( not (str[i] in [' ',',','.',':','(',')'])) and b then
s:=str[i]+s
else begin
b:=false;
result:=str[i]+Result;
end;
end;
s:=s+' ';
end;
end;
procedure Tfrm_crm_spxcompany.FormShow(Sender: TObject);
var
str: widestring;
_i: Integer;
begin
GetCompanyInfo(hdgsSPXNO);
MT2.Locate('USERNAME', SPXUSER, []);
dxDBGrid2Click(self);
if (SOSI=1) then
bsSkinButton1.caption := '<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>'
else if (SOSI=0) then
bsSkinButton1.caption := '<27><><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD>'
else if (SOSI=2) then
bsSkinButton1.caption := 'ҵ<><D2B5>ת<EFBFBD><D7AA>';
end;
procedure Tfrm_crm_spxcompany.SendWySo;
var ValidMessage:string;
i:integer;
ScriptPath,FileType:string;
str,strType:widestring;
str_file:widestring;
StrL:TStrings;
begin
FtpAdress:=get_parameters_value(2122,'');
FtpUser:=get_parameters_value(2123,'');
FtpPassWord:=get_parameters_value(2124,'');
FtpPath:=get_parameters_value(2125,'');
SenderCode:=get_parameters_value(2126,'');
ReciverCode:=get_parameters_value(2127,'');
ValidMessage:='';
if FtpAdress='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ';
end;
if FtpUser='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD>';
end;
if FtpPassWord='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD><EFBFBD>';
end;
if FtpPath='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTPĿ¼';
end;
if SenderCode='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD><CBB7>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>';
end;
if ReciverCode='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><CBBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>';
end;
if trim(ValidMessage)<>'' then
begin
showmessage(ValidMessage);
Exit;
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('SO','MBL',frm_op_seae.t_op_seae) then exit;
end;
end
else
begin
if not isEditrue('SO','MBL',frm_op_seae.t_op_seae) then exit;
end;
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
if not DirectoryExists(ScriptPath) then
CreateDir(ScriptPath);
FileType:='BK_';
str:=ScriptPath
+FileType+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:=FileType+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
strType:='9';
strL.Add('00:IFTMBF:BK:'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+':2.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('S0','MBL'))
else
Exit;
end;
end
else
begin
if Trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
StrL.AddStrings(CreateEdiFile('S0','MBL'))
else
Exit;
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>'+StrL[i]+',<2C><>ȥ<EFBFBD><C8A5><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>',mtWarning,[mbYes],0);
exit;
end;
end;
strL.SaveToFile(str);
finally
FreeAndNil(StrL)
end;
FtpClient1.HostName:=FtpAdress;
FtpClient1.UserName:=FtpUser;
FtpClient1.PassWord:=FtpPassWord;
FtpClient1.Passive:=TRUE;
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_waiyun.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;
end;
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>');
end;
except
FtpClient1.Abort;
ShowMessage('<27>ϴ<EFBFBD>ʧ<EFBFBD><CAA7>!');
end;
finally
FtpClient1.Abort;
end;
end;
end;
function Tfrm_crm_spxcompany.isEditrue(EdiType,BillType:string;DataSet:TDataSet): boolean;
var
cntrs,ValidMessage:String;
t_op_ctn:TAdoQuery;
begin
result:=true;
ValidMessage:='';
if BillType='MBL' then
begin
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>';
end;
end
else if BillType='HBL' then
begin
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>';
end;
end;
if trim(DataSet.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD>ѷ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'װ<>۴<EFBFBD><DBB4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'װ<><D7B0><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'ж<><D0B6><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'Ŀ<>ĵز<C4B5><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'Ŀ<>ĵش<C4B5><D8B4><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'ǩ<><C7A9><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>';
if BillType='MBL' then
begin
if trim(DataSet.fieldbyname('<27><>װ').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(GetpkgsEdi(DataSet.fieldbyname('<27><>װ').asstring))='' then
ValidMessage:=ValidMessage+#13#10+'<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('<27><>ͷ').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>';
end
else
begin
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(GetpkgsEdi(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring))='' then
ValidMessage:=ValidMessage+#13#10+'<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>';
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>ͷ').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>';
end;
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
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
ValidMessage:=ValidMessage+#13#10+'Σ<><CEA3>Ʒ<EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
end;
if Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then begin
ValidMessage:=ValidMessage+#13#10+'Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>';
end;
if GetStrNum(Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring))<>4 then
begin
ValidMessage:=ValidMessage+#13#10+'Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD><34><CEBB><EFBFBD><EFBFBD>';
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
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>';
end;
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring)='' then
begin
ValidMessage:=ValidMessage+#13#10+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>';
end;
end;
t_op_ctn:=CreateAdoQuery;
try
if BillType='MBL' 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;
finally
Free;
end;
if trim(ValidMessage)<>'' then Result:=false;
end;
function Tfrm_crm_spxcompany.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;
function Tfrm_crm_spxcompany.CreateEdiFile(EdiType,BillType:string):TStrings;
var
str,sl1:Tstringlist;
sl:TStrings;
i,j,Count,l,M:integer;
strsql,strRmain,strtemp,S:string;
rs,aQuery2:Tadoquery;
wide_str:widestring;
k:integer;
strType,strorderno,ctnsource:string;
strDatetime:string;
function GetRemarksString:String;
var
TempStr:TStrings;
begin
TempStr:=TStringList.Create;
try
if BillType='MBL' 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 BillType='MBL' then
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString
else
TempStr.Text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
if Tempstr.Count<=9 then begin
Result:='18:';
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;
M,L:integer;
S:String;
begin
TempStr:=TStringList.Create;
try
if BillType='MBL' then
begin
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString;
end
else
TempStr.Text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString;
GetLengthTString(TempStr,35);
if Tempstr.Count<=9 then begin
Result:='19:';
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;
M,L:integer;
S:String;
begin
TempStr:=TStringList.Create;
try
if BillType='MBL' then
begin
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString;
end
else
TempStr.Text:=frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('֪ͨ<CDA8>˴<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:='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 trim(frm_op_seae.t_op_seae.fieldbyname('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').AsString)='' then Exit;
TempStr.Text:=frm_op_seae.t_op_seae.fieldbyname('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').AsString;
GetLengthTString(TempStr,35);
if Tempstr.Count<=6 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<=6 then begin
if M=1 then begin
s:='21:'+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:='23:'+FormatEdiString(Tempstr.Strings[L],0)+':';
end;
M:=M+1;
end;
S:=S+'''';
Str.Add(S);
result:='';
end;
finally
FreeAndNil(TempStr);
end;
end;
begin
SenderCode:=get_parameters_value(2126,'') ;
ReciverCode:=get_parameters_value(2127,'');
strType:='9';
str:=Tstringlist.Create;
sl:=Tstringlist.Create;
sl1:=Tstringlist.Create;
str.Clear;
Count:=0;
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('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
if BillType='MBL' then //<2F><><EFBFBD><EFBFBD>
begin
str.Add ('02:'+ strorderno //2 <20>˱<EFBFBD><CBB1><EFBFBD>
+':'+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //3 <20><EFBFBD><E1B5A5>
+':'+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
+':'+ ReciverCode //6 <20><><EFBFBD><EFBFBD><EFBFBD>ܶ<EFBFBD><DCB6>յ<EFBFBD><D5B5>˵Ĵ<CBB5><C4B4><EFBFBD>
+':::::::::::::' //7 8 9 10 11 12 13 14 15 16 17 18 19
+':' // 20
+#39);
end
else
begin
str.Add ('02:'+ strorderno //2 <20>˱<EFBFBD><CBB1><EFBFBD>
+':'+ trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) //3 <20><EFBFBD><E1B5A5>
+':'+ trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
+':'+ ReciverCode //6 <20><><EFBFBD><EFBFBD><EFBFBD>ܶ<EFBFBD><DCB6>յ<EFBFBD><D5B5>˵Ĵ<CBB5><C4B4><EFBFBD>
+':::::::::::::' //7 8 9 10 11 12 13 14 15 16 17 18 19
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) // 20
+#39);
end;
if BillType='MBL' then //<2F><><EFBFBD><EFBFBD>
begin
if trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
strtemp:='ORI'
else
strtemp:='EXP';
end
else
begin
if trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
strtemp:='ORI'
else
strtemp:='EXP';
end;
str.add('03:'+strtemp //2 <20><EFBFBD><E1B5A5><EFBFBD><EFBFBD>
+':' //3 <20>ᵥǩ<E1B5A5><C7A9><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
+':'+ trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) //4<>ᵥǩ<E1B5A5><C7A9><EFBFBD><EFBFBD>
+':'+ GetDatetime(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring),0) //5ǩ<35><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ get_fenshu(trim(frm_op_seae.t_op_seae.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring)) //6<><36><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B5A5><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring) //7Ԥ<37><D4A4><EFBFBD>ص<EFBFBD>
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').asstring) //8<><38><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>
+#39);
str.Add('11:' + trim(GetvesselEdi(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)) //2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //3 <20><><EFBFBD><EFBFBD>
+':'+ trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4<><34><EFBFBD><EFBFBD>
+':' //5<><35><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>
+':::::::::' //6-14 <20><><EFBFBD><EFBFBD>˾(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>
+#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
str.Add ('12:'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) // 2<>ջ<EFBFBD><D5BB>ش<EFBFBD><D8B4><EFBFBD>
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) //3
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) //4
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) //5
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //6
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring) //7
+':' //8
+':' //9
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //10
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) //11
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) //12
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) //13
+':::' // 14 15 16
+#39);
if BillType='MBL' then //<2F><><EFBFBD><EFBFBD>
begin
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:' //2
+':' //3
+':'+trim(frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4 PREPAID OR COLLECT <20><><EFBFBD>ʽ P/C/F/R/E/L
+':::::::'
+#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
end;
end
else
begin
if frm_data_share.t_code_free.locate('<27><><EFBFBD>ѷ<EFBFBD>ʽ',frm_op_seae_assistant.t_op_seae_assistant.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_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)+#39);
str.Add('15:' //2
+':' //3
+':'+trim(frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4 PREPAID OR COLLECT <20><><EFBFBD>ʽ P/C/F/R/E/L
+':::::::' //6-11
+#39); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӫ<EFBFBD><D3AA>
end;
end;
if BillType='MBL' 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;
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);
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 BillType='MBL' then
strRmain:=strRmain+'F:'+':'+':'+frm_data_share.t_crm_client_changzhan.fieldbyname('EDI<44><49><EFBFBD><EFBFBD>').asstring+':'+':'+ctnsource+#39 // 5 6 7 8 9
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+':'+':'+ctnsource+#39;
end
else
begin
if BillType='MBL' then
strRmain:=strRmain+'F:'+':'+':'+':'+':'+ctnsource+#39
else strRmain:=strRmain+'L:'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring)+':'+':'+':'+':'+ctnsource+#39;
end;
if BillType='MBL' 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; //4
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 ('40:'+Trim(GetCntrEdi(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)) //2 CTN. SIZE & TYPE <20><>װ<EFBFBD><D7B0><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //3 CTN. NUMBERS <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+strRmain);
Count:=Count+1;
rs.Next;
end;
rs.Close;
rs.Free;
except
on e:exception do
begin
rs.Close;
rs.Destroy;
exit;
end;
end;
end;
if BillType='MBL' then
begin
str.Add ('41'
+':1' // 2
+':' // 3
+':'+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(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 5
+':'+trim(GetpkgsEdi(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring)) // 6
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring) // 7
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27>ܼ<EFBFBD>').asstring) //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5> 8
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5> 9
+':' // 10
+':' // 11
+':' // 12
+':' // 13
+':' // 14
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 15
+':' // 16
+':' // 17
+':' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> // 18
+':' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> // 19
+':' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> // 20
+':' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> // 21
+#39);
end
else
begin //2 3
str.Add ('41'
+':1' // 2
+':' // 3
+':'+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(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 5
+':'+trim(GetpkgsEdi(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring)) // 6
+':'+trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><>װ').asstring) // 7
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27>ܼ<EFBFBD>').asstring) //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5> 8
+':'+trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ˵<D7B0><CBB5> 9
+':' // 10
+':' // 11
+':' // 12
+':' // 13
+':' // 14
+':'+trim(frm_op_seae_assistant.t_op_seae_assistant.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 15
+':' // 16
+':' // 17
+':' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> // 18
+':' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> // 19
+':' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> // 20
+':' // <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> // 21
+#39);
end;
IF trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' THEN
BEGIN
str.Add ('43:' // 2 Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>
+':' //3
+':' //4
+':' //5
+':' //6
+':' //7
+':' //8
+':' //9
+':' //10
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring) //11
+':' +'C' //12
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //13
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //14
+':' +trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //15
+':' //16
+'::::::::' //17 18 19 20--24
+#39);
END;
IF trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D'THEN
BEGIN
str.Add ('43:'+trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //2
+':' //3
+':'+trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //4
+':' //5
+':' //6
+':' //7
+':' //8
+':' //9
+'::' //10
+':' //11
+':' // 12
+':' // 13
+':' // 14
+'::::::::::' // 15---24
+#39);
END;
if BillType='MBL' then
sl1.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').AsString
else
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);
if BillType='MBL' then
sl1.Text:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString
else
sl1.Text:=frm_op_seae_assistant.t_op_seae_assistant.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);
// Str.Add(GetCARGODESCRIPTIONString);
ctnsource:='N';
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsBoolean then
ctnsource:='Y';
Count:=Count+11;
if trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
begin
if EDITYPE='SI' then
begin
if BILLTYPE='MBL' 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;
end;
try
rs:=CreateAdoQuery;
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) //2<><32><EFBFBD><EFBFBD>
+':'+Trim(GetCntrEdi(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)) //3<><33><EFBFBD>ͳߴ<CDB3>
+':'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4Ǧ<34><C7A6><EFBFBD><EFBFBD>
+':'+'M' //5 <20><>־<EFBFBD><D6BE><EFBFBD><EFBFBD>
+':'+'CA' //6 ʩ<>ӷ<EFBFBD>־<EFBFBD><D6BE>
+':'+'F' //7 <20><>״̬
+':'+trim(IntToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsInteger)) //8 <20><><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //9 <20><><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD>
+':' //10
+':'+trim(FloatToStr(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').AsFloat)) //11<31><31><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+':' //12 <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>
+''''
);
rs.Next;
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;
procedure Tfrm_crm_spxcompany.bsSkinButton1Click(Sender: TObject);
begin
{
if 1=1 then
// if t_crm_spxcompany.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString='<27><><EFBFBD><EFBFBD>' then
try
if not assigned(frm_op_seae_edi_WAIYUN) then
frm_op_seae_edi_WAIYUN:=Tfrm_op_seae_edi_WAIYUN.Create(application);
frm_op_seae_edi_WAIYUN.ShowModal;
finally
frm_op_seae_edi_WAIYUN.free;
frm_op_seae_edi_WAIYUN:=nil;
end
else
}
SendSpBoxSO;
end;
////
//20150430<33><30><EFBFBD><EFBFBD> <20><>Ϊ<EFBFBD><CEAA><EFBFBD>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD>webservice<63><65><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD><EFBFBD><EFBFBD>Ϣ
procedure Tfrm_crm_spxcompany.SendSpBoxSO;
var
SHIPPERID, AUDITOR, FORWARDER, CARRIER, BSNO, BH, mes, TargetCompany, receiver, OPType, inputby, onlinetimemark, onlinePosted, msg, searchmsg, CompanySPXNO, hdgs, hdgsSPXNO, emptyMES: string;
_s, _r, _state, block: WideString;
_l, p1, p2: Integer;
DT: TDateTime;
UserSPXNO, sendercompany, ShipingboxNo: string;
begin
if (SOSI=0) then
begin
msg := '';
getseaeinfoqry.Close;
getseaeinfoqry.SQL.text := 'select * from t_crm_client where <20><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>=''' + MT1.fieldbyname('gs').asstring + '''';
getseaeinfoqry.Open;
if (getseaeinfoqry.RecordCount = 0) then
begin
msg := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<' + MT1.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString + '>';
searchmsg := MT1.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
getseaeinfoqry.Close;
getseaeinfoqry.SQL.text := 'select <20><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD> as CARRIER from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=''' + frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring + '''';
getseaeinfoqry.Open;
CARRIER := getseaeinfoqry.fieldbyname('CARRIER').asstring;
{if (CARRIER='') then begin
if (msg='') then begin
msg:='<27><><EFBFBD><EFBFBD>˾<'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring+'>';
searchmsg:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring;
end else begin
msg:=msg+' <20><><EFBFBD><EFBFBD>˾<'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring+'>';
end;
end ; }
if (msg <> '') then
begin
showmessage(msg + ' δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣͬ<CFA2><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>У<EFBFBD>' + #13#10 + '<27><><EFBFBD><EFBFBD>ϵͳ<CFB5>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>ϵͳ<CFB5>еĵ<D0B5>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>' + #13#10 + '<27><><EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><D4B8><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>');
SetCompany(searchmsg);
exit;
end;
GetEmployeeQry.Close;
GetEmployeeQry.SQL.text := 'select * from t_sys_employee where <20><><EFBFBD><EFBFBD>=''' + employee + '''';
GetEmployeeQry.Open;
UserSPXNO := GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring;
GetEmployeeQry.Close;
GetEmployeeQry.SQL.text := 'select * from t_code_subcomp where <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>=(select <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>=''' + employee + ''')';
GetEmployeeQry.Open;
CompanySPXNO := GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring;
if (UserSPXNO = '') then
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣδͬ<CEB4><CDAC>"<22><>' + #13#10 + '<27><>ͨ<EFBFBD><CDA8><EFBFBD>ֻ<EFBFBD><D6BB>Ż<EFBFBD><C5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ѯ<EFBFBD><D1AF>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ShippingWebϵͳ<CFB5>ʻ<EFBFBD><CABB><EFBFBD>');
SetEmployee;
exit;
end;
//<2F><><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD>һ<EFBFBD><D2BB> <20><>ֹ<EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>кš<D0BA>
frm_op_seae.bsSkinButton2Click(Self);
getwebservice_ds;
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD>ܻ򲵻<DCBB><F2B2B5BB><EFBFBD><EFBFBD>
_s := '<?xml version="1.0" encoding="UTF-8" standalone="no"?> ';
_s := _s + '<BookingInfo xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s := _s + ' <Booking> ';
_s := _s + ' <BSNO>' + frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring + '</BSNO> ';
_s := _s + ' </Booking> ';
_s := _s + '</BookingInfo> ';
_state := mServiceSoap_Ds.GetBsnoInfo(_s);
p1 := frm_data_share.GettimePotion(1, '<Booking>', _state);
p2 := frm_data_share.GettimePotion(1, '</Booking>', _state);
block := Copy(_state, p1, p2 - p1);
onlinePosted := '0';
onlinePosted := frm_data_share.GetXMLValue('ISPOSTED', block);
if (onlinePosted = 'CI20150711000003') or (onlinePosted = 'CI20150711000005') or (onlinePosted = 'CI20150711000007') then
begin
if MessageDlg('<27>˶<EFBFBD><CBB6>յ<EFBFBD>֮ǰ<D6AE>ѷ<EFBFBD><D1B7>͹<EFBFBD><CDB9><EFBFBD>Ŀǰ<C4BF>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>г<EFBFBD><D0B3>أ<EFBFBD>ȷ<EFBFBD><C8B7>Ҫ<EFBFBD>ٴη<D9B4><CEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mrno then
begin
exit;
end;
// ShowMessage('<27>˶<EFBFBD><CBB6>յ<EFBFBD>֮ǰ<D6AE>ѷ<EFBFBD><D1B7>͹<EFBFBD>,Ŀǰ<C4BF>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>г<EFBFBD><D0B3><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ٴη<D9B4><CEB7>͡<EFBFBD>' + #13#10 + '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD>ϵ');
// Exit;
end
else if (onlinePosted = 'CI20150711000006') then
begin
//if MessageDlg('<27>˶<EFBFBD><CBB6>յ<EFBFBD>Ŀǰ<C4BF>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD>ܣ<EFBFBD><DCA3>ٴη<D9B4><CEB7><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>½<EFBFBD><C2BD>գ<EFBFBD>ȷ<EFBFBD><C8B7>Ҫ<EFBFBD>ٴη<D9B4><CEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mrno then begin
// exit;
//end;
ShowMessage('<27>˶<EFBFBD><CBB6>յ<EFBFBD>Ŀǰ<C4BF>ѱ<EFBFBD><D1B1>Է<EFBFBD><D4B7><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ٴη<D9B4><CEB7>͡<EFBFBD>' + #13#10 + '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD>ϵ');
Exit;
end
else if (onlinePosted = 'CI20150711000008') then
begin
//<2F><><EFBFBD><EFBFBD>
end
else if (pos('CI_S.O', onlinePosted) = 1) or (pos('CI_BLC', onlinePosted) = 1) then
begin
ShowMessage('<27>˶<EFBFBD><CBB6>յ<EFBFBD>Ŀǰ<C4BF><C7B0><EFBFBD><EFBFBD><EFBFBD>ɶ<EFBFBD><C9B6>ջ<EFBFBD><D5BB><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ٴη<D9B4><CEB7>͡<EFBFBD>' + #13#10 + '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD>ϵ');
Exit;
end;
if MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ''' + MT1.FieldByName('<27><>˾ȫ<CBBE><C8AB>').AsString + '''<27><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', mtWarning, [mbyes, mbno], 0) = mryes then
begin
DT := Now;
AUDITOR := MT1.FieldByName('lxr').AsString;
FORWARDER := MT1.FieldByName('gs').AsString;
if (AUDITOR = '') and (FORWARDER = '') then
begin
ShowMessage('<27><>ϵ<EFBFBD>˻<EFBFBD><CBBB><EFBFBD>˾<EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>кŲ<D0BA><C5B2>ܶ<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ');
exit;
end;
BH := frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
getctnqry.Close;
getctnqry.SQL.text := 'select ctn_id,(select <20><><EFBFBD><EFBFBD>EDI<44><49><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>=t_op_ctn.<2E><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><>ע,<2C><>װ,<2C>ߴ<EFBFBD> from t_op_ctn where <20><><EFBFBD><EFBFBD>=''' + BH + '''';
getctnqry.Open;
GetEmployeeQry.Close;
GetEmployeeQry.SQL.text := 'select e.*,(select top 1 <20><><EFBFBD><EFBFBD> from t_sys_company) companyname from t_sys_employee e where <20><><EFBFBD><EFBFBD>=''' + employee + '''';
GetEmployeeQry.Open;
if not t_crm_spxcompany.IsEmpty then
//ShowMessage('begin');
_s := '';
_s := '<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
_s := _s + '<BookingCargoSpace xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s := _s + ' <Head> ';
_s := _s + ' <OPID>' + frm_data_share.t_crm_client_weituo.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring + '</OPID> ';
_s := _s + ' <COMPANYID>' + CompanySPXNO + '</COMPANYID> ';
_s := _s + ' <OPTYPE>0</OPTYPE> ';
_s := _s + ' <OPTIME>' + datetimetostr(DT) + '</OPTIME> ';
_s := _s + ' <Version>1.0</Version> ';
_s := _s + ' </Head> ';
_s := _s + '<OpseaeList> ';
_s := _s + ' <Opseae> ';
_s := _s + ' <BSNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring) + '</BSNO> ';
_s := _s + ' <BSSTATUS>1</BSSTATUS> '; //0 δ<><20>Է<EFBFBD><D4B7><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_s := _s + ' <BSDATE>' + Formatdatetime('yyyy-mm-dd HH:nn:ss', Now()) + '</BSDATE> ';
_s := _s + ' <MBLNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + '</MBLNO> ';
_s := _s + ' <CUSTNO>' + '</CUSTNO> ';
_s := _s + ' <ETD>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</ETD> ';
//_s := _s + ' <CLOSINGDATE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</CLOSINGDATE> ';
_s := _s + ' <PORTLOAD>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) + '</PORTLOAD> ';
_s := _s + ' <PORTLOADID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) + '</PORTLOADID> ';
_s := _s + ' <PORTDISCHARGE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring) + '</PORTDISCHARGE> ';
_s := _s + ' <PORTDISCHARGEID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</PORTDISCHARGEID> ';
_s := _s + ' <DESTINATION>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) + '</DESTINATION> ';
_s := _s + ' <DESTINATIONID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) + '</DESTINATIONID> ';
_s := _s + ' <INPUTBY>' + formatAfrstr(GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring) + '</INPUTBY> ';
_s := _s + ' <AUDITOR>' + formatAfrstr(AUDITOR) + '</AUDITOR> '; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_s := _s + ' <FORWARDER>' + formatAfrstr(FORWARDER) + '</FORWARDER> ';
_s := _s + ' <CARRIER>' + formatAfrstr(CARRIER) + '</CARRIER> '; //<2F><><EFBFBD><EFBFBD>˾
_s := _s + ' <CNTR>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring) + '</CNTR> ';
_s := _s + ' <VESSEL>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</VESSEL> ';
_s := _s + ' <VOYNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</VOYNO> ';
_s := _s + ' <ISSUEPLACE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) + '</ISSUEPLACE> ';
_s := _s + ' <SHIPPER>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring)+ '</SHIPPER> ';
_s := _s + ' <SHIPPERID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</SHIPPERID> ';
_s := _s + ' <CONSIGNEE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring) + '</CONSIGNEE> ';
_s := _s + ' <NOTIFYPARTY>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring) + '</NOTIFYPARTY> ';
_s := _s + ' <DESCRIPTION>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</DESCRIPTION> ';
_s := _s + ' <NOPKGS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ').asstring) + '</NOPKGS> ';
_s := _s + ' <PKGS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</PKGS> ';
_s := _s + ' <KINDPKGS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring) + '</KINDPKGS> ';
_s := _s + ' <GROSSWEIGHT>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</GROSSWEIGHT> ';
_s := _s + ' <KGS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</KGS> ';
_s := _s + ' <MEASUREMENT>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</MEASUREMENT> ';
_s := _s + ' <CBM>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CBM> ';
_s := _s + ' <BOOKINGDESCRIPTION>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>˵<EFBFBD><CBB5>').asstring) + '</BOOKINGDESCRIPTION> ';
_s := _s + ' <PLACEDELIVERY>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) + '</PLACEDELIVERY> ';
_s := _s + ' <PLACEDELIVERYID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</PLACEDELIVERYID> ';
_s := _s + ' <SERVICE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</SERVICE> ';
_s := _s + ' <BLFRT>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring) + '</BLFRT> ';
_s := _s + ' <MARKS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asstring) + '</MARKS> ';
_s := _s + ' <TOTALNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').asstring) + '</TOTALNO> ';
_s := _s + ' <CARGOID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) + '</CARGOID> ';
_s := _s + ' <PAYABLEAT>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) + '</PAYABLEAT> ';
_s := _s + ' <CONTRACTNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring) + '</CONTRACTNO> ';
_s := _s + ' <COMPANYID>' + formatAfrstr(CompanySPXNO) + '</COMPANYID> ';
//ѭ<><D1AD>ctn<74>б<EFBFBD>
getctnqry.First;
while not getctnqry.Eof do
begin
with getctnqry do
begin
_s := _s + ' <CTNINFO> ';
_s := _s + ' <CTN_ID>' + formatAfrstr(fieldbyname('ctn_id').asstring) + '</CTN_ID> ';
_s := _s + ' <BSNO>BSNO</BSNO> ';
_s := _s + ' <BSTYPE>1</BSTYPE> ';
_s := _s + ' <CTNCODE>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CTNCODE> ';
_s := _s + ' <CTN>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CTN> ';
if (fieldbyname('<27><><EFBFBD><EFBFBD>').asstring = '') then
begin
_s := _s + ' <CTNNUM>0</CTNNUM> ';
end
else
begin
_s := _s + ' <CTNNUM>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CTNNUM> ';
end;
_s := _s + ' <CNTRNO>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CNTRNO> ';
_s := _s + ' <SEALNO>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</SEALNO> ';
if (fieldbyname('<27><><EFBFBD><EFBFBD>').asstring = '') then
begin
_s := _s + ' <PKGS>0</PKGS> ';
end
else
begin
_s := _s + ' <PKGS>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</PKGS> ';
end;
if (fieldbyname('<27><><EFBFBD><EFBFBD>').asstring = '') then
begin
_s := _s + ' <KGS>0</KGS> ';
end
else
begin
_s := _s + ' <KGS>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</KGS> ';
end;
if (fieldbyname('<27><><EFBFBD><EFBFBD>').asstring = '') then
begin
_s := _s + ' <CBM>0</CBM> ';
end
else
begin
_s := _s + ' <CBM>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CBM> ';
end;
_s := _s + ' <REMARK>' + formatAfrstr(fieldbyname('<27><>ע').asstring) + '</REMARK> ';
_s := _s + ' <KINDPKGS>' + formatAfrstr(fieldbyname('<27><>װ').asstring) + '</KINDPKGS> ';
_s := _s + ' <SIZE>' + formatAfrstr(fieldbyname('<27>ߴ<EFBFBD>').asstring) + '</SIZE> ';
_s := _s + ' <INPUTBY>' + GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring + '</INPUTBY> ';
_s := _s + ' </CTNINFO> ';
Next;
end;
end;
_s := _s + ' </Opseae> ';
_s := _s + '</OpseaeList> ';
_s := _s + '</BookingCargoSpace> ';
//ShowMessage('before send');
//WriteLog(_s);
_r := mServiceSoap_Ds.SendBookingCargoSpace(_s);
//<2F><><EFBFBD><EFBFBD>Ʊҵ<C6B1><D2B5><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ѡ<EFBFBD><D1A1>˾
hdgsSPXNO := FORWARDER;
GetHDGSQry.close;
GetHDGSQry.Parameters.ParamByName('hdgsSPXNO').Value := hdgsSPXNO;
GetHDGSQry.Open;
hdgs := GetHDGSQry.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ (table:Tadoquery;receiver,spxno,OPType:string);
if (pos('<27><EFBFBD>ɹ<EFBFBD>___', _r) = 1) then
begin
mes := '<27><EFBFBD>ɹ<EFBFBD>___';
//showmessage('<27><EFBFBD>ɹ<EFBFBD>');
BSNO := StringReplace(_r, mes, '', [rfReplaceAll]);
frm_op_seae.t_op_seae.Edit;
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>'] := BSNO;
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'] := hdgs;
frm_op_seae.t_op_seae.Post;
Booking_add(frm_op_seae.t_op_seae, frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring, MT1.fieldbyname('<27><>ϵ<EFBFBD><CFB5>').asstring, MT1.fieldbyname('<27><>˾ȫ<CBBE><C8AB>').asstring, BSNO, '<27><><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD>');
frm_crm_spxcompany.close;
SendMail(BSNO);
end
else if (pos('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>___', _r) = 1) then
begin
BSNO := frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring;
Booking_add(frm_op_seae.t_op_seae, frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring, MT1.fieldbyname('<27><>ϵ<EFBFBD><CFB5>').asstring, MT1.fieldbyname('<27><>˾ȫ<CBBE><C8AB>').asstring, BSNO, '<27><><EFBFBD>Ƿ<EFBFBD><C7B7>Ͷ<EFBFBD><CDB6><EFBFBD>');
frm_crm_spxcompany.close;
SendMail(BSNO);
end
else if (pos('<27>ɶ<EFBFBD><C9B6>յ<EFBFBD><D5B5>Է<EFBFBD><D4B7>Ѿܾ<D1BE><DCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>___', _r) = 1) then
begin
mes := '<27>ɶ<EFBFBD><C9B6>յ<EFBFBD><D5B5>Է<EFBFBD><D4B7>Ѿܾ<D1BE><DCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>___';
showmessage('ԭ<><D4AD><EFBFBD>յ<EFBFBD><D5B5>Է<EFBFBD><D4B7>Ѿܾ<D1BE><DCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4>Է<EFBFBD><D4B7><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>');
BSNO := StringReplace(_r, mes, '', [rfReplaceAll]);
frm_op_seae.t_op_seae.Edit;
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>'] := BSNO;
frm_op_seae.t_op_seae.Edit;
frm_op_seae.t_op_seae['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾'] := hdgs;
frm_op_seae.t_op_seae.Post;
Booking_add(frm_op_seae.t_op_seae, frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring
, MT1.fieldbyname('<27><>ϵ<EFBFBD><CFB5>').asstring
, MT1.fieldbyname('<27><>˾ȫ<CBBE><C8AB>').asstring, BSNO, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD>');
//SendEmail(employee,GetEmployeeQry.fieldbyname('companyname').asstring,MT1.fieldbyname('<27><>ϵ<EFBFBD><CFB5>').asstring,MT1.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring);
frm_crm_spxcompany.close;
SendMail(BSNO);
end
else
showmessage(_r);
end;
end
else ////////////////////////////////////////////////////////////////////////////////////
if (SOSI=1) then
begin
//<2F>ᵥȷ<E1B5A5><C8B7>
msg := '';
if trim(frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) <> '<27><>ͨ<EFBFBD><CDA8>' then
begin
// showmessage('ֻ<><D6BB><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>ſ<EFBFBD><C5BF>Է<EFBFBD><D4B7><EFBFBD>');
// exit;
end;
ShipingboxNo := frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring;
if ShipingboxNo = '' then
begin
showmessage('û<>ж<EFBFBD><D0B6><EFBFBD>,<2C><><EFBFBD>ȷ<EFBFBD><C8B7>Ͷ<EFBFBD><CDB6><EFBFBD>,<2C>ٷ<EFBFBD><D9B7>ᵥȷ<E1B5A5><C8B7><EFBFBD><EFBFBD>Ϣ');
exit;
end;
//<2F><><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD>һ<EFBFBD><D2BB> <20><>ֹ<EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>кš<D0BA>
frm_op_seae.bsSkinButton2Click(Self);
GetEmployeeQry := CreateAdoQuery;
GetHDGSQry := CreateAdoQuery;
GetEmployeeQry.Close;
GetEmployeeQry.SQL.text := 'select * from t_sys_employee where <20><><EFBFBD><EFBFBD>=''' + employee + '''';
GetEmployeeQry.Open;
UserSPXNO := GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring;
GetEmployeeQry.Close;
GetEmployeeQry.SQL.text := 'select * from t_code_subcomp where <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>=(select <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>=''' + employee + ''')';
GetEmployeeQry.Open;
CompanySPXNO := GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring;
getwebservice_ds;
//<2F><>ȡ<EFBFBD>ᵥȷ<E1B5A5>Ϲ<EFBFBD><CFB9><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD>ܻ򲵻<DCBB><F2B2B5BB><EFBFBD><EFBFBD>
_s := '<?xml version="1.0" encoding="UTF-8" standalone="no"?> ';
_s := _s + '<BookingInfo xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s := _s + ' <Booking> ';
_s := _s + ' <BSNO>' + ShipingboxNo + '</BSNO> ';
_s := _s + ' </Booking> ';
_s := _s + '</BookingInfo> ';
_state := mServiceSoap_Ds.GetBsnoInfo(_s);
p1 := frm_data_share.GettimePotion(1, '<Booking>', _state);
p2 := frm_data_share.GettimePotion(1, '</Booking>', _state);
block := Copy(_state, p1, p2 - p1);
onlinePosted := '0';
onlinePosted := frm_data_share.GetXMLValue('CI_BLC', block);
{if onlinePosted <> 'CI_S.O_Rec' then
begin
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><<3C><><EFBFBD><EFBFBD>֪ͨ><3E><>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><>ӷ<EFBFBD><D3B7><EFBFBD><<3C>ᵥȷ<E1B5A5><C8B7>><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><<3C><><EFBFBD><EFBFBD>֪ͨ><3E>޷<EFBFBD><DEB7><EFBFBD>ȷ<EFBFBD>շ<EFBFBD><><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', mtWarning, [mbyes, mbno], 0) = mrno then
begin
exit;
end;
end; }
if onlinePosted = 'CI_BLC_Send' then
begin
if MessageDlg('<27><><<3C>ᵥȷ<E1B5A5><C8B7>><3E>ѷ<EFBFBD><D1B7>͹<EFBFBD><CDB9><EFBFBD>ȷ<EFBFBD><C8B7>Ҫ<EFBFBD>ٴη<D9B4><CEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', mtWarning, [mbyes, mbno], 0) = mrno then
begin
exit;
end;
end;
if onlinePosted = 'CI_BLC_Refuse' then
begin
if MessageDlg('<27><><<3C>ᵥȷ<E1B5A5><C8B7>><3E>ѷ<EFBFBD><D1B7>͹<EFBFBD>, <20>ᵥȷ<E1B5A5>Ͼܾ<CFBE><DCBE><EFBFBD><><C8B7>Ҫ<EFBFBD>ٴη<D9B4><CEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', mtWarning, [mbyes, mbno], 0) = mrno then
begin
exit;
end;
end;
//123.57.17.72 dssoft1401
if (onlinePosted = 'CI_BLC_Rec') then
begin
showmessage('<27><><<3C>ᵥȷ<E1B5A5><C8B7>><3E>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD>ܣ<EFBFBD>ȷ<EFBFBD><C8B7>Ҫ<EFBFBD>ٴη<D9B4><CEB7><EFBFBD><EFBFBD><EFBFBD>');
//exit;
end;
if MessageDlg('ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><<3C>ᵥȷ<E1B5A5><C8B7>><3E><><EFBFBD><EFBFBD>', mtWarning, [mbyes, mbno], 0) = mryes then
begin
DT := Now;
end
else
Exit;
AUDITOR := MT1.FieldByName('lxr').AsString;
FORWARDER := MT1.FieldByName('gs').AsString;
if (AUDITOR = '') and (FORWARDER = '') then
begin
ShowMessage('<27><>ϵ<EFBFBD>˻<EFBFBD><CBBB><EFBFBD>˾<EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>кŲ<D0BA><C5B2>ܶ<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ');
exit;
end;
BH := frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
getctnqry.Close;
getctnqry.SQL.text := 'select ctn_id,(select <20><><EFBFBD><EFBFBD>EDI<44><49><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>=t_op_ctn.<2E><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><>ע,<2C><>װ,<2C>ߴ<EFBFBD> from t_op_ctn where <20><><EFBFBD><EFBFBD>=''' + BH + '''';
getctnqry.Open;
GetEmployeeQry.Close;
GetEmployeeQry.SQL.text := 'select e.*,(select top 1 <20><><EFBFBD><EFBFBD> from t_sys_company) companyname from t_sys_employee e where <20><><EFBFBD><EFBFBD>=''' + employee + '''';
GetEmployeeQry.Open;
//20150724 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ <20><><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĵؼ<C4B5>װ<EFBFBD><D7B0>Ϊ<EFBFBD><CEAA> <20><><EFBFBD><EFBFBD>˳<EFBFBD>
emptyMES := '';
if frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring = '' then
emptyMES := 'װ<><D7B0><EFBFBD><EFBFBD>';
if frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring = '' then
emptyMES := emptyMES + ' ж<><D0B6><EFBFBD><EFBFBD>';
if frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring = '' then
emptyMES := emptyMES + ' Ŀ<>ĵ<EFBFBD>';
if frm_op_seae.t_op_seae.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring = '' then
emptyMES := emptyMES + ' <20><>װ<EFBFBD><D7B0>';
if emptyMES <> '' then
begin
ShowMessage(emptyMES + ' <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD>Ϊ<EFBFBD><CEAA>');
exit;
end;
if 1 = 1 then
begin
_s := '';
_s := '<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
_s := _s + '<BookingCargoSpace xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s := _s + ' <Head> ';
_s := _s + ' <OPID>' + UserSPXNO + '</OPID> ';
_s := _s + ' <COMPANYID>' + CompanySPXNO + '</COMPANYID> ';
_s := _s + ' <OPTYPE>0</OPTYPE> ';
_s := _s + ' <OPTIME>' + datetimetostr(DT) + '</OPTIME> ';
_s := _s + ' <Version>1.0</Version> ';
_s := _s + ' </Head> ';
_s := _s + '<OpseaeList> ';
_s := _s + ' <Opseae> ';
_s := _s + ' <BSNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring) + '</BSNO> ';
_s := _s + ' <BSSTATUS>CI_BLC_Send</BSSTATUS> '; //<2F><EFBFBD><E1B5A5>ȷ<EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD> //YY
_s := _s + ' <BSDATE>' + Formatdatetime('yyyy-mm-dd HH:nn:ss', Now()) + '</BSDATE> ';
_s := _s + ' <MBLNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').asstring) + '</MBLNO> '; //y
_s := _s + ' <CUSTNO>' + '</CUSTNO> ';
_s := _s + ' <ETD>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</ETD> ';
_s := _s + ' <CLOSINGDATE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</CLOSINGDATE> ';
_s := _s + ' <PORTLOAD>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)+ '</PORTLOAD> '; //Y
_s := _s + ' <PORTLOADID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) + '</PORTLOADID> ';
_s := _s + ' <PORTDISCHARGE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring) + '</PORTDISCHARGE> '; //Y
_s := _s + ' <PORTDISCHARGEID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</PORTDISCHARGEID> ';
_s := _s + ' <DESTINATION>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring) + '</DESTINATION> '; //Y
_s := _s + ' <DESTINATIONID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring) + '</DESTINATIONID> ';
_s := _s + ' <INPUTBY>' + formatAfrstr(GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring) + '</INPUTBY> ';
_s := _s + ' <AUDITOR>' + formatAfrstr(AUDITOR) + '</AUDITOR> '; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
_s := _s + ' <FORWARDER>' + formatAfrstr(FORWARDER) + '</FORWARDER> ';
_s := _s + ' <CARRIER>' + formatAfrstr(CARRIER) + '</CARRIER> '; //<2F><><EFBFBD><EFBFBD>˾
_s := _s + ' <CNTR>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring) + '</CNTR> '; //y
_s := _s + ' <VESSEL>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</VESSEL> '; //y
_s := _s + ' <VOYNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</VOYNO> '; //y
_s := _s + ' <ISSUEPLACE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) + '</ISSUEPLACE> ';
_s := _s + ' <SHIPPER>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring) + '</SHIPPER> '; //y
_s := _s + ' <SHIPPERID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</SHIPPERID> ';
_s := _s + ' <CONSIGNEE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring) + '</CONSIGNEE> '; //Y
_s := _s + ' <NOTIFYPARTY>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring) + '</NOTIFYPARTY> '; //Y
_s := _s + ' <DESCRIPTION>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</DESCRIPTION> '; //y
_s := _s + ' <NOPKGS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ').asstring) + '</NOPKGS> ';
_s := _s + ' <PKGS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</PKGS> '; //y
_s := _s + ' <KINDPKGS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><>װ').asstring) + '</KINDPKGS> '; //y
_s := _s + ' <GROSSWEIGHT>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</GROSSWEIGHT> ';
_s := _s + ' <KGS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</KGS> '; //y
_s := _s + ' <MEASUREMENT>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</MEASUREMENT> ';
_s := _s + ' <CBM>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CBM> '; //y
_s := _s + ' <BOOKINGDESCRIPTION>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>˵<EFBFBD><CBB5>').asstring) + '</BOOKINGDESCRIPTION> ';
_s := _s + ' <REMARK>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><>ע').asstring) + '</REMARK> '; //y
_s := _s + ' <PLACEDELIVERY>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) + '</PLACEDELIVERY> ';
_s := _s + ' <PLACEDELIVERYID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) + '</PLACEDELIVERYID> ';
_s := _s + ' <SERVICE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) + '</SERVICE> '; //Y HSCODE
_s := _s + ' <HSCODE>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ʽ').asstring) + '</HSCODE> '; //Y
_s := _s + ' <BLFRT>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring) + '</BLFRT> '; //y
_s := _s + ' <MARKS>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><>ͷ').asstring) + '</MARKS> '; //y
_s := _s + ' <TOTALNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').asstring) + '</TOTALNO> '; //y
_s := _s + ' <CARGOID>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring) + '</CARGOID> ';
_s := _s + ' <PAYABLEAT>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) + '</PAYABLEAT> ';
_s := _s + ' <CONTRACTNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring) + '</CONTRACTNO> '; //y
_s := _s + ' <COMPANYID>' + CompanySPXNO + '</COMPANYID> ';
//ѭ<><D1AD>ctn<74>б<EFBFBD>
getctnqry.First;
while not getctnqry.Eof do
begin
with getctnqry do
begin
_s := _s + ' <CTNINFO> ';
_s := _s + ' <CTN_ID>' + fieldbyname('ctn_id').asstring + '</CTN_ID> ';
_s := _s + ' <BSNO>BSNO</BSNO> ';
_s := _s + ' <BSTYPE>1</BSTYPE> ';
_s := _s + ' <CTNCODE>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CTNCODE> ';
_s := _s + ' <CTN>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CTN> ';
if (fieldbyname('<27><><EFBFBD><EFBFBD>').asstring = '') then
begin
_s := _s + ' <CTNNUM>0</CTNNUM> ';
end
else
begin
_s := _s + ' <CTNNUM>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CTNNUM> ';
end;
_s := _s + ' <CNTRNO>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CNTRNO> ';
_s := _s + ' <SEALNO>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</SEALNO> ';
if (fieldbyname('<27><><EFBFBD><EFBFBD>').asstring = '') then
begin
_s := _s + ' <PKGS>0</PKGS> ';
end
else
begin
_s := _s + ' <PKGS>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</PKGS> ';
end;
if (fieldbyname('<27><><EFBFBD><EFBFBD>').asstring = '') then
begin
_s := _s + ' <KGS>0</KGS> ';
end
else
begin
_s := _s + ' <KGS>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</KGS> ';
end;
if (fieldbyname('<27><><EFBFBD><EFBFBD>').asstring = '') then
begin
_s := _s + ' <CBM>0</CBM> ';
end
else
begin
_s := _s + ' <CBM>' + formatAfrstr(fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) + '</CBM> ';
end;
_s := _s + ' <REMARK>' + formatAfrstr(fieldbyname('<27><>ע').asstring) + '</REMARK> ';
_s := _s + ' <KINDPKGS>' + formatAfrstr(fieldbyname('<27><>װ').asstring) + '</KINDPKGS> ';
_s := _s + ' <SIZE>' + formatAfrstr(fieldbyname('<27>ߴ<EFBFBD>').asstring) + '</SIZE> ';
_s := _s + ' <INPUTBY>' + formatAfrstr(GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring) + '</INPUTBY> ';
_s := _s + ' </CTNINFO> ';
Next;
end;
end;
_s := _s + ' </Opseae> ';
_s := _s + '</OpseaeList> ';
_s := _s + '</BookingCargoSpace> ';
//WriteLog(_s);
_r := mServiceSoap_Ds.BillOfLadingConfirm(_s);
//showmessage(_s);
//<2F><><EFBFBD><EFBFBD>Ʊҵ<C6B1><D2B5><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ѡ<EFBFBD><D1A1>˾
hdgsSPXNO := FORWARDER;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ (table:Tadoquery;receiver,spxno,OPType:string);
if (pos('<27><EFBFBD>ɹ<EFBFBD>___', _r) = 1) then
begin
mes := '<27><EFBFBD>ɹ<EFBFBD>___';
//showmessage('<27><EFBFBD>ɹ<EFBFBD>');
BSNO := frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring;
Booking_add(frm_op_seae.t_op_seae, frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring
, MT1.fieldbyname('<27><>ϵ<EFBFBD><CFB5>').asstring, MT1.fieldbyname('<27><>˾ȫ<CBBE><C8AB>').asstring, BSNO, '<27><><EFBFBD><EFBFBD><EFBFBD>ᵥȷ<E1B5A5><C8B7>');
SendMail_SI(BSNO);
frm_crm_spxcompany.close;
end
else if (pos('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>___', _r) = 1) then
begin
//showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>');
Booking_add(frm_op_seae.t_op_seae, frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring
, MT1.fieldbyname('<27><>ϵ<EFBFBD><CFB5>').asstring, MT1.fieldbyname('<27><>˾ȫ<CBBE><C8AB>').asstring, BSNO, '<27><><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ᵥȷ<E1B5A5><C8B7>');
SendMail_SI(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring);
frm_crm_spxcompany.close;
end
else
showmessage(_r);
end;
try
finally
GetEmployeeQry.free;
GetHDGSQry.free;
end;
end else
if (SOSI=2) then
begin
//ҵ<><D2B5>ת<EFBFBD><D7AA>
msg := '';
if trim(frm_op_seae.t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) <> '<27><>ͨ<EFBFBD><CDA8>' then
begin
// showmessage('ֻ<><D6BB><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>ſ<EFBFBD><C5BF>Է<EFBFBD><D4B7><EFBFBD>');
// exit;
end;
ShipingboxNo := frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring;
if ShipingboxNo = '' then
begin
showmessage('û<>ж<EFBFBD><D0B6><EFBFBD>,<2C>޷<EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>');
exit;
end;
//<2F><><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD>һ<EFBFBD><D2BB> <20><>ֹ<EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>кš<D0BA>
frm_op_seae.bsSkinButton2Click(Self);
GetEmployeeQry := CreateAdoQuery;
GetHDGSQry := CreateAdoQuery;
GetEmployeeQry.Close;
GetEmployeeQry.SQL.text := 'select * from t_sys_employee where <20><><EFBFBD><EFBFBD>=''' + employee + '''';
GetEmployeeQry.Open;
UserSPXNO := GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring;
GetEmployeeQry.Close;
GetEmployeeQry.SQL.text := 'select * from t_code_subcomp where <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>=(select <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>=''' + employee + ''')';
GetEmployeeQry.Open;
CompanySPXNO := GetEmployeeQry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring;
getwebservice_ds;
//<2F><>ȡ<EFBFBD>ᵥȷ<E1B5A5>Ϲ<EFBFBD><CFB9><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD>ܻ򲵻<DCBB><F2B2B5BB><EFBFBD><EFBFBD>
_s := '<?xml version="1.0" encoding="UTF-8" standalone="no"?> ';
_s := _s + '<BookingInfo xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s := _s + ' <Booking> ';
_s := _s + ' <BSNO>' + ShipingboxNo + '</BSNO> ';
_s := _s + ' </Booking> ';
_s := _s + '</BookingInfo> ';
_state := mServiceSoap_Ds.GetBsnoInfo(_s);
p1 := frm_data_share.GettimePotion(1, '<Booking>', _state);
p2 := frm_data_share.GettimePotion(1, '</Booking>', _state);
block := Copy(_state, p1, p2 - p1);
onlinePosted := '0';
onlinePosted := frm_data_share.GetXMLValue('CI_BLC', block);
{if onlinePosted <> 'CI_S.O_Rec' then
begin
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><<3C><><EFBFBD><EFBFBD>֪ͨ><3E><>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><>ӷ<EFBFBD><D3B7><EFBFBD><<3C>ᵥȷ<E1B5A5><C8B7>><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><<3C><><EFBFBD><EFBFBD>֪ͨ><3E>޷<EFBFBD><DEB7><EFBFBD>ȷ<EFBFBD>շ<EFBFBD><><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', mtWarning, [mbyes, mbno], 0) = mrno then
begin
exit;
end;
end; }
if MessageDlg('ȷʵҪת<D2AA><D7AA><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', mtWarning, [mbyes, mbno], 0) = mryes then
begin
DT := Now;
end
else
Exit;
AUDITOR := MT1.FieldByName('lxr').AsString;
FORWARDER := MT1.FieldByName('gs').AsString;
if (AUDITOR = '') and (FORWARDER = '') then
begin
ShowMessage('<27><>ϵ<EFBFBD>˻<EFBFBD><CBBB><EFBFBD>˾<EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>кŲ<D0BA><C5B2>ܶ<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>һ');
exit;
end;
BH := frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
getctnqry.Close;
getctnqry.SQL.text := 'select ctn_id,(select <20><><EFBFBD><EFBFBD>EDI<44><49><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>=t_op_ctn.<2E><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><>ע,<2C><>װ,<2C>ߴ<EFBFBD> from t_op_ctn where <20><><EFBFBD><EFBFBD>=''' + BH + '''';
getctnqry.Open;
GetEmployeeQry.Close;
GetEmployeeQry.SQL.text := 'select e.*,(select top 1 <20><><EFBFBD><EFBFBD> from t_sys_company) companyname from t_sys_employee e where <20><><EFBFBD><EFBFBD>=''' + employee + '''';
GetEmployeeQry.Open;
//20150724 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ <20><><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĵؼ<C4B5>װ<EFBFBD><D7B0>Ϊ<EFBFBD><CEAA> <20><><EFBFBD><EFBFBD>˳<EFBFBD>
emptyMES := '';
if frm_op_seae.t_op_seae.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring = '' then
emptyMES := 'װ<><D7B0><EFBFBD><EFBFBD>';
if frm_op_seae.t_op_seae.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring = '' then
emptyMES := emptyMES + ' ж<><D0B6><EFBFBD><EFBFBD>';
if frm_op_seae.t_op_seae.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring = '' then
emptyMES := emptyMES + ' Ŀ<>ĵ<EFBFBD>';
if frm_op_seae.t_op_seae.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring = '' then
emptyMES := emptyMES + ' <20><>װ<EFBFBD><D7B0>';
if emptyMES <> '' then
begin
ShowMessage(emptyMES + ' <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD>Ϊ<EFBFBD><CEAA>');
exit;
end;
if 1 = 1 then
begin
_s := '';
_s := '<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
_s := _s + '<BookingCargoSpace xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s := _s + ' <Head> ';
_s := _s + ' <OPID>' + UserSPXNO + '</OPID> ';
_s := _s + ' <COMPANYID>' + CompanySPXNO + '</COMPANYID> ';
_s := _s + ' <OPTYPE>0</OPTYPE> ';
_s := _s + ' <OPTIME>' + datetimetostr(DT) + '</OPTIME> ';
_s := _s + ' <NewOPID>' +formatAfrstr(AUDITOR) + '</NewOPID> ';
_s := _s + ' <Version>1.0</Version> ';
_s := _s + ' </Head> ';
_s := _s + '<OpseaeList> ';
_s := _s + ' <Opseae> ';
_s := _s + ' <BSNO>' + formatAfrstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring) + '</BSNO> ';
_s := _s + ' </Opseae> ';
_s := _s + '</OpseaeList> ';
_s := _s + '</BookingCargoSpace> ';
//WriteLog(_s);
_r := mServiceSoap_Ds.RedirectBooking(_s);
//showmessage(_s);
//<2F><><EFBFBD><EFBFBD>Ʊҵ<C6B1><D2B5><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ѡ<EFBFBD><D1A1>˾
hdgsSPXNO := FORWARDER;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ (table:Tadoquery;receiver,spxno,OPType:string);
if (pos('ת<><D7AA><EFBFBD>ɹ<EFBFBD>___', _r) = 1) then
begin
mes := 'ת<><D7AA><EFBFBD>ɹ<EFBFBD>___';
//showmessage('<27><EFBFBD>ɹ<EFBFBD>');
BSNO := frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').asstring;
Booking_add(frm_op_seae.t_op_seae, frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring
, MT1.fieldbyname('<27><>ϵ<EFBFBD><CFB5>').asstring, MT1.fieldbyname('<27><>˾ȫ<CBBE><C8AB>').asstring, BSNO, 'ҵ<><D2B5>ת<EFBFBD><D7AA>');
//SendMail_SI(BSNO);
frm_crm_spxcompany.close;
end
else
showmessage(_r);
end;
try
finally
GetEmployeeQry.free;
GetHDGSQry.free;
end;
end;
end;
procedure Tfrm_crm_spxcompany.bsSkinEdit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
bsSkinButton1.OnClick(Sender);
end;
procedure Tfrm_crm_spxcompany.bsSkinEdit2KeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
bsSkinButton1.OnClick(Sender);
end;
procedure Tfrm_crm_spxcompany.bsSkinEdit3KeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
bsSkinButton1.OnClick(Sender);
end;
function Tfrm_crm_spxcompany.formatAfrstr(str: string): string;
begin
Result := Trim(str);
Result := StringReplace(Result, '&', '&amp;', [rfReplaceAll]);
Result := StringReplace(Result, '<', '&lt;', [rfReplaceAll]);
Result := StringReplace(Result, '"', '&quot;', [rfReplaceAll]);
Result := StringReplace(Result, '>', '&gt;', [rfReplaceAll]);
Result := StringReplace(Result, '''', '&apos;', [rfReplaceAll]);
end;
procedure Tfrm_crm_spxcompany.getwebservice_ds;
var
URL: string;
begin
try
URL := get_WebseviceURL;
mHttpRIO_ds := THTTPRIO.Create(nil);
mHttpRIO_ds.WSDLLocation := URL + '?WSDL';
mHttpRIO_ds.URL := URL;
// mHttpRIO_ds.WSDLLocation:='http://192.168.1.5:8086/webservice/DsWebService.asmx?WSDL';
// mHttpRIO_ds.URL:='http://192.168.1.5:8086/webservice/DsWebService.asmx';
mHttpRIO_ds.Port := 'DsWebServiceSoap';
mHttpRIO_ds.Service := 'DsWebService';
mHttpRIO_ds.HTTPWebNode.UseUTF8InHeader := true;
InvRegistry.RegisterInvokeOptions(TypeInfo(DsWebServiceSoap), ioDocument); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
mServiceSoap_Ds := mHttpRIO_ds as DsWebServiceSoap;
except
on E: Exception do
begin
ShowMessage(e.Message);
exit;
end;
end;
end;
procedure Tfrm_crm_spxcompany.GetCompanyInfo(str: string);
var
_s, url, block, XML: string;
aa: DsWebServiceSoap;
Companycount, _i, _j, p1, p2: integer;
begin
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ϢXML
getwebservice_ds;
XML := mServiceSoap_Ds.LoadBookingCompany(frm_data_share.AnsiStringToWideString(str, 936));
//XML:=aa.ReceiveBookingCargoSpace(_s);
Companycount := frm_data_share.countString('Company', xml);
//result:= Opseaecount;
MT1.Close;
//XML:=StringReplace (XML, 'a', 'two', [rfReplaceAll])
for _i := 1 to Companycount do
begin
p1 := frm_data_share.GettimePotion(_i, '<Company>', xml);
p2 := frm_data_share.GettimePotion(_i, '</Company>', xml);
block := Copy(XML, p1, p2 - p1);
MT1.Open;
MT1.Edit;
MT1.Insert;
MT1['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>'] := frm_data_share.GetXMLValue('Name', block);
MT1['gs'] := frm_data_share.GetXMLValue('CompanyID', block);
MT1['<27><>˾ȫ<CBBE><C8AB>'] := frm_data_share.GetXMLValue('FullName', block);
//MT1['LocalName']:='';
MT1.Post;
{ end; }
end;
//<2F><>GetCompanyQry<72><79><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>кŶ<D0BA>Ӧ<EFBFBD>Ŀͻ<C4BF><CDBB><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>MT1
MT1.First;
GetCompanyQry.Close;
GetCompanyQry.Open;
GetCompanyQry.First;
while not MT1.Eof do
begin
GetCompanyQry.First;
while not GetCompanyQry.Eof do
begin
if (GetCompanyQry.FieldByName('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').AsString = MT1.FieldByName('gs').AsString) then
begin
MT1.Edit;
MT1['<27><><EFBFBD>ؿͻ<D8BF><CDBB><EFBFBD><EFBFBD><EFBFBD>'] := GetCompanyQry.FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString;
MT1.Post;
end;
GetCompanyQry.Next;
end;
MT1.Next;
end;
MT1.First;
GetUserInfo(MT1.FieldByName('gs').AsString);
end;
procedure Tfrm_crm_spxcompany.bsSkinButton2Click(Sender: TObject);
begin
GetCompanyInfo(AnsiStringToWideString(edt1.Text, 936));
end;
function Tfrm_crm_spxcompany.AnsiStringToWideString(const strAnsi: AnsiString; codepage: word): WideString;
var
Len: integer;
begin
Result := '';
if strAnsi = '' then
Exit;
Len := MultiByteToWideChar(CodePage, MB_PRECOMPOSED, PChar(@strAnsi[1]), -1, nil, 0);
SetLength(Result, Len - 1);
if Len > 1 then
MultiByteToWideChar(CodePage, MB_PRECOMPOSED, PChar(@strAnsi[1]), -1, PWideChar(@Result[1]), Len - 1);
end;
procedure Tfrm_crm_spxcompany.GetUserInfo(str: string);
var
_s, url, block, XML: string;
aa: DsWebServiceSoap;
Companycount, _i, _j, p1, p2: integer;
begin
//<2F><>ȡ<EFBFBD><C8A1>ϵ<EFBFBD><CFB5>XML
url := get_WebseviceURL;
aa := GetDsWebServiceSoap(false, get_WebseviceURL); //'http://192.168.1.105:5427/webservice/DsWebService.asmx');
XML := aa.LoadUser(str);
Companycount := frm_data_share.countString('User', xml);
_j := 0;
MT2.Close;
MT2.Open;
MT2.Edit;
MT2.Insert;
MT2['UserID'] := '';
MT2['USERNAME'] := '..<2E><>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
MT2['Mobile'] := '';
MT2['ORDER'] := _j;
MT2['DeptName'] := '';
MT2['Duty'] := '';
//<2F>Ȼ<EFBFBD>ȡ<EFBFBD><C8A1>һ<EFBFBD><D2BB><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD>ʼ<EFBFBD>
p1 := frm_data_share.GettimePotion(1, '<User>', xml);
p2 := frm_data_share.GettimePotion(1, '</User>', xml);
block := Copy(XML, p1, p2 - p1);
MT2['Email'] := frm_data_share.GetXMLValue('Email', block);
MT2.Post;
for _i := 1 to Companycount do
begin
p1 := frm_data_share.GettimePotion(_i, '<User>', xml);
p2 := frm_data_share.GettimePotion(_i, '</User>', xml);
block := Copy(XML, p1, p2 - p1);
_j := _j + 1;
MT2.Open;
MT2.Edit;
MT2.Insert;
MT2['UserID'] := frm_data_share.GetXMLValue('UserID', block);
MT2['USERNAME'] := frm_data_share.GetXMLValue('USERNAME', block);
MT2['Mobile'] := frm_data_share.GetXMLValue('Mobile', block);
MT2['Email'] := frm_data_share.GetXMLValue('Email', block);
MT2['DeptName'] := frm_data_share.GetXMLValue('DeptName', block);
MT2['Duty'] := frm_data_share.GetXMLValue('Duty', block);
MT2['ORDER'] := _j;
MT2.Post;
end;
MT2.First;
while not MT2.Eof do
begin
if (MT2.FieldByName('USERNAME').AsString = '..δָ<CEB4><D6B8>') then
begin
Exit;
end
else
begin
MT2.Next;
end;
end;
end;
procedure Tfrm_crm_spxcompany.dxDBGrid1Click(Sender: TObject);
begin
//if (MT1.FieldByName('gs').AsString='') then begin
// ShowMessage('<27>˵<EFBFBD>λδ<CEBB><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣͬ<CFA2><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>Ȩ<EFBFBD>޵<EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD>"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ"<22><>ѡ<EFBFBD><D1A1><><CDAC><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>Ϣ"<22><>'+#13#10+'<27><><EFBFBD><EFBFBD>ϵͳ<CFB5>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>ϵͳ<CFB5>еĵ<D0B5>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>');
// MT2.close;
//end else begin
GetUserInfo(MT1.FieldByName('gs').AsString);
//end;
end;
procedure Tfrm_crm_spxcompany.edt1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if (Key = 13) then
begin
bsSkinButton2Click(self);
end;
end;
procedure Tfrm_crm_spxcompany.SetCompany(str: string);
begin
///<2F><>ѯ<EFBFBD>û<EFBFBD>
try
frm_SetCompany := Tfrm_SetCompany.Create(self);
frm_SetCompany.edt1.text := str;
frm_SetCompany.GetCompanyInfo(str);
frm_SetCompany.ShowModal;
finally
frm_SetCompany.Free;
end;
end;
procedure Tfrm_crm_spxcompany.SetEmployee;
begin
///<2F><>ѯ<EFBFBD>û<EFBFBD>
try
frm_SelectLinkMan := Tfrm_SelectLinkMan.Create(self);
frm_SelectLinkMan.ShowModal;
finally
frm_SelectLinkMan.Free;
end;
end;
procedure Tfrm_crm_spxcompany.DBGrid1CellClick(Column: TColumn);
begin
{
getseaeinfoqry.Close;
getseaeinfoqry.SQL.text:='select * from t_crm_client where <20><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>='''+MT1.fieldbyname('gs').asstring+'''';
getseaeinfoqry.Open;
if (getseaeinfoqry.RecordCount=0) then begin
ShowMessage('<27>˵<EFBFBD>λδ<CEBB><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣͬ<CFA2><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>Ȩ<EFBFBD>޵<EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD>"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ"<22><>ѡ<EFBFBD><D1A1><><CDAC><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>Ϣ"<22><>'+#13#10+'<27><><EFBFBD><EFBFBD>ϵͳ<CFB5>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD>ϵͳ<CFB5>еĵ<D0B5>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>');
SetCompany(MT1.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring);
MT2.close;
exit;
end else begin }
// GetUserInfo(MT1.FieldByName('gs').AsString);
{ end; }
end;
procedure Tfrm_crm_spxcompany.dxDBGrid2DblClick(Sender: TObject);
begin
bsSkinButton1Click(self);
end;
procedure Tfrm_crm_spxcompany.SetHDGS(str: string);
begin
getseaeinfoqry.Close;
getseaeinfoqry.SQL.text := 'select * from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>=''' + str + '''';
getseaeinfoqry.Open;
hdgsSPXNO := frm_crm_spxcompany.getseaeinfoqry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring;
end;
procedure Tfrm_crm_spxcompany.SetCurrCompany;
begin
getseaeinfoqry.Close;
getseaeinfoqry.SQL.text := 'select <20><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD> from t_code_subcomp where <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='
+'(select <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+employee+''')';
getseaeinfoqry.Open;
hdgsSPXNO := frm_crm_spxcompany.getseaeinfoqry.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring;
end;
procedure Tfrm_crm_spxcompany.dxDBGrid2Click(Sender: TObject);
begin
MT1.edit;
MT1['<27><>ϵ<EFBFBD><CFB5>'] := MT2.fieldbyname('USERNAME').AsString;
MT1['lxr'] := MT2.fieldbyname('UserID').AsString;
MT1['Email'] := MT2.fieldbyname('Email').AsString;
end;
procedure Tfrm_crm_spxcompany.SendEmail(sender, sendercompany, receiver, receivercompany: string);
var
str: widestring;
str_file: widestring;
str_memo: Tmemo;
begin
str_memo := Tmemo.create(application);
str_memo.visible := false;
str_memo.Parent := frm_sys_reg;
str_memo.Lines.Add(receivercompany + ' <20><> ' + receiver + ' <20><><EFBFBD><EFBFBD>/Ůʿ <20><><EFBFBD><EFBFBD>:');
str_memo.Lines.Add(' <20><> ' + sendercompany + ' <20><> ' + sender + ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA3AC><EFBFBD><EFBFBD>ds6ϵͳ<CFB5>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD>ȡ');
str_memo.Lines.Add('');
str_memo.Lines.Add(' <20><><EFBFBD><EFBFBD>ʱ<EFBFBD>䣺' + datetimetostr(Now));
try
if Trim(str_memo.lines.Text) <> '' then
begin
SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL);
// SMTP1.AuthenticationType := atLogin;
{
SMTP1.username:='crazymanqd';
SMTP1.Password :='790822';
SMTP1.Host :='smtp.126.com';
}
SMTP1.username := 'admin@dongshengsoft.com';
SMTP1.Password := 'ds!@#)(*';
SMTP1.Host := 'smtpcom.263xmail.com';
SMTP1.Port := 25;
try
SMTP1.Connect;
except
on e: Exception do
begin
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:' + E.Message);
end;
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
try
with IdMsg do
begin
body.Clear;
// ContentType:='us-ascii';
// CharSet:='GB2312';
Body.Text := str_memo.lines.Text;
From.address := 'admin@dongshengsoft.com';
// From.address :='crazymanqd@126.com';
Recipients.EMailAddresses := 'dongshengsoft@dongshengsoft.com';
Subject := employee + '<27><><EFBFBD><EFBFBD><EBB6A9>';
mt2.SaveToFile(ExtractFilePath(Application.ExeName) + employee + '.file');
TIdAttachmentFile.Create(MessageParts, ExtractFilePath(Application.ExeName) + employee + '.file');
//TIdAttachment.Create(MessageParts,ExtractFilePath(Application.ExeName)+edit5.text+'.DS');
end;
if not SMTP1.Connected then
begin
Sleep(1000);
SMTP1.Connect;
end;
SMTP1.Send(IdMsg);
//MessageDlg('<27><><EFBFBD><EFBFBD>շ<EFBFBD><D5B7>ͳɹ<CDB3>',mtConfirmation,[mbOK],0)
finally
SMTP1.Disconnect;
end;
end;
except
//MessageDlg('<27><><EFBFBD><EFBFBD>շ<EFBFBD><D5B7><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><E7BBB0>ϵ:0532-83889257!',mtError,[mbOK],0);
end;
end;
procedure Tfrm_crm_spxcompany.SetSPXUSER(str: string);
begin
SPXUSER := str;
end;
procedure Tfrm_crm_spxcompany.SendMail(BSNO: string);
var //<2F><><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>
CompanyStr, block, sendercompany, senderName, senderEmail, senderMobile, ReceiverCompany, ReceiverCompanyID, ReceiverName, ReceiverEmail, ReceiverMobile: string;
_l, p1, p2: Integer;
DT: TDateTime;
begin
//<2F><>ȡ
try
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress := tfrm_sys_progress.Create(application);
frm_sys_progress.bsSkinGauge1.ProgressText := '<27><><EFBFBD>ڻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ򡣡<C8BA><F2A1A3A1><EFBFBD>';
frm_sys_progress.bsSkinGauge1.MaxValue := 5;
frm_sys_progress.bsSkinGauge1.MinValue := 0;
frm_sys_progress.Show;
getwebservice_ds;
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5>Ĺ<EFBFBD>˾<EFBFBD><CBBE>Ϣ
CompanyStr := mServiceSoap_Ds.LoadSenderCompany(BSNO);
p1 := frm_data_share.GettimePotion(1, '<Company>', CompanyStr);
p2 := frm_data_share.GettimePotion(1, '</Company>', CompanyStr);
block := Copy(CompanyStr, p1, p2 - p1);
sendercompany := frm_data_share.GetXMLValue('FullName', block);
senderName := frm_data_share.GetXMLValue('Name', block);
senderEmail := frm_data_share.GetXMLValue('Email', block);
senderMobile := frm_data_share.GetXMLValue('Mobile', block);
CompanyStr := mServiceSoap_Ds.LoadReceiverCompany(BSNO);
p1 := frm_data_share.GettimePotion(1, '<Company>', CompanyStr);
p2 := frm_data_share.GettimePotion(1, '</Company>', CompanyStr);
block := Copy(CompanyStr, p1, p2 - p1);
ReceiverCompany := frm_data_share.GetXMLValue('FullName', block);
ReceiverCompanyID := frm_data_share.GetXMLValue('CompanyID', block);
ReceiverName := frm_data_share.GetXMLValue('Name', block);
ReceiverEmail := frm_data_share.GetXMLValue('Email', block);
ReceiverMobile := frm_data_share.GetXMLValue('Mobile', block);
getctnqry.Close;
getctnqry.SQL.text := 'select ''' + ReceiverEmail + ''' Email,''' + senderCompany + ''' senderCompany,''' + sendername + ''' sendername,''' + senderEmail + ''' senderEmail,''' + senderMobile + ''' senderMobile,''' + ReceiverCompany + ''' ReceiverCompany,''' + ReceiverName + ''' ReceiverName,''' + ReceiverEmail + ''' ReceiverEmail,''' + ReceiverMobile + ''' ReceiverMobile';
getctnqry.Open;
sys_Simpleprint('SHIPPINGBOX SO', ReceiverName, 1, frm_op_seae.t_op_seae2, nil, nil, getctnds, nil, nil, nil, nil, nil, nil, nil);
finally
frm_sys_progress.Close;
frm_sys_progress.Free;
frm_sys_progress := nil;
end;
end;
procedure Tfrm_crm_spxcompany.SendMail_SI(BSNO: string);
var
CompanyStr, block, sendercompany, senderName, senderEmail, senderMobile, ReceiverCompany, ReceiverCompanyID, ReceiverName, ReceiverEmail, ReceiverMobile: string;
_l, p1, p2: Integer;
DT: TDateTime;
begin
try
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress := tfrm_sys_progress.Create(application);
frm_sys_progress.bsSkinGauge1.ProgressText := '<27><><EFBFBD>ڻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ򡣡<C8BA><F2A1A3A1><EFBFBD>';
frm_sys_progress.bsSkinGauge1.MaxValue := 5;
frm_sys_progress.bsSkinGauge1.MinValue := 0;
frm_sys_progress.Show;
getwebservice_ds;
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5>Ĺ<EFBFBD>˾<EFBFBD><CBBE>Ϣ
CompanyStr := mServiceSoap_Ds.LoadSenderCompany(BSNO);
p1 := frm_data_share.GettimePotion(1, '<Company>', CompanyStr);
p2 := frm_data_share.GettimePotion(1, '</Company>', CompanyStr);
block := Copy(CompanyStr, p1, p2 - p1);
sendercompany := frm_data_share.GetXMLValue('FullName', block);
senderName := frm_data_share.GetXMLValue('Name', block);
senderEmail := frm_data_share.GetXMLValue('Email', block);
senderMobile := frm_data_share.GetXMLValue('Mobile', block);
CompanyStr := mServiceSoap_Ds.LoadReceiverCompany(BSNO);
p1 := frm_data_share.GettimePotion(1, '<Company>', CompanyStr);
p2 := frm_data_share.GettimePotion(1, '</Company>', CompanyStr);
block := Copy(CompanyStr, p1, p2 - p1);
ReceiverCompany := frm_data_share.GetXMLValue('FullName', block);
ReceiverCompanyID := frm_data_share.GetXMLValue('CompanyID', block);
ReceiverName := frm_data_share.GetXMLValue('Name', block);
ReceiverEmail := frm_data_share.GetXMLValue('Email', block);
ReceiverMobile := frm_data_share.GetXMLValue('Mobile', block);
if (ReceiverCompanyID = frm_data_share.t_load_employee.fieldbyname('<27><>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring) then
begin
//<2F><><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC>dz<EFBFBD><C7B3>˷<EFBFBD> <20>򲻷<EFBFBD>
//Exit;
end;
getctnqry.Close; //<2F><><EFBFBD>˷<EFBFBD>
getctnqry.SQL.text := 'select ''' + ReceiverEmail + ''' Email,''' + senderCompany + ''' senderCompany,''' + sendername + ''' sendername,''' + senderEmail + ''' senderEmail,''' + senderMobile + ''' senderMobile,''' + ReceiverCompany + ''' ReceiverCompany,''' + ReceiverName + ''' ReceiverName,''' + ReceiverEmail + ''' ReceiverEmail,''' + ReceiverMobile + ''' ReceiverMobile';
getctnqry.Open;
sys_Simpleprint('SHIPPINGBOX SI', ReceiverName, 1, frm_op_seae.t_op_seae2, nil, nil, getctnds, nil, nil, nil, nil, nil, nil, nil);
finally
frm_sys_progress.Close;
frm_sys_progress.Free;
frm_sys_progress := nil;
end;
end;
procedure Tfrm_crm_spxcompany.SetCanSearch(_cansearch: boolean);
begin
bsSkinButton2.Enabled:= _cansearch;
end;
end.