|
|
|
|
unit u_op_seae_edi_kam;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,IdFTP,IdFTPCommon,
|
|
|
|
|
Dialogs, BusinessSkinForm, StdCtrls, bsSkinCtrls,inifiles, DB, ADODB;
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
Tfrm_op_seae_edi_kam = class(TForm)
|
|
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
Edit2: TEdit;
|
|
|
|
|
Edit1: TEdit;
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
SaveDialog1: TSaveDialog;
|
|
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
|
|
t_op_ctn: TADOQuery;
|
|
|
|
|
t_op_ctn1: TDataSource;
|
|
|
|
|
bsSkinRadioGroup1: TbsSkinRadioGroup;
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
Edit3: TEdit;
|
|
|
|
|
bsSkinRadioGroup2: TbsSkinRadioGroup;
|
|
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
Edit4: TEdit;
|
|
|
|
|
Edit5: TEdit;
|
|
|
|
|
Edit6: TEdit;
|
|
|
|
|
Edit7: TEdit;
|
|
|
|
|
t_op_ams: TADOQuery;
|
|
|
|
|
t_op_ams1: TDataSource;
|
|
|
|
|
t_op_seae_assistant: TADOQuery;
|
|
|
|
|
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
|
|
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
|
|
private
|
|
|
|
|
function isEditrue(DataSet:TDataSet): boolean; //<2F>жϱ<D0B6><CFB1><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
function GetStrNum(str:String):integer;//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
|
|
|
|
function FormatListString(Old:TStrings;mCount,Strlength:integer):String;//<2F><><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
|
|
|
|
function FormatEdiString(str:String;Strlength:integer=0):String;//<2F><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD> :
|
|
|
|
|
function CreateEdiFile:TStrings;//<2F><><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>
|
|
|
|
|
function GetLengthword(var s: String; l: Integer;str:String): String;//<2F><><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ȡ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
|
|
|
|
procedure GetLengthTString(var sl:TStringList;l:integer);//<2F><><EFBFBD>ݳ<EFBFBD><DDB3>ȸ<EFBFBD>ʽ<EFBFBD><CABD> tstringlist
|
|
|
|
|
function IsZhongwen(Str:String):Boolean;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD>˫<EFBFBD>ֽ<EFBFBD><D6BD>ַ<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
public
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
function ControlLines(LinesCount,CorpTypeid,BsTypeid:Integer;SName:string):String;
|
|
|
|
|
|
|
|
|
|
function GetShipEdiNO(Ship:String): String;
|
|
|
|
|
function GetDepotEdiNO(Ship:String): String;
|
|
|
|
|
function GetPortEdiID(Port:String): String;
|
|
|
|
|
function GetCntrEdi(cntrsize: String):String;
|
|
|
|
|
|
|
|
|
|
function GetCorpsString(recordno,fldName:string;aDataset:TDataset):String;
|
|
|
|
|
|
|
|
|
|
function GetvesselEdi(avessel: String): String;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function GetpkgsEdi(pkgs:String):String;//<2F><>װEDI<44><49><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
function GetShipEName(Ship:String): String;
|
|
|
|
|
|
|
|
|
|
function Record00_SO_SI(strType,SenderCode,ReciverCode:string):String;
|
|
|
|
|
function Record02_SO(SenderCode,ReciverCode:string;aDataset:TDataset):String;
|
|
|
|
|
function Record03_SO(SenderCode,ReciverCode:string;aDataset:TDataset):String;
|
|
|
|
|
function Record10_SI(aDataset:TDataset):String;
|
|
|
|
|
function Record11_SO(aDataset:TDataset):String;
|
|
|
|
|
function Record11_SI(aDataset:TDataset):String;
|
|
|
|
|
function Record12_SO(aDataset:TDataset):String;
|
|
|
|
|
function Record12_SI(aDataset:TDataset):String;
|
|
|
|
|
function Record13_SI(aDataset:TDataset):String;
|
|
|
|
|
function Record15_SO(aDataset:TDataset):String;
|
|
|
|
|
function Record15_SI(aDataset:TDataset):String;
|
|
|
|
|
function Record20_21_22_SO(recordno,fldName:string;aDataset:TDataset):String;
|
|
|
|
|
function Record16_17_18_SI(recordno,fldName:string;aDataset:TDataset):String;
|
|
|
|
|
|
|
|
|
|
function Record17_SO(aDataset:TDataset):String;
|
|
|
|
|
|
|
|
|
|
function Record21_SI(SenderCode:string;aDataset:TDataset):String;
|
|
|
|
|
function Record23_SO(SenderCode:string;aDataset:TDataset):String;
|
|
|
|
|
function Record41_SO(aLineno:string;aDataset:TDataset):String;
|
|
|
|
|
function Record41_SI(aLineno:string;aDataset:TDataset):String;
|
|
|
|
|
function Record43_SO(aDataset:TDataset):String;
|
|
|
|
|
function Record43_SI(aDataset:TDataset):String;
|
|
|
|
|
function Record44_47_SO_SI(strLen,LoopCount:integer;RecordNo,FldName:string;aDataset:TDataset):TStringlist;
|
|
|
|
|
function Record48_SO(aDataset:TDataset):TStringlist;
|
|
|
|
|
function Record49(aDataset:TDataset):String;
|
|
|
|
|
function Record51_SO(aLineno:string;aDataset:TDataset):String;
|
|
|
|
|
function Record51_SI(alineno:string;aDataset:TDataset):String;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// function Record48(aDataset:TDataset):TStringlist;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frm_op_seae_edi_kam: Tfrm_op_seae_edi_kam;
|
|
|
|
|
|
|
|
|
|
CheckError:Boolean=False;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses u_op_seae, u_main, my_sys_function, u_data_share;
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.ControlLines(LinesCount,CorpTypeid,BsTypeid:Integer;SName:string):String;
|
|
|
|
|
begin
|
|
|
|
|
Result:='';
|
|
|
|
|
if LinesCount>5 then
|
|
|
|
|
begin
|
|
|
|
|
case CorpTypeid of
|
|
|
|
|
0:begin
|
|
|
|
|
case BsTypeid of
|
|
|
|
|
0: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:*<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
1: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:*<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
1:begin
|
|
|
|
|
case BsTypeid of
|
|
|
|
|
0: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:**<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
1: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:**<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
2:begin
|
|
|
|
|
case BsTypeid of
|
|
|
|
|
0: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:***<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
1: Result:=SName+'<27><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>5<EFBFBD><35>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ʽΪ:***<2A>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.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:=Trim(FieldByName('Edi<64><69><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.GetShipEName(Ship:String): String;
|
|
|
|
|
var
|
|
|
|
|
aQuery:TADOQuery;
|
|
|
|
|
begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('Select Ӣ<><D3A2>ȫ<EFBFBD><C8AB> from t_crm_client');
|
|
|
|
|
SQL.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Ship+'''');
|
|
|
|
|
SQL.Add('order by <20><><EFBFBD><EFBFBD>');
|
|
|
|
|
Open;
|
|
|
|
|
if not IsEmpty then
|
|
|
|
|
Result:=Trim(FieldByName('Ӣ<><D3A2>ȫ<EFBFBD><C8AB>').asstring)
|
|
|
|
|
else
|
|
|
|
|
Result:='';
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.GetShipEdiNO(Ship:String): String;
|
|
|
|
|
var
|
|
|
|
|
aQuery:TADOQuery;
|
|
|
|
|
begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('Select <20><><EFBFBD><EFBFBD>,EDI<44><49><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,¼<><C2BC><EFBFBD><EFBFBD>,¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_crm_client');
|
|
|
|
|
SQL.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>''Ŀ<><C4BF>'' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Ship+'''');
|
|
|
|
|
SQL.Add('order by <20><><EFBFBD><EFBFBD>');
|
|
|
|
|
Open;
|
|
|
|
|
if not IsEmpty then
|
|
|
|
|
Result:=Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
|
|
|
|
|
else
|
|
|
|
|
Result:='';
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.GetDepotEdiNO(Ship:String): String;
|
|
|
|
|
var
|
|
|
|
|
aQuery:TADOQuery;
|
|
|
|
|
begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('Select <20><><EFBFBD><EFBFBD>,EDI<44><49><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,¼<><C2BC><EFBFBD><EFBFBD>,¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_crm_client');
|
|
|
|
|
SQL.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>''Ŀ<><C4BF>'' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Ship+'''');
|
|
|
|
|
SQL.Add('order by <20><><EFBFBD><EFBFBD>');
|
|
|
|
|
Open;
|
|
|
|
|
if not IsEmpty then
|
|
|
|
|
if Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)<>'' then
|
|
|
|
|
Result:=Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
|
|
|
|
|
else Result:=Trim(FieldByName('<27><><EFBFBD><EFBFBD>').asstring)
|
|
|
|
|
else
|
|
|
|
|
Result:='';
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.GetvesselEdi(avessel: String): String;
|
|
|
|
|
var
|
|
|
|
|
aQuery:TADOQuery;
|
|
|
|
|
begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('Select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_code_vessel where Ӣ<>Ĵ<EFBFBD><C4B4><EFBFBD>='''+avessel+'''');
|
|
|
|
|
Open;
|
|
|
|
|
if IsEmpty then
|
|
|
|
|
Result:=''
|
|
|
|
|
else
|
|
|
|
|
Result:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.GetCntrEdi(cntrsize: String):String;
|
|
|
|
|
var
|
|
|
|
|
aQuery:TADOQuery;
|
|
|
|
|
begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('Select MSC<53><43><EFBFBD><EFBFBD> Edi<64><69><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>='''+cntrsize+'''');
|
|
|
|
|
Open;
|
|
|
|
|
if IsEmpty then
|
|
|
|
|
Result:=''
|
|
|
|
|
else
|
|
|
|
|
Result:=FieldByName('Edi<64><69><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.GetPortEdiID(Port:String): String;
|
|
|
|
|
var
|
|
|
|
|
aQuery:TADOQuery;
|
|
|
|
|
begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_code_disport where Ӣ<><D3A2><EFBFBD><EFBFBD>='''+Port+'''');
|
|
|
|
|
Open;
|
|
|
|
|
if not IsEmpty then
|
|
|
|
|
Result:=Trim(FieldByName('EDI<44><49><EFBFBD><EFBFBD>').asstring)
|
|
|
|
|
else
|
|
|
|
|
Result:='';
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.GetCorpsString(recordno,fldName:string;aDataset:TDataset):String;
|
|
|
|
|
var
|
|
|
|
|
TempStr:TStringList;
|
|
|
|
|
aAdoQuery:TAdoQuery;
|
|
|
|
|
shipNo,consigneeno,notifyno:string;
|
|
|
|
|
begin
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
|
|
with aAdoQuery do
|
|
|
|
|
try
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('select * from t_op_kam where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
|
|
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
Open;
|
|
|
|
|
shipNo:=trim(fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
|
|
consigneeno:=trim(fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
|
|
notifyno:=trim(fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
|
|
finally
|
|
|
|
|
// Free;
|
|
|
|
|
end;
|
|
|
|
|
CheckError:=False;
|
|
|
|
|
|
|
|
|
|
TempStr:=TStringList.Create;
|
|
|
|
|
try
|
|
|
|
|
TempStr.Text:=FormatEdiString(aDataset.fieldbyname(fldName).AsString);
|
|
|
|
|
GetLengthTString(TempStr,60);
|
|
|
|
|
if (recordno='16') or (recordno='20') then
|
|
|
|
|
Result:=recordno+':'+shipNo;
|
|
|
|
|
if (recordno='17') or (recordno='21') then
|
|
|
|
|
Result:=recordno+':'+consigneeno;
|
|
|
|
|
|
|
|
|
|
if (recordno='18') or (recordno='22') then
|
|
|
|
|
Result:=recordno+':'+notifyno;
|
|
|
|
|
|
|
|
|
|
if (recordno='16') or (recordno='17') or (recordno='18') then
|
|
|
|
|
begin
|
|
|
|
|
Result:=Result+':';
|
|
|
|
|
Result:=Result+FormatListString(TempStr,2,60)+':'; //ȡ<><C8A1><EFBFBD><EFBFBD> 3<><33><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4<><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8>ַ
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
if (recordno='20') or (recordno='21') or (recordno='22') then
|
|
|
|
|
begin
|
|
|
|
|
Result:=Result+':';
|
|
|
|
|
Result:=Result+FormatListString(TempStr,6,60)+#39;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(TempStr);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
with aAdoQuery do
|
|
|
|
|
try
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('select * from t_op_ams where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
|
|
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
Open;
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
// Free;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if aAdoQuery.RecordCount=0 then
|
|
|
|
|
begin
|
|
|
|
|
CheckError:=True;
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
if ( (aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰').IsNull) or (Trim(aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰').AsString)='') )
|
|
|
|
|
and ( (aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull) or (Trim(aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='') )
|
|
|
|
|
and ( (aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵紫').IsNull) or (Trim(aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵紫').AsString)='') )
|
|
|
|
|
and (bsSkinRadioGroup2.ItemIndex=1) then
|
|
|
|
|
begin
|
|
|
|
|
CheckError:=True;
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (recordno='16') then
|
|
|
|
|
begin
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰').AsString+':'; //5 <20><><EFBFBD><EFBFBD><EFBFBD>˵绰<CBB5><E7BBB0><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+':'; //6 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˵紫').AsString+':'; //7 <20><><EFBFBD><EFBFBD><EFBFBD>˵紫
|
|
|
|
|
Result:=Result+':'; //8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //9 ʡ<>ݴ<EFBFBD><DDB4><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //10 ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString+':'; //12 <20><><EFBFBD><EFBFBD><EFBFBD>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString+':'; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+#39;
|
|
|
|
|
end;
|
|
|
|
|
if (recordno='17') then
|
|
|
|
|
begin
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰').AsString+':'; //5 <20>ջ<EFBFBD><D5BB>˵绰<CBB5><E7BBB0><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+':'; //6 <20>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˵紫').AsString+':'; //7 <20>ջ<EFBFBD><D5BB>˵紫
|
|
|
|
|
Result:=Result+':'; //8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //9 ʡ<>ݴ<EFBFBD><DDB4><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //10 ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString+':'; //12 <20>ջ<EFBFBD><D5BB>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //13 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+':'; // 14 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>EMAIL<49><4C>ַ<EFBFBD><D6B7>EM<45><4D>
|
|
|
|
|
Result:=Result+':'; // 15 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵紫<CBB5><E7B4AB><EFBFBD>루FX<46><58>
|
|
|
|
|
Result:=Result+':'; // 16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>˵绰<CBB5><E7BBB0><EFBFBD>루TE<54><45>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString+':'; // 17 <20>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+#39;
|
|
|
|
|
end;
|
|
|
|
|
if (recordno='18') then
|
|
|
|
|
begin
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ϵ<EFBFBD>绰').AsString+':'; //5 ֪ͨ<CDA8>˵绰<CBB5><E7BBB0><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+':'; //6 ֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('֪ͨ<CDA8>˵紫').AsString+':'; //7 ֪ͨ<CDA8>˵紫
|
|
|
|
|
Result:=Result+':'; //8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //9 ʡ<>ݴ<EFBFBD><DDB4><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //10 ʡ<><CAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+':'; //11 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('֪ͨ<CDA8>˹<EFBFBD><CBB9>Ҵ<EFBFBD><D2B4><EFBFBD>').AsString+':'; // 12 <20><><EFBFBD>Ҵ<EFBFBD><D2B4><EFBFBD>
|
|
|
|
|
Result:=Result+aAdoQuery.fieldbyname('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>').AsString+':'; //13 ֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>
|
|
|
|
|
Result:=Result+#39;
|
|
|
|
|
end;
|
|
|
|
|
FreeAndNil(aAdoQuery);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record00_SO_SI(strType,SenderCode,ReciverCode:string):String;
|
|
|
|
|
begin
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
result:='00:IFTMBF:BOOKING'+':'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39
|
|
|
|
|
else result:='00:IFCSUM:MANIFEST'+':'+trim(strType)+':'+ SenderCode+':'+ReciverCode+':'+GetDatetime(datetimetostr(now),1)+#39;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record02_SO(SenderCode,ReciverCode:string;aDataset:TDataset):String;
|
|
|
|
|
var billno,s:String;
|
|
|
|
|
strtype,billtype:string;
|
|
|
|
|
sl:Tstringlist;
|
|
|
|
|
begin
|
|
|
|
|
sl:=Tstringlist.Create;
|
|
|
|
|
sl.Text:=FormatEdiString(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
if sl.Text<>'' then
|
|
|
|
|
s:=sl[0];
|
|
|
|
|
|
|
|
|
|
billtype:='';
|
|
|
|
|
|
|
|
|
|
if bsSkinCheckRadioBox2.Checked then
|
|
|
|
|
billtype:='Y';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if frm_data_share.t_code_free.locate('<27><><EFBFBD>ѷ<EFBFBD>ʽ',frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring,[]) then
|
|
|
|
|
begin
|
|
|
|
|
strtype:=frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
billno:=trim(aDataset.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring);
|
|
|
|
|
result:='02'+':'+billno // 2
|
|
|
|
|
+':'+billno // 3
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //4
|
|
|
|
|
+':' //5
|
|
|
|
|
+':' //6
|
|
|
|
|
+':' //7
|
|
|
|
|
+':' //8
|
|
|
|
|
+':' //9
|
|
|
|
|
+':' //10
|
|
|
|
|
+':' //11
|
|
|
|
|
+':' // 12
|
|
|
|
|
+':' //13
|
|
|
|
|
+':' //14
|
|
|
|
|
+':'+strtype //15
|
|
|
|
|
+':' //16
|
|
|
|
|
+':' //17
|
|
|
|
|
+':' //18
|
|
|
|
|
+':'+billtype //19
|
|
|
|
|
+':'+aDataset.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring //20
|
|
|
|
|
+':'+'100001' //21
|
|
|
|
|
+':'+'GENERAL CARGO' //22
|
|
|
|
|
+':'+s //23
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record03_SO(SenderCode,ReciverCode:string;aDataset:TDataset):String;
|
|
|
|
|
var mbltype,Str1,Str2,ISSUECODE:string;
|
|
|
|
|
begin
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').asstring)<>'<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
mbltype:='W'
|
|
|
|
|
else mbltype:='O';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='ONE' then
|
|
|
|
|
Str1:='1'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='TWO' then
|
|
|
|
|
Str1:='2'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='THREE' then
|
|
|
|
|
Str1:='3'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='FOUR' then
|
|
|
|
|
Str1:='4'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='FIVE' then
|
|
|
|
|
Str1:='5'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='SIX' then
|
|
|
|
|
Str1:='6'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='SERVEN' then
|
|
|
|
|
Str1:='7'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='EIGHT' then
|
|
|
|
|
Str1:='8'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='NIGHT' then
|
|
|
|
|
Str1:='9'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='TEN' then
|
|
|
|
|
Str1:='10';
|
|
|
|
|
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='ONE' then
|
|
|
|
|
Str2:='1'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='TWO' then
|
|
|
|
|
Str2:='2'
|
|
|
|
|
else if frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').asstring='THREE' then
|
|
|
|
|
Str2:='3';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ISSUECODE:=GetPortEdiID(trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring));
|
|
|
|
|
result:='03'+':'+'KKC' // 2
|
|
|
|
|
+':'+ISSUECODE // 3
|
|
|
|
|
+':'+ trim(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring) //4
|
|
|
|
|
+':'+GetDatetime(datetimetostr(frm_op_seae.t_op_seae.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asDatetime),0) //5
|
|
|
|
|
+':' //6
|
|
|
|
|
+':' //7
|
|
|
|
|
+':' //8
|
|
|
|
|
+#39;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record10_SI(aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='10:'+GetvesselEdi(trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 3
|
|
|
|
|
+':' //4
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)//5
|
|
|
|
|
+':::' //678
|
|
|
|
|
+':' //9
|
|
|
|
|
+':' //10
|
|
|
|
|
+'::::' //11 12 13 14
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record11_SO(aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='11:'+GetvesselEdi(trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring))
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 3
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)//4
|
|
|
|
|
+':::' //5 6 7
|
|
|
|
|
+':' //8
|
|
|
|
|
+':' //9
|
|
|
|
|
+':' //10
|
|
|
|
|
+'::::' //11 12 13 14
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record11_SI(aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='11:'+'KKC'
|
|
|
|
|
+':'
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record12_SO(aDataset:TDataset):String;
|
|
|
|
|
var czNo:string;
|
|
|
|
|
begin
|
|
|
|
|
if GetShipEdiNO(aDataset.fieldbyname('<27><>վ').asstring)='' then
|
|
|
|
|
czNo:='YZH-EMSKP'
|
|
|
|
|
else czNo:=GetShipEdiNO(aDataset.fieldbyname('<27><>վ').asstring);
|
|
|
|
|
|
|
|
|
|
result:='12'+':'+ trim(aDataset.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) // 2
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) //3
|
|
|
|
|
+':' + trim(aDataset.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) //4
|
|
|
|
|
+':' + trim(aDataset.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) //5
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)//6
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring) //7
|
|
|
|
|
+':' //8
|
|
|
|
|
+':' //9
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //10
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) // 11
|
|
|
|
|
+':' //12
|
|
|
|
|
+':' //13
|
|
|
|
|
+':'+czNo //14
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record12_SI(aDataset:TDataset):String;
|
|
|
|
|
var strtype:string;
|
|
|
|
|
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
|
|
|
|
|
strtype:=frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
result:='12'
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring) // 2
|
|
|
|
|
+':' // 3
|
|
|
|
|
+':' //4
|
|
|
|
|
+':' //5
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring) //6
|
|
|
|
|
+':' + trim(aDataset.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring) //7
|
|
|
|
|
+':' + trim(aDataset.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //8
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)//9
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //10
|
|
|
|
|
+':'+strtype //11
|
|
|
|
|
+':'+FormatDateTime('YYYYMMDD',Date) //12
|
|
|
|
|
+':' //13
|
|
|
|
|
+':' // 14
|
|
|
|
|
+':' //15
|
|
|
|
|
+':' //16
|
|
|
|
|
+':' //17
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record13_SI(aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='13'
|
|
|
|
|
+':' + trim(aDataset.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //2
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').asstring)//3
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) //4
|
|
|
|
|
+':' + trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring) //5
|
|
|
|
|
+':' //6
|
|
|
|
|
+':'//7
|
|
|
|
|
+':' //8
|
|
|
|
|
+':' //9
|
|
|
|
|
+':' // 10
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record15_SO(aDataset:TDataset):String;
|
|
|
|
|
var strtype:string;
|
|
|
|
|
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
|
|
|
|
|
strtype:=frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
result:='15'
|
|
|
|
|
+':' //2
|
|
|
|
|
+':' //3
|
|
|
|
|
+':'+ strtype //4
|
|
|
|
|
+':::::::' //5-11
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record15_SI(aDataset:TDataset):String;
|
|
|
|
|
var strtype:string;
|
|
|
|
|
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
|
|
|
|
|
strtype:=frm_data_share.t_code_free.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
result:='15'
|
|
|
|
|
+':' //2
|
|
|
|
|
+':' //3
|
|
|
|
|
+':'+ strtype //4
|
|
|
|
|
+':::::' //5 6 7 8 9
|
|
|
|
|
+':' //10
|
|
|
|
|
+':'+strtype //5-11
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record20_21_22_SO(recordno,fldName:string;aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:=GetCorpsString(recordno,fldName,aDataset);//+'''';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record16_17_18_SI(recordno,fldName:string;aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:=GetCorpsString(recordno,fldName,aDataset);//+'''';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record17_SO(aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='17'
|
|
|
|
|
+':'+GetDepotEdiNO(aDataset.fieldbyname('<27><>վ').asstring) //2
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record21_SI(SenderCode:string;aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='21'
|
|
|
|
|
+':'+SenderCode //2
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record23_SO(SenderCode:string;aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='23'
|
|
|
|
|
+':'+SenderCode //2
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record41_SO(alineno:string;aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='41'
|
|
|
|
|
+':'+alineno //2
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD>䷽ʽ').asstring) // 3
|
|
|
|
|
+':' //4
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //5
|
|
|
|
|
+':'+ GetpkgsEdi(trim(aDataset.fieldbyname('<27><>װ').asstring)) //6
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><>װ').asstring) //7
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //8
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //9
|
|
|
|
|
+':' //10
|
|
|
|
|
+':' //11
|
|
|
|
|
+':' //12
|
|
|
|
|
+':' //13
|
|
|
|
|
+':' //14
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //15
|
|
|
|
|
+':' //16
|
|
|
|
|
+':' //17
|
|
|
|
|
+':' //18
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record41_SI(alineno:string;aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='41'
|
|
|
|
|
+':'+alineno //2
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD>䷽ʽ').asstring) // 3
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><>װ').asstring) //5
|
|
|
|
|
+':'+ GetpkgsEdi(trim(aDataset.fieldbyname('<27><>װ').asstring)) //6
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //7
|
|
|
|
|
+':' //8
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //9
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record43_SO(aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
if (trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D') or (trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R') THEN
|
|
|
|
|
begin
|
|
|
|
|
result:='43'
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //2
|
|
|
|
|
+':' //3
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //4
|
|
|
|
|
+':' //5
|
|
|
|
|
+':' //6
|
|
|
|
|
+':' //7
|
|
|
|
|
+':' //8
|
|
|
|
|
+':' //9
|
|
|
|
|
+':' //10
|
|
|
|
|
+':' //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
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record43_SI(aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
if (trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D') OR (trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R') THEN
|
|
|
|
|
begin
|
|
|
|
|
result:='43'
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //2
|
|
|
|
|
+':' //3
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring) //4
|
|
|
|
|
+':' //5
|
|
|
|
|
+':' //6
|
|
|
|
|
+':' //7
|
|
|
|
|
+':' //8
|
|
|
|
|
+':' //9
|
|
|
|
|
+':' //10
|
|
|
|
|
+':' //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
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record44_47_SO_SI(strLen,LoopCount:integer;RecordNo,FldName:string;aDataset:TDataset):TStringlist;
|
|
|
|
|
var sl,sl1:Tstringlist;
|
|
|
|
|
m,l:integer;
|
|
|
|
|
s:string;
|
|
|
|
|
begin
|
|
|
|
|
result:=Tstringlist.Create;
|
|
|
|
|
sl:=Tstringlist.Create;
|
|
|
|
|
sl1:=Tstringlist.Create;
|
|
|
|
|
try
|
|
|
|
|
sl1.Text:=FormatEdiString(aDataset.fieldbyname(FldName).AsString);
|
|
|
|
|
GetLengthTString(sl1,strLen);
|
|
|
|
|
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<=LoopCount then begin
|
|
|
|
|
if M=1 then begin
|
|
|
|
|
s:=RecordNo+':'+sl.Strings[L]+':';
|
|
|
|
|
end else begin
|
|
|
|
|
if M=LoopCount then
|
|
|
|
|
s:=s+sl.Strings[L]
|
|
|
|
|
else
|
|
|
|
|
s:=s+sl.Strings[L]+':';
|
|
|
|
|
end;
|
|
|
|
|
end else begin
|
|
|
|
|
S:=S+'''';
|
|
|
|
|
result.Add(S);
|
|
|
|
|
M:=1;
|
|
|
|
|
s:=RecordNo+':'+sl.Strings[L]+':';
|
|
|
|
|
end;
|
|
|
|
|
M:=M+1;
|
|
|
|
|
end;
|
|
|
|
|
S:=S+'''';
|
|
|
|
|
result.Add(S);
|
|
|
|
|
finally
|
|
|
|
|
sl.Free;
|
|
|
|
|
sl1.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record48_SO(aDataset:TDataset):TStringlist;
|
|
|
|
|
var strsql,strtype:string;
|
|
|
|
|
rs:TADOQuery;
|
|
|
|
|
begin
|
|
|
|
|
if frm_op_seae.t_op_seae.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
|
|
strtype:='Y'
|
|
|
|
|
ELSE strtype:='N';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result:=TStringlist.Create;
|
|
|
|
|
strsql:='select <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C>ߴ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD> from t_op_ctn group by <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C>ߴ<EFBFBD>,<2C><><EFBFBD><EFBFBD> having <20><><EFBFBD><EFBFBD>='
|
|
|
|
|
+#39+aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+#39;
|
|
|
|
|
try
|
|
|
|
|
rs:=TADOQuery.Create(application);
|
|
|
|
|
rs.Connection := frm_main.db;
|
|
|
|
|
rs.sql.clear;
|
|
|
|
|
rs.sql.add(strsql);
|
|
|
|
|
rs.Open;
|
|
|
|
|
rs.First;
|
|
|
|
|
while not rs.Eof do
|
|
|
|
|
begin
|
|
|
|
|
result.Add ('48:'+Trim(GetCntrEdi(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)) //2
|
|
|
|
|
+':'+trim(rs.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //3
|
|
|
|
|
+':'+'F' //4
|
|
|
|
|
+':' //5
|
|
|
|
|
+':' //6
|
|
|
|
|
+':' //7
|
|
|
|
|
+':' //8
|
|
|
|
|
+':'+strtype //9
|
|
|
|
|
+#39);
|
|
|
|
|
rs.Next;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
rs.Close;
|
|
|
|
|
rs.Destroy;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record49(aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='49'
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) // 2
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //3
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //4
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //5
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record51_SO(alineno:string;aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='51'
|
|
|
|
|
+':' // 2
|
|
|
|
|
+':'+ trim(GetCntrEdi(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)) //3
|
|
|
|
|
+':' //4
|
|
|
|
|
+':' //5
|
|
|
|
|
+':' //6
|
|
|
|
|
+':' //7
|
|
|
|
|
+':' //9
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.Record51_SI(alineno:string;aDataset:TDataset):String;
|
|
|
|
|
begin
|
|
|
|
|
result:='51'
|
|
|
|
|
+':'+alineno // 2
|
|
|
|
|
+':'+trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //3
|
|
|
|
|
+':'+ trim(GetCntrEdi(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)) //4
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //5
|
|
|
|
|
+':' //6
|
|
|
|
|
+':' //7
|
|
|
|
|
+':' //8
|
|
|
|
|
+':' //9
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //10
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><>װ').asstring) //11
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //12
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //13
|
|
|
|
|
+':'+ trim(aDataset.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring) //14
|
|
|
|
|
+#39;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.IsZhongwen(Str: String): Boolean;
|
|
|
|
|
var
|
|
|
|
|
i:Integer;
|
|
|
|
|
begin
|
|
|
|
|
Result:=false;
|
|
|
|
|
if Str='' then Exit;
|
|
|
|
|
for i:=1 to Length(Str) do begin
|
|
|
|
|
if Str[i]>Chr(127) then begin
|
|
|
|
|
Result:=True;
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.GetLengthword(var s: String; l: Integer;str:String): String;
|
|
|
|
|
var
|
|
|
|
|
i:Integer;
|
|
|
|
|
b:Boolean;
|
|
|
|
|
begin
|
|
|
|
|
s:='';
|
|
|
|
|
if Length(str)<=l then begin
|
|
|
|
|
result:=str;
|
|
|
|
|
end else begin
|
|
|
|
|
b:=true;
|
|
|
|
|
s:=Copy(str,l+1,Length(str)-l);
|
|
|
|
|
str:=Copy(str,1,l);
|
|
|
|
|
result:='';
|
|
|
|
|
for i:=Length(str) downto 1 do begin
|
|
|
|
|
if ( not (str[i] in [' ',';',',','.',':','/','(',')','?','+','-'])) and b then
|
|
|
|
|
s:=str[i]+s
|
|
|
|
|
else begin
|
|
|
|
|
b:=false;
|
|
|
|
|
result:=str[i]+Result;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
s:=s+' ';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_kam.GetLengthTString(var sl: TStringList; l: integer);
|
|
|
|
|
var
|
|
|
|
|
i:integer;
|
|
|
|
|
str_head,S:String;
|
|
|
|
|
Stemp:TStrings;
|
|
|
|
|
begin
|
|
|
|
|
Stemp:=TStringList.Create;
|
|
|
|
|
try
|
|
|
|
|
str_head:='';
|
|
|
|
|
S:='';
|
|
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
|
|
if sl[i]<>'' then
|
|
|
|
|
stemp.add(GetLengthword(str_head,l,s+sl[i]));
|
|
|
|
|
S:=Str_head;
|
|
|
|
|
end;
|
|
|
|
|
while S<>'' do begin
|
|
|
|
|
stemp.add(GetLengthword(str_head,l,s));
|
|
|
|
|
S:=Str_head;
|
|
|
|
|
end;
|
|
|
|
|
SL.Assign(Stemp);
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(Stemp);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.FormatEdiString(str:String;Strlength:integer=0):String;
|
|
|
|
|
var
|
|
|
|
|
i:integer;
|
|
|
|
|
strC:widestring;
|
|
|
|
|
begin
|
|
|
|
|
strC:='';
|
|
|
|
|
for i:=1 to length(str) do
|
|
|
|
|
begin
|
|
|
|
|
if ((str[i]=#39) or (str[i]=':') or (str[i]='+') or (str[i]='?') or (str[i]=';')) then
|
|
|
|
|
begin
|
|
|
|
|
strC:=strC+'?'+str[i];
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
strC:=strC+str[i];
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
result:=strC;
|
|
|
|
|
{
|
|
|
|
|
Result:=Trim(str);
|
|
|
|
|
Result:=StringReplace(Result,'?','??',[rfReplaceAll]);
|
|
|
|
|
Result:=StringReplace(Result,':','?:',[rfReplaceAll]);
|
|
|
|
|
Result:=StringReplace(Result,'''','?''',[rfReplaceAll]);
|
|
|
|
|
Result:=StringReplace(Result,'+','?+',[rfReplaceAll]);
|
|
|
|
|
}
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.FormatListString(Old:TStrings;mCount,Strlength:integer):String;
|
|
|
|
|
var
|
|
|
|
|
i:integer;
|
|
|
|
|
NewStrs:TStrings;
|
|
|
|
|
mStr:String;
|
|
|
|
|
begin
|
|
|
|
|
Result:='';
|
|
|
|
|
NewStrs:=TStringList.Create;
|
|
|
|
|
for i:=0 to old.Count-1 do begin
|
|
|
|
|
if Length(old.Strings[i])<=Strlength then begin
|
|
|
|
|
NewStrs.Add(old.Strings[i]);
|
|
|
|
|
end else begin
|
|
|
|
|
mStr:=old.Strings[i];
|
|
|
|
|
while length(mStr)>Strlength do begin
|
|
|
|
|
newStrs.Add(copy(mStr,1,Strlength));
|
|
|
|
|
system.Delete(mStr,1,Strlength);
|
|
|
|
|
end;
|
|
|
|
|
newStrs.Add(mStr);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
try
|
|
|
|
|
for i:=0 to mCount-1 do begin
|
|
|
|
|
if i<NewStrs.Count then begin
|
|
|
|
|
Result:=Result+NewStrs.Strings[i];
|
|
|
|
|
end;
|
|
|
|
|
if i<mCount-1 then
|
|
|
|
|
Result:=Result+':';
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(NewStrs);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.GetStrNum(str:String):integer;
|
|
|
|
|
var
|
|
|
|
|
i:integer;
|
|
|
|
|
begin
|
|
|
|
|
result:=0;
|
|
|
|
|
if str='' then exit;
|
|
|
|
|
for i:=1 to length(Str) do begin
|
|
|
|
|
if str[i] in ['0','1','2','3','4','5','6','7','8','9'] then
|
|
|
|
|
result:=result+1;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_kam.bsSkinButton2Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_kam.FormShow(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
inifile1:Tinifile;
|
|
|
|
|
begin
|
|
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
|
|
|
|
|
edit1.text:=inifile1.ReadString('EDI','kamSEND','');
|
|
|
|
|
edit2.text:=inifile1.ReadString('EDI','kamRECIEVE','123456');
|
|
|
|
|
edit3.text:=inifile1.ReadString('EDI','kamSENDNAME','');
|
|
|
|
|
edit4.text:=inifile1.ReadString('EDI','kamFTPSERVER',get_parameters_value(77,''));
|
|
|
|
|
edit5.text:=inifile1.ReadString('EDI','kamFTPPATH',get_parameters_value(78,'/'));
|
|
|
|
|
edit6.text:=inifile1.ReadString('EDI','kamFTPNAME',get_parameters_value(79,''));
|
|
|
|
|
edit7.text:=inifile1.ReadString('EDI','kamFTPPASS',get_parameters_value(80,''));
|
|
|
|
|
inifile1.free;
|
|
|
|
|
CheckError:=False;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_kam.bsSkinButton1Click(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
Str:TStrings;
|
|
|
|
|
inifile1:Tinifile;
|
|
|
|
|
i:integer;
|
|
|
|
|
begin
|
|
|
|
|
str:=Tstringlist.Create;
|
|
|
|
|
try
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
Str:=CreateEdiFile
|
|
|
|
|
else
|
|
|
|
|
Str:=CreateEdiFile
|
|
|
|
|
else if Pos('<27><>Ʊ',(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring))>0 then
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
for i:=0 to Str.Count-1 do begin
|
|
|
|
|
if IsZhongwen(Str[i]) then begin
|
|
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>淶<EFBFBD>ַ<EFBFBD> ('+Str[i]+') ,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
if CheckError and (bsSkinRadioGroup2.ItemIndex=1) then Exit;
|
|
|
|
|
|
|
|
|
|
SaveDialog1.FileName:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring;
|
|
|
|
|
if SaveDialog1.Execute then
|
|
|
|
|
begin
|
|
|
|
|
str.SaveToFile(SaveDialog1.FileName+'.txt');
|
|
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(Str)
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
|
|
|
|
|
inifile1.WriteString('EDI','kamSEND',edit1.text);
|
|
|
|
|
inifile1.WriteString('EDI','kamRECIEVE',edit2.text);
|
|
|
|
|
inifile1.WriteString('EDI','kamSENDNAME',edit3.text);
|
|
|
|
|
inifile1.WriteString('EDI','kamFTPSERVER',edit4.text);
|
|
|
|
|
inifile1.WriteString('EDI','kamFTPPATH',edit5.text);
|
|
|
|
|
inifile1.WriteString('EDI','kamFTPNAME',edit6.text);
|
|
|
|
|
inifile1.WriteString('EDI','kamFTPPASS',edit7.text);
|
|
|
|
|
inifile1.free;
|
|
|
|
|
|
|
|
|
|
close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.isEditrue(DataSet:TDataSet): boolean;
|
|
|
|
|
var
|
|
|
|
|
cntrs,Lines:String;
|
|
|
|
|
sl:TStrings;
|
|
|
|
|
i:Integer;
|
|
|
|
|
aAdoQuery:TAdoQuery;
|
|
|
|
|
begin
|
|
|
|
|
result:=true;
|
|
|
|
|
sl:=TStringList.Create;
|
|
|
|
|
{
|
|
|
|
|
if trim(DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27>ᵥ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
|
|
with aAdoQuery do
|
|
|
|
|
try
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('select * from t_op_kam where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
|
|
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
Open;
|
|
|
|
|
if IsEmpty then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ջ<EFBFBD><D5BB><EFBFBD>,֪ͨ<CDA8>˴<EFBFBD><CBB4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>,<2C><>˫<EFBFBD><CBAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ά<EFBFBD><CEAC>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
if (trim(fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring)='')
|
|
|
|
|
or (trim(fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring)='')
|
|
|
|
|
or (trim(fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring)='') then
|
|
|
|
|
begin
|
|
|
|
|
// result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ջ<EFBFBD><D5BB><EFBFBD>,֪ͨ<CDA8>˴<EFBFBD><CBB4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>,<2C><>˫<EFBFBD><CBAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ά<EFBFBD><CEAC>',mtWarning,[mbOk],0);
|
|
|
|
|
//exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
Free;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD>ѷ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('װ<>۴<EFBFBD><DBB4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('װ<><D7B0><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if GetShipEdiNO(DataSet.fieldbyname('<27><>վ').asstring)='' then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><>վEDI<44><49><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD><EFBFBD>ϵͳ<CFB5>ͻ<EFBFBD> ά<><CEAC> EDI<44><49><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
if GetShipEdiNO(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='' then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD><EFBFBD>ϵͳ<CFB5>ͻ<EFBFBD> ά<><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if GetShipEdiNO(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB><EFBFBD>').AsString)='' then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD><EFBFBD>ϵͳ<CFB5>ͻ<EFBFBD> ά<><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if GetShipEdiNO(DataSet.fieldbyname('֪ͨ<CDA8><D6AA>').AsString)='' then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('֪ͨ<CDA8>˴<EFBFBD><CBB4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>,<2C><><EFBFBD><EFBFBD>ϵͳ<CFB5>ͻ<EFBFBD> ά<><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('Ŀ<>ĵ<EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('Ŀ<>ĵز<C4B5><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('Ŀ<>ĵش<C4B5><D8B4>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('ǩ<><C7A9><EFBFBD>ص㲻<D8B5><E3B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if trim(DataSet.fieldbyname('<27><>ͷ').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger=0 then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat=0 then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').asFloat=0 then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27>ܳ<EFBFBD><DCB3>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if trim(DataSet.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>,',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='D' then begin
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if GetStrNum(Trim(frm_op_seae.t_op_seae.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').asstring))<>4 then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD>ű<EFBFBD><C5B1><EFBFBD><EFBFBD><EFBFBD>4λ<34><CEBB><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)='R' then begin
|
|
|
|
|
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>¶Ȳ<C2B6><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sl.Clear;
|
|
|
|
|
sl.Text:=Changestr(DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
|
|
begin
|
|
|
|
|
if IsZhongwen(sl[i]) then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Lines:=ControlLines(sl.Count,0,0,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
|
|
if Lines<>'' then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sl.Clear;
|
|
|
|
|
sl.Text:=Changestr(DataSet.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
|
|
begin
|
|
|
|
|
if IsZhongwen(sl[i]) then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2><EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
Lines:=ControlLines(sl.Count,0,0,'<27>ջ<EFBFBD><D5BB><EFBFBD>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
|
|
if Lines<>'' then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
sl.Clear;
|
|
|
|
|
sl.Text:=Changestr(DataSet.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').asstring);
|
|
|
|
|
for i:=0 to sl.Count-1 do begin
|
|
|
|
|
if IsZhongwen(sl[i]) then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>TAB<41><42>!',mtWarning,[mbOk],0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if Length(sl[i])>35 then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD>!',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
Lines:=ControlLines(sl.Count,0,0,'֪ͨ<CDA8><D6AA>'); //LinesCount,CorpTypeid,BsTypeid:Integer;SName:string
|
|
|
|
|
if Lines<>'' then
|
|
|
|
|
begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('EDI<44><49>Ϣ<EFBFBD><CFA2>'+Lines+'!',mtWarning,[mbOk],0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then begin
|
|
|
|
|
t_op_ctn.close;
|
|
|
|
|
t_op_ctn.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
t_op_ctn.open;
|
|
|
|
|
if t_op_ctn.IsEmpty then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><>װ<EFBFBD>䲻<EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
t_op_ctn.First;
|
|
|
|
|
while not t_op_ctn.Eof do begin
|
|
|
|
|
if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
if Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)='' then begin
|
|
|
|
|
result:=false;
|
|
|
|
|
MessageDlg('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
t_op_ctn.Next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function Tfrm_op_seae_edi_kam.CreateEdiFile:TStrings;
|
|
|
|
|
var str,aTempList:TStringlist;
|
|
|
|
|
strType,SenderCode,ReciverCode:string;
|
|
|
|
|
i,k,LineNo:integer;
|
|
|
|
|
at_op_ctn:TAdoQuery;
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
aTempList:=TStringlist.create;
|
|
|
|
|
str:=TStringlist.create;
|
|
|
|
|
at_op_ctn:=CreateAdoQuery;
|
|
|
|
|
|
|
|
|
|
with at_op_ctn,sql do
|
|
|
|
|
begin
|
|
|
|
|
close;Clear;
|
|
|
|
|
add('select * from t_op_ctn');
|
|
|
|
|
add('where <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>');
|
|
|
|
|
parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:='';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
SenderCode:=trim(edit1.Text) ;
|
|
|
|
|
ReciverCode:=trim(edit2.Text) ;
|
|
|
|
|
if bsSkinRadioGroup1.ItemIndex=0 then
|
|
|
|
|
strType:='9'
|
|
|
|
|
else if bsSkinRadioGroup1.ItemIndex=1 then
|
|
|
|
|
strType:='2'
|
|
|
|
|
else if bsSkinRadioGroup1.ItemIndex=2 then
|
|
|
|
|
strType:='3'
|
|
|
|
|
else if bsSkinRadioGroup1.ItemIndex=3 then
|
|
|
|
|
strType:='4'
|
|
|
|
|
else strType:='9';
|
|
|
|
|
I:=0;
|
|
|
|
|
if frm_op_seae.dxdbgrid1.SelectedCount<=1 then
|
|
|
|
|
begin
|
|
|
|
|
if not isEditrue(frm_op_seae.t_op_seae) then abort;
|
|
|
|
|
I:=0;
|
|
|
|
|
|
|
|
|
|
str.add(Record00_SO_SI(strType,SenderCode,ReciverCode));
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record02_SO(SenderCode,ReciverCode,frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record03_SO(SenderCode,ReciverCode,frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record10_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record11_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record11_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record12_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record12_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record13_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record15_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record15_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record17_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
begin
|
|
|
|
|
str.add(Record16_17_18_SI('16','<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
if CheckError then
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰<EFBFBD><E7BBB0><EFBFBD><EFBFBD><EFBFBD>䡢<EFBFBD><E4A1A2><EFBFBD>治<EFBFBD>ܶ<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
str.add(Record16_17_18_SI('17','<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
str.add(Record16_17_18_SI('18','֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
begin
|
|
|
|
|
str.add(Record20_21_22_SO('20','<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
str.add(Record20_21_22_SO('21','<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
str.add(Record20_21_22_SO('22','֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
// str.add(Record20_21_22_SO('23','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record21_SI(SenderCode,frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record23_SO(SenderCode,frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record41_SO('1',frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record41_SI('1',frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)<>'S' then
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record43_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)<>'S' then
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record43_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aTempList:=Record44_47_SO_SI(35,10,'44','<27><>ͷ',frm_op_seae.t_op_seae);
|
|
|
|
|
str.addstrings(aTempList);
|
|
|
|
|
|
|
|
|
|
aTempList:=Record44_47_SO_SI(70,5,'47','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae);
|
|
|
|
|
|
|
|
|
|
str.addstrings(aTempList);
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
begin
|
|
|
|
|
aTempList:=Record48_SO(frm_op_seae.t_op_seae);
|
|
|
|
|
str.addstrings(aTempList);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LineNo:=1;
|
|
|
|
|
with at_op_ctn do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
Open;First;
|
|
|
|
|
while not eof do
|
|
|
|
|
begin
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
//str.add(Record51_SO(IntToStr(LineNo),at_op_ctn))
|
|
|
|
|
else
|
|
|
|
|
str.add(Record51_SI(IntToStr(LineNo),at_op_ctn));
|
|
|
|
|
LineNo:=LineNo+1;
|
|
|
|
|
Next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
I:=str.Count;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
I:=0;
|
|
|
|
|
str.add(Record00_SO_SI(strType,SenderCode,ReciverCode));
|
|
|
|
|
for k:=0 to frm_op_seae.dxdbgrid1.SelectedCount-1 do
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.GotoBookmark(pointer(frm_op_seae.dxdbgrid1.selectedrows[k]));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record02_SO(SenderCode,ReciverCode,frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record03_SO(SenderCode,ReciverCode,frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record10_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record11_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record11_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record12_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record12_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record13_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record15_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record15_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record17_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
begin
|
|
|
|
|
str.add(Record16_17_18_SI('16','<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
if CheckError then
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰<EFBFBD><E7BBB0><EFBFBD><EFBFBD><EFBFBD>䡢<EFBFBD><E4A1A2><EFBFBD>治<EFBFBD>ܶ<EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
str.add(Record16_17_18_SI('17','<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
str.add(Record16_17_18_SI('18','֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
begin
|
|
|
|
|
str.add(Record20_21_22_SO('20','<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
str.add(Record20_21_22_SO('21','<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
str.add(Record20_21_22_SO('22','֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
// str.add(Record20_21_22_SO('23','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae));
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record21_SI(SenderCode,frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record23_SO(SenderCode,frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record41_SO('1',frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record41_SI('1',frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)<>'S' then
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
str.add(Record43_SO(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
if trim(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').asstring)<>'S' then
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
str.add(Record43_SI(frm_op_seae.t_op_seae));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aTempList:=Record44_47_SO_SI(35,10,'44','<27><>ͷ',frm_op_seae.t_op_seae);
|
|
|
|
|
str.addstrings(aTempList);
|
|
|
|
|
|
|
|
|
|
aTempList:=Record44_47_SO_SI(70,5,'47','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',frm_op_seae.t_op_seae);
|
|
|
|
|
|
|
|
|
|
str.addstrings(aTempList);
|
|
|
|
|
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
begin
|
|
|
|
|
aTempList:=Record48_SO(frm_op_seae.t_op_seae);
|
|
|
|
|
str.addstrings(aTempList);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LineNo:=1;
|
|
|
|
|
with at_op_ctn do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=frm_op_seae.t_op_seae.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
Open;First;
|
|
|
|
|
while not eof do
|
|
|
|
|
begin
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=0 then
|
|
|
|
|
//str.add(Record51_SO(IntToStr(LineNo),at_op_ctn))
|
|
|
|
|
else
|
|
|
|
|
str.add(Record51_SI(IntToStr(LineNo),at_op_ctn));
|
|
|
|
|
LineNo:=LineNo+1;
|
|
|
|
|
Next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
I:=I+lineno;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
str.Add('99:'+intToStr(i+1)+'''');
|
|
|
|
|
Result:=str;
|
|
|
|
|
freeandnil(aTempList);
|
|
|
|
|
//freeandnil(str);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_kam.bsSkinButton3Click(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
IdFTP1:TIdFTP;
|
|
|
|
|
str:widestring;
|
|
|
|
|
str_file:widestring;
|
|
|
|
|
ftpar,ftpname,ftppass,ftppath,ScriptPath:String;
|
|
|
|
|
StrL:TStrings;
|
|
|
|
|
inifile1:Tinifile;
|
|
|
|
|
i:integer;
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
ScriptPath:=ExtractFilePath(ParamStr(0))+'EDIFILE\';
|
|
|
|
|
if not DirectoryExists(ScriptPath) then
|
|
|
|
|
CreateDir(ScriptPath);
|
|
|
|
|
|
|
|
|
|
ftpar:=Trim(edit4.Text);
|
|
|
|
|
if ftpar='' then begin
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50>ַ<EFBFBD><D6B7>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
ftpname:=Trim(edit6.Text);
|
|
|
|
|
if ftpar='' then begin
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
ftppass:=Trim(edit7.Text);
|
|
|
|
|
if ftpar='' then begin
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FTP<54><50><EFBFBD>룡',mtWarning,[mbOk],0);
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
ftppath:=Trim(edit5.Text);
|
|
|
|
|
|
|
|
|
|
str:=ScriptPath
|
|
|
|
|
+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring
|
|
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
|
|
+FormatDateTime('mm',now)
|
|
|
|
|
+FormatDateTime('dd',now)
|
|
|
|
|
+FormatDateTime('hh',now)
|
|
|
|
|
+FormatDateTime('nn',now)+'.txt';
|
|
|
|
|
|
|
|
|
|
str_file:=frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').asstring
|
|
|
|
|
+FormatDateTime('yyyy',now)
|
|
|
|
|
+FormatDateTime('mm',now)
|
|
|
|
|
+FormatDateTime('dd',now)
|
|
|
|
|
+FormatDateTime('hh',now)
|
|
|
|
|
+FormatDateTime('nn',now)+'.txt';
|
|
|
|
|
|
|
|
|
|
strL:=Tstringlist.Create;
|
|
|
|
|
try
|
|
|
|
|
if Trim(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring)='<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
if bsSkinRadioGroup2.ItemIndex=1 then
|
|
|
|
|
StrL:=CreateEdiFile
|
|
|
|
|
else
|
|
|
|
|
StrL:=CreateEdiFile
|
|
|
|
|
else if Pos('<27><>Ʊ',(frm_op_seae.t_op_seae.fieldbyname('װ<>˷<EFBFBD>ʽ').asstring))>0 then
|
|
|
|
|
else begin
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
for i:=0 to StrL.Count-1 do begin
|
|
|
|
|
if IsZhongwen(StrL[i]) then begin
|
|
|
|
|
if MessageDlg('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD><DCBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>淶<EFBFBD>ַ<EFBFBD>,ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbYes,mbNo],0)=mrNo then
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
if CheckError and (bsSkinRadioGroup2.ItemIndex=1) then Exit;
|
|
|
|
|
|
|
|
|
|
strL.SaveToFile(str);
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(StrL)
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
|
|
IdFTP1:=TIdFTP.Create(application);
|
|
|
|
|
with idftp1 do
|
|
|
|
|
begin
|
|
|
|
|
Username:=ftpname;
|
|
|
|
|
Password:=ftppass;
|
|
|
|
|
Host:=ftpar;
|
|
|
|
|
Connect;
|
|
|
|
|
end;
|
|
|
|
|
idftp1.ChangeDir(ftppath);
|
|
|
|
|
idftp1.TransferType:=ftBinary;
|
|
|
|
|
idftp1.Put(str,str_file);
|
|
|
|
|
idftp1.Disconnect;
|
|
|
|
|
|
|
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
|
|
|
|
|
inifile1.WriteString('EDI','KAMSEND',edit1.text);
|
|
|
|
|
inifile1.WriteString('EDI','KAMRECIEVE',edit2.text);
|
|
|
|
|
inifile1.WriteString('EDI','KAMSENDNAME',edit3.text);
|
|
|
|
|
inifile1.WriteString('EDI','KAMFTPSERVER',edit4.text);
|
|
|
|
|
inifile1.WriteString('EDI','KAMFTPPATH',edit5.text);
|
|
|
|
|
inifile1.WriteString('EDI','KAMFTPNAME',edit6.text);
|
|
|
|
|
inifile1.WriteString('EDI','KAMFTPPASS',edit7.text);
|
|
|
|
|
inifile1.free;
|
|
|
|
|
|
|
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>');
|
|
|
|
|
except
|
|
|
|
|
deletefile(str);
|
|
|
|
|
showmessage('<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
end;
|
|
|
|
|
idftp1.Free;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_edi_kam.bsSkinButton4Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
if frm_op_seae_edi_kam.Height=349 then
|
|
|
|
|
frm_op_seae_edi_kam.Height:=200
|
|
|
|
|
else
|
|
|
|
|
frm_op_seae_edi_kam.Height:=349;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|