|
|
unit u_op_ctn;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, bsSkinCtrls, BusinessSkinForm, Grids, Wwdbigrd, Wwdbgrid,
|
|
|
StdCtrls, wwdblook, DB, ADODB, Mask, wwdbedit, Wwdotdot, Wwdbcomb,
|
|
|
DBGridEh, ExtCtrls, DBCtrls, Menus,ComObj, inifiles,
|
|
|
Rio, SOAPHTTPClient,InvokeRegistry,DyxtService,Service,jfczService,BLService,myService,
|
|
|
DBClient,XMLIntf,XMLDoc, xmldom, Xmlxform, kbmMemTable,superobject,
|
|
|
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP ;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_ctn = class(TForm)
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
wwDBGrid1: TwwDBGrid;
|
|
|
wwDBLookupCombo1: TwwDBLookupCombo;
|
|
|
wwDBLookupCombo2: TwwDBLookupCombo;
|
|
|
t_op_ctn: TADOQuery;
|
|
|
t_op_ctn1: TDataSource;
|
|
|
Memo1: TMemo;
|
|
|
Memo2: TMemo;
|
|
|
Memo3: TMemo;
|
|
|
Memo4: TMemo;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
wwDBLookupCombo4: TwwDBLookupCombo;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
Splitter1: TSplitter;
|
|
|
t_op_ctndetail1: TDataSource;
|
|
|
wwDBLookupCombo5: TwwDBLookupCombo;
|
|
|
wwDBLookupCombo3: TwwDBLookupCombo;
|
|
|
t_op_ctndetail: TADOQuery;
|
|
|
DBGridEh1: TDBGridEh;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
t_ch_client: TADOQuery;
|
|
|
t_ch_client1: TDataSource;
|
|
|
t_op_ctnsum1: TDataSource;
|
|
|
t_op_ctnsum: TADOQuery;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
Label1: TLabel;
|
|
|
DBText1: TDBText;
|
|
|
Label2: TLabel;
|
|
|
DBText2: TDBText;
|
|
|
DBText3: TDBText;
|
|
|
Label3: TLabel;
|
|
|
DBText4: TDBText;
|
|
|
Label4: TLabel;
|
|
|
Label5: TLabel;
|
|
|
DBText5: TDBText;
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
N2: TMenuItem;
|
|
|
N3: TMenuItem;
|
|
|
N7: TMenuItem;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
Panel1: TPanel;
|
|
|
DBNavigator1: TDBNavigator;
|
|
|
bsSkinButton11: TbsSkinButton;
|
|
|
Button1: TButton;
|
|
|
bsSkinButton12: TbsSkinButton;
|
|
|
bsSkinButton13: TbsSkinButton;
|
|
|
OpenDialog1: TOpenDialog;
|
|
|
Button2: TButton;
|
|
|
wwDBLookupCombo61: TwwDBLookupCombo;
|
|
|
kbmMemTable1: TkbmMemTable;
|
|
|
kbmMemTable1StringField: TStringField;
|
|
|
kbmMemTable1StringField2: TStringField;
|
|
|
kbmMemTable1IntegerField: TIntegerField;
|
|
|
kbmMemTable1StringField3: TStringField;
|
|
|
kbmMemTable1FloatField: TFloatField;
|
|
|
kbmMemTable1FloatField2: TFloatField;
|
|
|
kbmMemTable1StringField4: TStringField;
|
|
|
kbmMemTable1StringField5: TStringField;
|
|
|
kbmMemTable1StringField6: TStringField;
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
wwDBComboBox2: TwwDBComboBox;
|
|
|
btn1: TButton;
|
|
|
txt1: TStaticText;
|
|
|
bsSkinButton15: TbsSkinButton;
|
|
|
kbmMemTable1Field: TFloatField;
|
|
|
procedure t_op_ctnAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_op_ctnBeforePost(DataSet: TDataSet);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure wwDBLookupCombo1Change(Sender: TObject);
|
|
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure t_op_ctnBeforeDelete(DataSet: TDataSet);
|
|
|
procedure t_op_ctnBeforeEdit(DataSet: TDataSet);
|
|
|
procedure t_op_ctnAfterPost(DataSet: TDataSet);
|
|
|
procedure t_op_ctndetailBeforeInsert(DataSet: TDataSet);
|
|
|
procedure t_op_ctndetailNewRecord(DataSet: TDataSet);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure t_op_ctnAfterOpen(DataSet: TDataSet);
|
|
|
procedure N2Click(Sender: TObject);
|
|
|
procedure N7Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure bsSkinButton11Click(Sender: TObject);
|
|
|
procedure Button1Click(Sender: TObject);
|
|
|
procedure bsSkinButton12Click(Sender: TObject);
|
|
|
procedure bsSkinButton13Click(Sender: TObject);
|
|
|
procedure Button2Click(Sender: TObject);
|
|
|
procedure btn1Click(Sender: TObject);
|
|
|
procedure bsSkinButton15Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
mServiceSoap_dy:DyxtServiceSoap;
|
|
|
mServiceSoap_yzh:ServiceSoap;
|
|
|
mHttpRIO_dy,mHttpRIO_yzh:THTTPRIO;
|
|
|
|
|
|
procedure Updatebs;
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
dbserver:string;
|
|
|
|
|
|
procedure getwebservice_dy;
|
|
|
procedure getwebservice_yzh;
|
|
|
procedure dewebservice;
|
|
|
procedure GetdyczInfo_dy(s_caragt,s_key,s_billno,bsno:String);
|
|
|
procedure GetdyczInfo_yzh(s_caragt,s_key,s_billno,bsno:String);
|
|
|
procedure GetdyczInfo_jfcz(s_caragt,s_key,s_billno,bsno:String);
|
|
|
procedure GetdyczInfo_lhcz(s_caragt,s_key,s_billno,bsno:String);
|
|
|
function getYardCode(yard:string):string;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_ctn: Tfrm_op_ctn;
|
|
|
frm_op_ctn_type:boolean;
|
|
|
op_ctn_limited:string;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_data_share, my_sys_function, u_op_seae, u_op_seai, u_main,
|
|
|
u_op_seae_ctn;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.getwebservice_dy;
|
|
|
begin
|
|
|
try
|
|
|
mHttpRIO_dy:=THTTPRIO.Create(nil);
|
|
|
mHttpRIO_dy.WSDLLocation:='http://www.yydy.com/GacoWebService/DyxtService.asmx?WSDL';
|
|
|
mHttpRIO_dy.URL:='http://www.yydy.com/GacoWebService/DyxtService.asmx';
|
|
|
mHttpRIO_dy.Port:='DyxtServiceSoap';
|
|
|
mHttpRIO_dy.Service:='DyxtWebService';
|
|
|
mHttpRIO_dy.HTTPWebNode.UseUTF8InHeader:=true;
|
|
|
mServiceSoap_dy:=mHttpRIO_dy as DyxtServiceSoap;
|
|
|
InvRegistry.RegisterInvokeOptions(TypeInfo(DyxtServiceSoap),ioDocument );//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
|
|
except
|
|
|
on E:Exception do
|
|
|
begin
|
|
|
ShowMessage(e.Message);
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.getwebservice_yzh;
|
|
|
begin
|
|
|
try
|
|
|
mHttpRIO_yzh:=THTTPRIO.Create(nil);
|
|
|
//170<37>ij<EFBFBD>186
|
|
|
mHttpRIO_yzh.WSDLLocation:='http://222.173.95.186:78/selectservice/Service.asmx?WSDL';
|
|
|
mHttpRIO_yzh.URL:='http://222.173.95.186:78/selectservice/Service.asmx';
|
|
|
mHttpRIO_yzh.Port:='ServiceSoap';
|
|
|
mHttpRIO_yzh.Service:='WebService';
|
|
|
mHttpRIO_yzh.HTTPWebNode.UseUTF8InHeader:=true;
|
|
|
mServiceSoap_yzh:=mHttpRIO_yzh as ServiceSoap;
|
|
|
InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceSoap),ioDocument );//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
|
|
|
|
|
|
|
|
{
|
|
|
mHttpRIO_yzh:=THTTPRIO.Create(nil);
|
|
|
mHttpRIO_yzh.WSDLLocation:='http://www.eimskipdepot.com:78/Service.asmx?WSDL';
|
|
|
mHttpRIO_yzh.URL:='http://www.eimskipdepot.com:78/Service.asmx';
|
|
|
mHttpRIO_yzh.Port:='ServiceSoap';
|
|
|
mHttpRIO_yzh.Service:='WebService';
|
|
|
mHttpRIO_yzh.HTTPWebNode.UseUTF8InHeader:=true;
|
|
|
mServiceSoap_yzh:=mHttpRIO_yzh as ServiceSoap;
|
|
|
InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceSoap),ioDocument );//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
|
|
}
|
|
|
except
|
|
|
on E:Exception do
|
|
|
begin
|
|
|
ShowMessage(e.Message);
|
|
|
exit;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.dewebservice;
|
|
|
begin
|
|
|
mHttpRIO_dy.Free;
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.GetdyczInfo_jfcz(s_caragt,s_key,s_billno,bsno:String);
|
|
|
var
|
|
|
b:Boolean;
|
|
|
s_web: WideString;
|
|
|
xmldoc:IXMLDocument;
|
|
|
cds:TClientDataSet;
|
|
|
XMLTransformProvider1:TXMLTransformProvider;
|
|
|
s_ctnno,s_ctnType:string;
|
|
|
smartWS:BLServiceSoap;
|
|
|
sltcnt:GetLTCntrInfoResult;
|
|
|
begin
|
|
|
try
|
|
|
t_op_ctn.DisableControls;
|
|
|
cds:=TClientDataSet.Create(nil);
|
|
|
XMLTransformProvider1:=TXMLTransformProvider.Create(NIL);
|
|
|
|
|
|
sltcnt:=GetLTCntrInfoResult.Create;
|
|
|
cds.Active:=false;
|
|
|
xmldoc:=NewXMLDocument;
|
|
|
xmldoc.Encoding:='UTF-8';
|
|
|
|
|
|
smartWS:=GetBLServiceSoap(False,'');
|
|
|
s_web:=smartWS.GetBLNoInfo(s_billno,'18315FA0-8E5A-4935-8369-91BE89BC6B6A');
|
|
|
//ShowMessage(s_web);
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
xmldoc.SaveToFile('c:\JFCZ.xml');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if FileExists(ExtractFilePath(Application.ExeName)+'jfcz\jfcz.xtr') then
|
|
|
begin
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'jfcz\jfcz.xtr';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
CreateDirectory(pChar(ExtractFilePath(Application.ExeName)+'jfcz'),nil);
|
|
|
CopyFile(pChar('\\'+dbserver+'\jfcz\jfcz.xtr'),pChar(ExtractFilePath(Application.ExeName)+'jfcz\jfcz.xtr'),True);
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'jfcz\jfcz.xtr';
|
|
|
end;
|
|
|
|
|
|
// XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\jfcz\jfcz.xtr';
|
|
|
XMLTransformProvider1.TransformRead.SourceXmlDocument:=xmldoc.GetDOMDocument;
|
|
|
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
cds.Active:=true;
|
|
|
|
|
|
|
|
|
kbmMemTable1.EmptyTable;
|
|
|
kbmMemTable1.Open;
|
|
|
|
|
|
with cds do
|
|
|
begin
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
if kbmMemTable1.Locate('<27><><EFBFBD><EFBFBD>',Trim(FieldByName('CNTRNO').AsString),[]) then
|
|
|
begin
|
|
|
kbmMemTable1.Edit;
|
|
|
s_ctnno:=Trim(FieldByName('CNTRSIZE').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('CNTRTYPE').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
kbmMemTable1.FieldByName('<27>ߴ<EFBFBD>').AsString:=FieldByName('CNTRSIZE').AsString;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('CNTRTYPE').AsString;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('SEALNO').AsString;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger+FieldByName('CARGOQTY').AsInteger;
|
|
|
kbmMemTable1.FieldByName('<27><>װ').AsString:=FieldByName('CO_PKGCODE').AsString;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat+FieldByName('CARGOWEIGHT').AsFloat;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat+FieldByName('CARGOVOLUME').AsFloat;
|
|
|
if (cds.FindField('BOXWEIGHT')<>nil) then begin
|
|
|
|
|
|
|
|
|
end;
|
|
|
kbmMemTable1.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
kbmMemTable1.append;
|
|
|
s_ctnno:=Trim(FieldByName('CNTRSIZE').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('CNTRTYPE').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
kbmMemTable1.FieldByName('<27>ߴ<EFBFBD>').AsString:=FieldByName('CNTRSIZE').AsString;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('CNTRTYPE').AsString;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('CNTRNO').AsString;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('SEALNO').AsString;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('CARGOQTY').AsInteger;
|
|
|
kbmMemTable1.FieldByName('<27><>װ').AsString:=FieldByName('CO_PKGCODE').AsString;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('CARGOWEIGHT').AsFloat;
|
|
|
kbmMemTable1.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('CARGOVOLUME').AsFloat;
|
|
|
kbmMemTable1.Post;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
with kbmMemTable1 do
|
|
|
begin
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',Trim(FieldByName('<27><><EFBFBD><EFBFBD>').AsString),[]) then
|
|
|
begin
|
|
|
t_op_ctn.Edit;
|
|
|
s_ctnno:=Trim(FieldByName('<27>ߴ<EFBFBD>').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger;
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=FieldByName('<27><>װ').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_op_ctn.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.append;
|
|
|
s_ctnno:=Trim(FieldByName('<27>ߴ<EFBFBD>').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger;
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=FieldByName('<27><>װ').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_op_ctn.Post;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
t_op_ctn.EnableControls;
|
|
|
cds.Free;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.GetdyczInfo_dy(s_caragt,s_key,s_billno,bsno:String);
|
|
|
var
|
|
|
b:Boolean;
|
|
|
s_web: WideString;
|
|
|
xmldoc:IXMLDocument;
|
|
|
cds:TClientDataSet;
|
|
|
XMLTransformProvider1:TXMLTransformProvider;
|
|
|
s_ctnno,s_ctnType:string;
|
|
|
|
|
|
begin
|
|
|
try
|
|
|
t_op_ctn.DisableControls;
|
|
|
getwebservice_dy;
|
|
|
cds:=TClientDataSet.Create(nil);
|
|
|
XMLTransformProvider1:=TXMLTransformProvider.Create(NIL);
|
|
|
|
|
|
// s_billno:='HLCUTA1130371756'; //QDJY000476
|
|
|
|
|
|
cds.Active:=false;
|
|
|
xmldoc:=NewXMLDocument;
|
|
|
xmldoc.Encoding:='UTF-8';
|
|
|
|
|
|
s_web:=mServiceSoap_dy.GetCtnChargeXml(s_caragt,s_key,s_billno,'','1');
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
xmldoc.SaveToFile('c:\<5C><><EFBFBD><EFBFBD>.xml');
|
|
|
|
|
|
if FileExists(ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr') then
|
|
|
begin
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
|
|
|
CreateDirectory(pChar(ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ'),nil);
|
|
|
CopyFile(pChar('\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr'),pChar(ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr'),True);
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr';
|
|
|
//XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr';
|
|
|
//XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr';
|
|
|
end;
|
|
|
|
|
|
XMLTransformProvider1.TransformRead.SourceXmlDocument:=xmldoc.GetDOMDocument;
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
cds.Active:=true;
|
|
|
with cds do
|
|
|
begin
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',Trim(FieldByName('CTNNO').AsString),[]) then
|
|
|
begin
|
|
|
t_op_ctn.Edit;
|
|
|
s_ctnno:=Trim(FieldByName('CTNSZ').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('CTNTP').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=StringReplace(Copy(FieldByName('EMFUEDT').AsString,1,Pos('.',FieldByName('EMFUEDT').AsString)-1),'T',' ',[]);
|
|
|
t_op_ctn.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.append;
|
|
|
s_ctnno:=Trim(FieldByName('CTNSZ').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('CTNTP').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=Trim(FieldByName('CTNNO').AsString);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=StringReplace(Copy(FieldByName('EMFUEDT').AsString,1,Pos('.',FieldByName('EMFUEDT').AsString)-1),'T',' ',[]);
|
|
|
{
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,3].Value);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,6].Value);
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,7].Value);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,8].Value);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,9].Value);
|
|
|
}
|
|
|
t_op_ctn.Post;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
s_web:=mServiceSoap_dy.GetBackFCtnInfoXml(s_caragt,s_key,s_billno,'','1');
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
xmldoc.SaveToFile('c:\<5C><><EFBFBD>䷵<EFBFBD><E4B7B5>.xml');
|
|
|
|
|
|
if FileExists(ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD>䷵<EFBFBD><E4B7B5>.xtr') then
|
|
|
begin
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD>䷵<EFBFBD><E4B7B5>.xtr';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
CreateDirectory(pChar(ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ'),nil);
|
|
|
CopyFile(pChar('\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr'),pChar(ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD>䷵<EFBFBD><E4B7B5>.xtr'),True);
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD>䷵<EFBFBD><E4B7B5>.xtr';
|
|
|
end;
|
|
|
// XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD>䷵<EFBFBD><E4B7B5>.xtr';
|
|
|
XMLTransformProvider1.TransformRead.SourceXmlDocument:=xmldoc.GetDOMDocument;
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
cds.Active:=true;
|
|
|
|
|
|
with cds do
|
|
|
begin
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',Trim(FieldByName('CTNNO').AsString),[]) then
|
|
|
begin
|
|
|
t_op_ctn.Edit;
|
|
|
s_ctnno:=Trim(FieldByName('CTNSZ').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('CTNTP').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('SEALNO').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('PKGS').AsInteger;
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:='';
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALKWGT').AsFloat;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALCUBAGE').AsFloat;
|
|
|
t_op_ctn.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.append;
|
|
|
s_ctnno:=Trim(FieldByName('CTNSZ').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('CTNTP').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('SEALNO').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('PKGS').AsInteger;
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:='';
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALKWGT').AsFloat;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALCUBAGE').AsFloat;
|
|
|
t_op_ctn.Post;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
// <20><>װ
|
|
|
s_web:=mServiceSoap_dy.GetLoadCargoInfoXml(s_caragt,s_key,s_billno,'','1');
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
xmldoc.SaveToFile('c:\<5C><>װ.xml');
|
|
|
|
|
|
if FileExists(ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><>װ.xtr') then
|
|
|
begin
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><>װ.xtr';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
CreateDirectory(pChar(ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ'),nil);
|
|
|
CopyFile(pChar('\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr'),pChar(ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><>װ.xtr'),True);
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'<27><><EFBFBD>dz<EFBFBD>վ\<5C><>װ.xtr';
|
|
|
end;
|
|
|
|
|
|
// XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><>װ.xtr';
|
|
|
XMLTransformProvider1.TransformRead.SourceXmlDocument:=xmldoc.GetDOMDocument;
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
cds.Active:=true;
|
|
|
|
|
|
|
|
|
if not cds.IsEmpty then
|
|
|
begin
|
|
|
try
|
|
|
with t_op_ctn do
|
|
|
begin
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
Edit;
|
|
|
FieldByName('<27><>װ').AsString:=cds.FieldByName('PKTP').AsString;
|
|
|
Post;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
end;
|
|
|
end;
|
|
|
{
|
|
|
s_web:=mServiceSoap_dy.GetEnterPortInfoXml(s_caragt,s_key,s_billno,'','1');
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
|
|
|
/// xmldoc.SaveToFile('c:\<5C><><EFBFBD><EFBFBD>.xml');
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr';
|
|
|
XMLTransformProvider1.TransformRead.SourceXmlDocument:=xmldoc.GetDOMDocument;
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
cds.Active:=true;
|
|
|
|
|
|
|
|
|
cds.Close;
|
|
|
cds.ProviderName:='XMLTransformProvider1';
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
cds.Active:=True;
|
|
|
|
|
|
// ShowMessage(IntToStr(cds.RecordCount));
|
|
|
|
|
|
|
|
|
|
|
|
s_web:=mServiceSoap_dy.GetCusediInfoXml(s_caragt,s_key,s_billno);
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
|
|
|
/// xmldoc.SaveToFile('c:\<5C><><EFBFBD><EFBFBD>.xml');
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr';
|
|
|
XMLTransformProvider1.TransformRead.SourceXmlDocument:=xmldoc.GetDOMDocument;
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
cds.Active:=true;
|
|
|
|
|
|
BoolToStr(mServiceSoap_dy.GetBillInfo(s_caragt,s_key,s_billno),True);
|
|
|
}
|
|
|
finally
|
|
|
// dewebservice;
|
|
|
t_op_ctn.EnableControls;
|
|
|
// ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ϸ<EFBFBD>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD>,<2C>ֹ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD>ļ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>');
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.GetdyczInfo_yzh(s_caragt,s_key,s_billno,bsno:String);
|
|
|
var
|
|
|
b:Boolean;
|
|
|
s_web: WideString;
|
|
|
xmldoc:IXMLDocument;
|
|
|
cds:TClientDataSet;
|
|
|
XMLTransformProvider1:TXMLTransformProvider;
|
|
|
s_ctnno,s_ctnType:string;
|
|
|
|
|
|
begin
|
|
|
try
|
|
|
t_op_ctn.DisableControls;
|
|
|
getwebservice_yzh;
|
|
|
cds:=TClientDataSet.Create(nil);
|
|
|
XMLTransformProvider1:=TXMLTransformProvider.Create(NIL);
|
|
|
|
|
|
// s_billno:='HLCUTA1180315678'; //QDJY000476
|
|
|
|
|
|
cds.Active:=false;
|
|
|
xmldoc:=NewXMLDocument;
|
|
|
xmldoc.Encoding:='UTF-8';
|
|
|
|
|
|
s_web:=mServiceSoap_yzh.P_GETDATA(s_billno,'YT');
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
xmldoc.SaveToFile('c:\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xml');
|
|
|
|
|
|
|
|
|
|
|
|
if FileExists(ExtractFilePath(Application.ExeName)+'<27><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr') then
|
|
|
begin
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'<27><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
|
|
|
CreateDirectory(pChar(ExtractFilePath(Application.ExeName)+'<27><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ'),nil);
|
|
|
CopyFile(pChar('\\'+dbserver+'\<5C><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr'),pChar(ExtractFilePath(Application.ExeName)+'<27><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr'),True);
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'<27><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr';
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
// XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr';
|
|
|
|
|
|
|
|
|
XMLTransformProvider1.TransformRead.SourceXmlDocument:=xmldoc.GetDOMDocument;
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
cds.Active:=true;
|
|
|
|
|
|
with cds do
|
|
|
begin
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',Trim(FieldByName('<27><><EFBFBD><EFBFBD>').AsString),[]) then
|
|
|
begin
|
|
|
t_op_ctn.Edit;
|
|
|
s_ctnno:=Trim(FieldByName('<27>ߴ<EFBFBD>').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('Ǧ<><C7A6><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsInteger;
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:='';
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27>ܳ<EFBFBD><DCB3><EFBFBD>').AsFloat;
|
|
|
t_op_ctn.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.append;
|
|
|
s_ctnno:=Trim(FieldByName('<27>ߴ<EFBFBD>').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('Ǧ<><C7A6><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsInteger;
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:='';
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27>ܳ<EFBFBD><DCB3><EFBFBD>').AsFloat;
|
|
|
t_op_ctn.Post;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
{
|
|
|
s_web:=mServiceSoap_yzh.P_GETDATA(s_billno,'FX');;
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
// xmldoc.SaveToFile('c:\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xml');
|
|
|
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'\<5C><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr';
|
|
|
XMLTransformProvider1.TransformRead.SourceXmlDocument:=xmldoc.GetDOMDocument;
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
cds.Active:=true;
|
|
|
|
|
|
}
|
|
|
|
|
|
finally
|
|
|
// dewebservice;
|
|
|
t_op_ctn.EnableControls;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.GetdyczInfo_lhcz(s_caragt,s_key,s_billno,bsno:String);
|
|
|
var
|
|
|
testService:myServicePortType;
|
|
|
strmsg:string;
|
|
|
s_web: WideString;
|
|
|
xmldoc:IXMLDocument;
|
|
|
cds:TClientDataSet;
|
|
|
XMLTransformProvider1:TXMLTransformProvider;
|
|
|
s_ctnno,s_ctnType:string;
|
|
|
|
|
|
begin
|
|
|
testService:=GetmyServicePortType(false,'http://www.lhl.cn:8190/WebServiceTest/services/myService?wsdl',nil);
|
|
|
|
|
|
|
|
|
try
|
|
|
t_op_ctn.DisableControls;
|
|
|
cds:=TClientDataSet.Create(nil);
|
|
|
XMLTransformProvider1:=TXMLTransformProvider.Create(NIL);
|
|
|
|
|
|
|
|
|
cds.Active:=false;
|
|
|
xmldoc:=NewXMLDocument;
|
|
|
xmldoc.Encoding:='UTF-8';
|
|
|
|
|
|
|
|
|
|
|
|
s_web:=testService.CntrMess(s_billno) ;
|
|
|
// ShowMessage(s_web);
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
xmldoc.SaveToFile('c:\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xml');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if FileExists(ExtractFilePath(Application.ExeName)+'½<><C2BD><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr') then
|
|
|
begin
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'½<><C2BD><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr';
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
CreateDirectory(pChar(ExtractFilePath(Application.ExeName)+'½<><C2BD><EFBFBD><EFBFBD>վ'),nil);
|
|
|
CopyFile(pChar('\\'+dbserver+'\½<><C2BD><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr'),pChar(ExtractFilePath(Application.ExeName)+'½<><C2BD><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr'),True);
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'½<><C2BD><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr';
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
// XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\½<><C2BD><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XMLTransformProvider1.TransformRead.SourceXmlDocument:=xmldoc.GetDOMDocument;
|
|
|
// ShowMessage('3');
|
|
|
cds.Data:=XMLTransformProvider1.Data;
|
|
|
// ShowMessage('4');
|
|
|
cds.Active:=true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with cds do
|
|
|
begin
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',Trim(FieldByName('CTNNO').AsString),[]) then
|
|
|
begin
|
|
|
t_op_ctn.Edit;
|
|
|
s_ctnno:=Trim(FieldByName('CTNSZ').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('CTNTP').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('SEALNO').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('PKGS').AsInteger;
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=FieldByName('PKTP').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALKWGT').AsFloat;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALCUBAGE').AsFloat;
|
|
|
t_op_ctn.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.append;
|
|
|
s_ctnno:=Trim(FieldByName('CTNSZ').AsString);
|
|
|
s_ctnType:=Trim(FieldByName('CTNTP').AsString);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=Trim(FieldByName('CTNNO').AsString);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('SEALNO').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('PKGS').AsInteger;
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=FieldByName('PKTP').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALKWGT').AsFloat;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALCUBAGE').AsFloat;
|
|
|
t_op_ctn.Post;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
t_op_ctn.EnableControls;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.t_op_ctnAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD>']:=t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD>']:=1;
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD>']:='01';
|
|
|
t_op_ctn['<27><><EFBFBD>ط<EFBFBD>ʽ']:='<27>ۼ<EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.t_op_ctnBeforePost(DataSet: TDataSet);
|
|
|
var cntrs:string;
|
|
|
begin
|
|
|
if frm_data_share.t_code_ctn.Locate('<27><><EFBFBD><EFBFBD>',t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,[]) then
|
|
|
begin
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_op_ctn['<27>ߴ<EFBFBD>']:=frm_data_share.t_code_ctn['<27>ߴ<EFBFBD>'];
|
|
|
if frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='20'then
|
|
|
t_op_ctn['TEU']:=1*t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
|
|
|
if (frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='40')OR
|
|
|
(frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='45')then
|
|
|
t_op_ctn['TEU']:=2*t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD>']:='';
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:='';
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD>']:='';
|
|
|
t_op_ctn['<27>ߴ<EFBFBD>']:='';
|
|
|
end;
|
|
|
cntrs:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
if cntrs<>'' then
|
|
|
if ((GetStrNum(cntrs))<>7) or ((GetcharNum(cntrs))<>4) then begin
|
|
|
MessageDlg('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>ȷ!:<3A><>ʽΪ:ABCU1234567',mtWarning,[mbOk],0);
|
|
|
abort;
|
|
|
end;
|
|
|
|
|
|
|
|
|
table_before_post(t_op_ctn,'<27><><EFBFBD><EFBFBD>');
|
|
|
table_before_post(t_op_ctn,'<27><><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_op_ctn);
|
|
|
table_post(t_op_ctndetail);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton4Click(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
str_list:Tstringlist;
|
|
|
begin
|
|
|
if t_op_ctn.isempty then
|
|
|
exit;
|
|
|
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)<>IDOK then
|
|
|
exit;
|
|
|
if wwDBGrid1.SelectedList.Count>=1 then
|
|
|
begin
|
|
|
try
|
|
|
t_op_ctn.DisableControls;
|
|
|
str_list:=Tstringlist.create;
|
|
|
for i:=0 to wwDBGrid1.SelectedList.Count-1 do
|
|
|
begin
|
|
|
t_op_ctn.GotoBookmark(pointer(wwDBGrid1.SelectedList[i]));
|
|
|
str_list.Add(t_op_ctn.fieldbyname('ctn_ID').asstring);
|
|
|
end;
|
|
|
for i:=0 to str_list.Count-1 do
|
|
|
begin
|
|
|
if t_op_ctn.locate('ctn_ID',str_list[i],[]) then
|
|
|
t_op_ctn.Delete;
|
|
|
end;
|
|
|
finally
|
|
|
str_list.free;
|
|
|
t_op_ctn.EnableControls;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.delete;
|
|
|
end;
|
|
|
t_op_ctn.Refresh;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_op_ctn);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.FormShow(Sender: TObject);
|
|
|
var
|
|
|
inifile1:Tinifile;
|
|
|
FromFileName,ToFileName:string;
|
|
|
begin
|
|
|
t_op_ctn.open;
|
|
|
t_op_ctndetail.Open;
|
|
|
frm_data_share.t_code_tradetype.requery;
|
|
|
frm_data_share.t_code_ctn.requery;
|
|
|
frm_data_share.t_code_package.requery;
|
|
|
frm_data_share.t_crm_client_truck.requery;
|
|
|
frm_data_share.t_crm_client_changzhan.requery;
|
|
|
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
|
|
|
dbserver:=inifile1.ReadString('database','Data Source','');
|
|
|
|
|
|
if pos(';',dbserver)>0 then
|
|
|
begin
|
|
|
dbserver:=Copy(dbserver,1,Length(dbserver)-1);
|
|
|
if pos('\',dbserver)>0 then
|
|
|
begin
|
|
|
dbserver:=Copy(dbserver,1,pos('\',dbserver)-1);
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if pos('\',dbserver)>0 then
|
|
|
begin
|
|
|
dbserver:=Copy(dbserver,1,pos('\',dbserver)-1);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FromFileName:='\\'+dbserver+'\jfcz\midas.dll';
|
|
|
ToFileName:=ExtractFilePath(application.ExeName)+'midas.dll';
|
|
|
|
|
|
if not FileExists(ExtractFilePath(application.ExeName)+'midas.dll') then
|
|
|
CopyFile(pChar(FromFileName),pChar(ToFileName),False);
|
|
|
|
|
|
inifile1.free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.wwDBLookupCombo1Change(Sender: TObject);
|
|
|
begin
|
|
|
if (t_op_ctn.State=dsedit)or(t_op_ctn.State=dsinsert) then
|
|
|
begin
|
|
|
if frm_data_share.t_code_ctn.Locate('<27><><EFBFBD><EFBFBD>',wwDBLookupCombo1.text,[]) then
|
|
|
begin
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_op_ctn['<27>ߴ<EFBFBD>']:=frm_data_share.t_code_ctn['<27>ߴ<EFBFBD>'];
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:='';
|
|
|
t_op_ctn['<27><><EFBFBD><EFBFBD>']:='';
|
|
|
t_op_ctn['<27>ߴ<EFBFBD>']:='';
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.FormCloseQuery(Sender: TObject;
|
|
|
var CanClose: Boolean);
|
|
|
begin
|
|
|
CanClose:=frm_close_query(t_op_ctn);
|
|
|
CanClose:=frm_close_query(t_op_ctndetail);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.Updatebs;
|
|
|
var
|
|
|
bok:Tbookmark;
|
|
|
if_first:boolean;
|
|
|
pkgs:integer;
|
|
|
kgs,cbm:double;
|
|
|
s:string;
|
|
|
begin
|
|
|
if t_op_ctn.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
begin
|
|
|
op_befor_post(frm_op_seae.t_op_seae,op_ctn_limited);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
op_befor_post(frm_op_seai.t_op_seai,op_ctn_limited);
|
|
|
end;
|
|
|
|
|
|
|
|
|
if_first:=true;
|
|
|
pkgs:=0;
|
|
|
kgs:=0.00;
|
|
|
cbm:=0.00;
|
|
|
bok:=t_op_ctn.GetBookmark;
|
|
|
try
|
|
|
t_op_ctn.DisableControls;
|
|
|
t_op_ctn.DataSource.DataSet.DisableControls;
|
|
|
t_op_ctn.First;
|
|
|
while not t_op_ctn.Eof do
|
|
|
begin
|
|
|
if strtobool(get_parameters_value(139,'true')) then begin
|
|
|
if if_first then
|
|
|
begin
|
|
|
if (Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'') and (Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'') then
|
|
|
memo1.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
memo2.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
memo3.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS';
|
|
|
memo4.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM';
|
|
|
pkgs:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
kgs:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
cbm:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
if_first:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if (Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'') and (Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'') then
|
|
|
memo1.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
|
|
|
memo2.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring);
|
|
|
memo3.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS');
|
|
|
memo4.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM');
|
|
|
pkgs:=pkgs+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
kgs:=kgs+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
cbm:=cbm+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
|
|
|
end;
|
|
|
end else begin
|
|
|
if if_first then
|
|
|
begin
|
|
|
memo1.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asstring+'/'
|
|
|
+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS'+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM';
|
|
|
memo2.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
memo3.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS';
|
|
|
memo4.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM';
|
|
|
pkgs:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
kgs:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
cbm:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
if_first:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
memo1.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asstring+'/'
|
|
|
+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS'+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM'
|
|
|
);
|
|
|
memo2.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring);
|
|
|
memo3.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS');
|
|
|
memo4.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM');
|
|
|
pkgs:=pkgs+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
kgs:=kgs+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
cbm:=cbm+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
end;
|
|
|
end;
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
|
|
|
|
|
|
if ((pkgs<>0) and (FormatFloat('0.0000;-0.0000;0',pkgs)<>FormatFloat('0.0000;-0.0000;0',t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger)))
|
|
|
or ((kgs<>0) and (FormatFloat('0.0000;-0.0000;0',kgs)<>FormatFloat('0.0000;-0.0000;0',t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat)))
|
|
|
or ((cbm<>0) and (FormatFloat('0.0000;-0.0000;0',cbm)<>FormatFloat('0.0000;-0.0000;0',t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat)))
|
|
|
then
|
|
|
begin
|
|
|
if MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ļ<EFBFBD><C4BC>سߺͼ<DFBA>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ<EFBFBD>ļ<EFBFBD><C4BC>س߲<D8B3>ͬ,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mrYes then
|
|
|
begin
|
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
begin
|
|
|
t_op_ctn.DataSource.DataSet.edit;
|
|
|
{
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=pkgs;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=kgs;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=cbm;
|
|
|
}
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>']:=memo1.Lines.Text;
|
|
|
if pkgs<>0 then
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ']:=memo2.Lines.Text;
|
|
|
if kgs<>0 then
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=memo3.Lines.Text;
|
|
|
if cbm<>0 then
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=memo4.Lines.Text;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=pkgs;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=kgs;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=cbm;
|
|
|
|
|
|
t_op_ctn.DataSource.DataSet.post;
|
|
|
end;
|
|
|
if op_ctn_limited='0002'then
|
|
|
begin
|
|
|
t_op_ctn.DataSource.DataSet.edit;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>']:=memo1.Lines.Text;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=pkgs;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=kgs;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=cbm;
|
|
|
t_op_ctn.DataSource.DataSet.post;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
t_op_ctn.EnableControls;
|
|
|
t_op_ctn.DataSource.DataSet.EnableControls;
|
|
|
t_op_ctn.GotoBookmark(bok);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton6Click(Sender: TObject);
|
|
|
var
|
|
|
bok:Tbookmark;
|
|
|
if_first:boolean;
|
|
|
pkgs:integer;
|
|
|
kgs,cbm:double;
|
|
|
s,package:string;
|
|
|
begin
|
|
|
if t_op_ctn.IsEmpty then
|
|
|
exit;
|
|
|
|
|
|
{
|
|
|
if op_ctn_limited='0001'then
|
|
|
begin
|
|
|
if assigned(frm_op_seae) then
|
|
|
op_befor_post(frm_op_seae.t_op_seae,op_ctn_limited);
|
|
|
end
|
|
|
else
|
|
|
if op_ctn_limited='0002'then
|
|
|
begin
|
|
|
if assigned(frm_op_seae) then
|
|
|
op_befor_post(frm_op_seae.t_op_seae,op_ctn_limited);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
end;
|
|
|
}
|
|
|
t_op_ctn.First;
|
|
|
if_first:=true;
|
|
|
pkgs:=0;
|
|
|
kgs:=0.00;
|
|
|
cbm:=0.00;
|
|
|
bok:=t_op_ctn.GetBookmark;
|
|
|
try
|
|
|
t_op_ctn.DisableControls;
|
|
|
while not t_op_ctn.Eof do
|
|
|
begin
|
|
|
if strtobool(get_parameters_value(139,'true')) then
|
|
|
begin
|
|
|
if if_first then
|
|
|
begin
|
|
|
if (Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'') and (Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'') then
|
|
|
memo1.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
memo2.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
memo3.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS';
|
|
|
memo4.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM';
|
|
|
pkgs:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
kgs:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
cbm:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
package:=t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
if_first:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if (Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'') and (Trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring)<>'') then
|
|
|
memo1.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring);
|
|
|
memo2.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring);
|
|
|
memo3.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS');
|
|
|
memo4.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM');
|
|
|
pkgs:=pkgs+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
kgs:=kgs+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
cbm:=cbm+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
package:=t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
if if_first then
|
|
|
begin
|
|
|
memo1.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asstring+'/'
|
|
|
+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS'+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM';
|
|
|
memo2.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
memo3.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS';
|
|
|
memo4.Lines.Text:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM';
|
|
|
pkgs:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
kgs:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
cbm:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
package:=t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
if_first:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
memo1.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asstring+'/'
|
|
|
+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS'+'/'+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM'
|
|
|
);
|
|
|
memo2.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+t_op_ctn.fieldbyname('<27><>װ').asstring);
|
|
|
memo3.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'KGS');
|
|
|
memo4.Lines.Add(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring+'CBM');
|
|
|
pkgs:=pkgs+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
kgs:=kgs+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
cbm:=cbm+t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
package:=t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
end;
|
|
|
end;
|
|
|
t_op_ctn.next;
|
|
|
end;
|
|
|
if ((pkgs<>0) and (FormatFloat('0.0000;-0.0000;0',pkgs)<>FormatFloat('0.0000;-0.0000;0',t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger)))
|
|
|
or ((kgs<>0) and (FormatFloat('0.0000;-0.0000;0',kgs)<>FormatFloat('0.0000;-0.0000;0',t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat)))
|
|
|
or ((cbm<>0) and (FormatFloat('0.0000;-0.0000;0',cbm)<>FormatFloat('0.0000;-0.0000;0',t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat)))
|
|
|
or ((memo1.Lines.Text<>'') and (memo1.Lines.Text<>t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>').AsString))
|
|
|
or ((Trim(package)<>'') and (Trim(package)<>Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').asstring)))
|
|
|
then
|
|
|
begin
|
|
|
if MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ļ<EFBFBD>,<2C><>,<2C><>,<2C><>װ<EFBFBD>ͼ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ<EFBFBD>ļ<EFBFBD>,<2C><>,<2C><>,<2C><>װ<EFBFBD><D7B0>ͬ,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0)=mrYes then
|
|
|
begin
|
|
|
if op_ctn_limited='0001'then
|
|
|
begin
|
|
|
t_op_ctn.DataSource.DataSet.edit;
|
|
|
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>']:=memo1.Lines.Text;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ']:=memo2.Lines.Text;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=memo3.Lines.Text;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=memo4.Lines.Text;
|
|
|
t_op_ctn.DataSource.DataSet['<27><>װ']:=package;
|
|
|
t_op_ctn.DataSource.DataSet.post;
|
|
|
end;
|
|
|
if op_ctn_limited='0002'then
|
|
|
begin
|
|
|
t_op_ctn.DataSource.DataSet.edit;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>']:=memo1.Lines.Text;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=pkgs;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=kgs;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']:=cbm;
|
|
|
t_op_ctn.DataSource.DataSet.post;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
t_op_ctn.EnableControls;
|
|
|
t_op_ctn.GotoBookmark(bok);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.t_op_ctnBeforeDelete(DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_op_ctn.RecordCount=1 then
|
|
|
begin
|
|
|
if t_op_ctn.DataSource.DataSet.FieldByName('װ<>˷<EFBFBD>ʽ').asstring='<27><><EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
showmessage('ҵ<><D2B5><EFBFBD><EFBFBD>װ<EFBFBD>䲻<EFBFBD><E4B2BB>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if t_op_ctndetail.RecordCount>=1 then
|
|
|
begin
|
|
|
showmessage('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>ü<EFBFBD>װ<EFBFBD><D7B0><EFBFBD>µĻ<C2B5><C4BB><EFBFBD><EFBFBD><EFBFBD>ϸ');
|
|
|
abort;
|
|
|
end;
|
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
begin
|
|
|
op_befor_post(TADOQuery(t_op_ctn.DataSource.DataSet),op_ctn_limited);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
op_befor_post(TADOQuery(t_op_ctn.DataSource.DataSet),op_ctn_limited);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.t_op_ctnBeforeEdit(DataSet: TDataSet);
|
|
|
begin
|
|
|
if op_ctn_limited='0001'then
|
|
|
begin
|
|
|
op_befor_post(TADOQuery(t_op_ctn.DataSource.DataSet),op_ctn_limited);
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
op_befor_post(TADOQuery(t_op_ctn.DataSource.DataSet),op_ctn_limited);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.t_op_ctnAfterPost(DataSet: TDataSet);
|
|
|
begin
|
|
|
{
|
|
|
|
|
|
update_ctn(t_op_ctn);
|
|
|
if t_op_ctnsum.Active then t_op_ctnsum.Requery;
|
|
|
t_op_ctn.Refresh;
|
|
|
}
|
|
|
if ((Pos('RF',t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').AsString)>0) OR (Pos('RH',t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').AsString)>0)) then begin
|
|
|
if op_ctn_limited='0001'then
|
|
|
begin
|
|
|
t_op_ctn.DataSource.DataSet.edit;
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ']:='R';
|
|
|
t_op_ctn.DataSource.DataSet.post;
|
|
|
END;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.t_op_ctndetailBeforeInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_op_ctn.IsEmpty then
|
|
|
begin
|
|
|
ShowMessage('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϢΪ<CFA2>ղ<EFBFBD><D5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӽ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ϸ');
|
|
|
Abort;
|
|
|
end;
|
|
|
if t_op_ctn.State in [dsedit,dsinsert] then t_op_ctn.Post;
|
|
|
t_op_ctn.Refresh;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.t_op_ctndetailNewRecord(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_op_ctndetail['ctn_id']:=t_op_ctn.FieldByName('ctn_id').AsInteger;
|
|
|
t_op_ctndetail['<27><><EFBFBD><EFBFBD>']:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger;
|
|
|
t_op_ctndetail['<27><>װ']:=t_op_ctn.FieldByName('<27><>װ').AsString;
|
|
|
t_op_ctndetail['<27><><EFBFBD><EFBFBD>']:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_op_ctndetail['<27><><EFBFBD><EFBFBD>']:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
t_op_ctndetail['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_op_ctn.FieldByName('Ʒ<><C6B7>').AsString;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton9Click(Sender: TObject);
|
|
|
var i :integer;
|
|
|
str:string;
|
|
|
begin
|
|
|
|
|
|
if t_op_ctn.IsEmpty then
|
|
|
exit;
|
|
|
if wwDBGrid1.SelectedList.Count>=1 then
|
|
|
begin
|
|
|
for i:=0 to wwDBGrid1.SelectedList.Count-1 do
|
|
|
begin
|
|
|
t_op_ctn.GotoBookmark(pointer(wwDBGrid1.SelectedList[i]));
|
|
|
if i=0 then
|
|
|
str:='('+t_op_ctn.fieldbyname('ctn_id').asstring
|
|
|
else
|
|
|
str:=str+','+t_op_ctn.fieldbyname('ctn_id').asstring;
|
|
|
end;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
str:='('+t_op_ctn.fieldbyname('ctn_id').asstring;
|
|
|
end;
|
|
|
str:=str+')';
|
|
|
|
|
|
|
|
|
t_ch_client.close;
|
|
|
t_ch_client.sql.clear;
|
|
|
t_ch_client.sql.add('select * from t_op_ctn '
|
|
|
+'where ctn_id in '+str
|
|
|
+' order by ctn_id');
|
|
|
t_ch_client.open;
|
|
|
|
|
|
try
|
|
|
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>װ<EFBFBD>䵥',2,t_op_ctn.DataSource,nil,nil,nil,nil,t_ch_client1,t_op_ctn1,nil,nil,nil,nil);
|
|
|
except
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.t_op_ctnAfterOpen(DataSet: TDataSet);
|
|
|
begin
|
|
|
if not t_op_ctnsum.Active then t_op_ctnsum.open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.N2Click(Sender: TObject);
|
|
|
begin
|
|
|
t_op_ctn.Append;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.N7Click(Sender: TObject);
|
|
|
var
|
|
|
afield : variant;
|
|
|
i: Integer;
|
|
|
begin
|
|
|
if t_op_ctn.IsEmpty then
|
|
|
exit;
|
|
|
afield := vararraycreate([0,t_op_ctn.fieldcount-1],varvariant);
|
|
|
for i := 0 to (t_op_ctn.fieldcount-1) do
|
|
|
begin
|
|
|
afield[i] :=t_op_ctn.fields[i].value ;
|
|
|
end;
|
|
|
t_op_ctn.append;
|
|
|
for i := 0 to (t_op_ctn.fieldcount-1) do
|
|
|
begin
|
|
|
if t_op_ctn.fields[i].FieldName<>'ctn_id' then
|
|
|
t_op_ctn.fields[i].value := afield[i] ;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
Pnt:Tpoint;
|
|
|
begin
|
|
|
Pnt:=bsSkinButton1.ClientToScreen(Point(0,bsSkinButton1.Height));
|
|
|
PopupMenu1.Popup(Pnt.x,Pnt.y);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton7Click(Sender: TObject);
|
|
|
var
|
|
|
afield : variant;
|
|
|
i,j,m: Integer;
|
|
|
book1:TBookmark;
|
|
|
begin
|
|
|
if t_op_ctn.IsEmpty then
|
|
|
exit;
|
|
|
try
|
|
|
t_op_ctn.DisableControls;
|
|
|
book1:=t_op_ctn.GetBookmark;
|
|
|
|
|
|
m:=t_op_ctn.fieldByName('<27><><EFBFBD><EFBFBD>').AsInteger;
|
|
|
for j:=0 to m-2 do
|
|
|
begin
|
|
|
afield := vararraycreate([0,t_op_ctn.fieldcount-1],varvariant);
|
|
|
for i := 0 to (t_op_ctn.fieldcount-1) do
|
|
|
begin
|
|
|
afield[i] :=t_op_ctn.fields[i].value ;
|
|
|
end;
|
|
|
t_op_ctn.append;
|
|
|
for i := 0 to (t_op_ctn.fieldcount-1) do
|
|
|
begin
|
|
|
if (t_op_ctn.fields[i].FieldName<>'ctn_id') and (t_op_ctn.fields[i].FieldName<>'<27><><EFBFBD><EFBFBD>') then
|
|
|
t_op_ctn.fields[i].value := afield[i] ;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
t_op_ctn.GotoBookmark(book1);
|
|
|
t_op_ctn.EnableControls;
|
|
|
t_op_ctn.Edit;
|
|
|
t_op_ctn.fieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=1;
|
|
|
t_op_ctn.Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
begin
|
|
|
|
|
|
if not do_data(op_ctn_limited,t_op_ctn.DataSource.DataSet.FieldByName('¼<><C2BC><EFBFBD><EFBFBD>').asstring
|
|
|
,t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>Ա').asstring
|
|
|
,t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
,t_op_ctn.DataSource.DataSet.FieldByName('<27>ͷ<EFBFBD>Ա').asstring
|
|
|
,t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>').asstring
|
|
|
,t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) then
|
|
|
begin
|
|
|
Exit;
|
|
|
end;
|
|
|
|
|
|
if t_op_ctn.DataSource.DataSet.FieldByName('ҵ<><D2B5>״̬').AsString<>'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|
|
begin
|
|
|
if not t_op_ctn.IsEmpty then
|
|
|
begin
|
|
|
try
|
|
|
t_op_ctndetail.Close;
|
|
|
t_op_ctndetail.DataSource:=nil;
|
|
|
update_ctn(t_op_ctn);
|
|
|
bsSkinButton6Click(bsSkinButton6);
|
|
|
finally
|
|
|
t_op_ctndetail.DataSource:=t_op_ctn1;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
frm_main.view_momo(t_op_ctn1,'Ʒ<><C6B7>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton10Click(Sender: TObject);
|
|
|
var s_czmc,s_user,s_key,s_yzh,s_yzhuser,s_yzhkey,s_lh:string;
|
|
|
begin
|
|
|
try
|
|
|
s_user:=get_parameters_value(2101,'false');
|
|
|
s_key:=get_parameters_value(2102,'false');
|
|
|
s_czmc:=get_parameters_value(2103,'false');
|
|
|
|
|
|
s_yzhuser:=get_parameters_value(2104,'false');
|
|
|
s_yzhkey:=get_parameters_value(2105,'false');
|
|
|
s_yzh:=get_parameters_value(2106,'false');
|
|
|
|
|
|
s_lh:=get_parameters_value(2109,'false');
|
|
|
|
|
|
// GetdyczInfo_yzh(s_user,s_key,Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_czmc then
|
|
|
GetdyczInfo_dy(s_user,s_key,Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
|
|
|
else
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_yzh then
|
|
|
GetdyczInfo_yzh(s_user,s_key,Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
|
|
|
else
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_lh then
|
|
|
GetdyczInfo_lhcz(s_user,s_key,Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
|
|
|
else
|
|
|
GetdyczInfo_jfcz('','',Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),'');
|
|
|
finally
|
|
|
t_op_ctn.Requery;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
|
|
|
// bsSkinButton6.onClick(bsSkinButton6);
|
|
|
// getczwebmsg(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString,Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString);
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton11Click(Sender: TObject);
|
|
|
begin
|
|
|
frm_main.view_momo(t_op_ctndetail1,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.Button1Click(Sender: TObject);
|
|
|
var qty:integer;
|
|
|
pkg,cbm:Double;
|
|
|
begin
|
|
|
qty:=0;
|
|
|
pkg:=0;
|
|
|
cbm:=0;
|
|
|
if t_op_ctndetail.IsEmpty then Exit;
|
|
|
|
|
|
with t_op_ctndetail do
|
|
|
try
|
|
|
DisableControls;
|
|
|
First;
|
|
|
while not eof do
|
|
|
begin
|
|
|
qty:=qty+FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger;
|
|
|
pkg:=pkg+FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
cbm:=cbm+FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
next;
|
|
|
end;
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD> <20><><EFBFBD><EFBFBD>:'+IntToStr(qty)+' <20><><EFBFBD><EFBFBD>:'+FormatFloat('0.0000;0.0000;0',pkg)+' <20><><EFBFBD><EFBFBD>:'+FormatFloat('0.0000;0.0000;0',cbm));
|
|
|
finally
|
|
|
EnableControls;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton12Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
if not ASSIGNED(frm_op_seae_ctn) then
|
|
|
frm_op_seae_ctn:=Tfrm_op_seae_ctn.Create(application);
|
|
|
frm_op_seae_ctn.t_op_ctn1:=t_op_ctn1;
|
|
|
frm_op_seae_ctn.bsNo:=t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
frm_op_seae_ctn.CorpName:=t_op_ctn.DataSource.DataSet.FieldByName('ί<>е<EFBFBD>λ').asstring;
|
|
|
frm_op_seae_ctn.Vsl:=t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
frm_op_seae_ctn.Voy:=t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asstring;
|
|
|
frm_op_seae_ctn.ShowModal;
|
|
|
finally
|
|
|
frm_op_seae_ctn.Free;
|
|
|
frm_op_seae_ctn:=nil;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton13Click(Sender: TObject);
|
|
|
var
|
|
|
Ext,ctnno,ctnType:String;
|
|
|
ExcelTemplet:Variant;
|
|
|
i:integer;
|
|
|
|
|
|
begin
|
|
|
if OpenDialog1.Execute then begin
|
|
|
Ext:=lowercase(ExtractFileExt(OpenDialog1.FileName));
|
|
|
|
|
|
// ShowMessage(ctnno+' '+ctnType+' '+Ext);
|
|
|
|
|
|
if Ext='.xls' then begin
|
|
|
ExcelTemplet:= CreateOleObject('Excel.Application');
|
|
|
try
|
|
|
ExcelTemplet.Workbooks.Open(OpenDialog1.FileName);
|
|
|
I:=2;
|
|
|
t_op_ctn.First;
|
|
|
// ShowMessage(trim(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value)));
|
|
|
if t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString=trim(VartoStr(ExcelTemplet.ActiveSheet.Cells[I,1].Value)) then
|
|
|
while VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value)<>'' do
|
|
|
begin
|
|
|
begin
|
|
|
t_op_ctn.append;
|
|
|
ctnno:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,4].Value);
|
|
|
ctnType:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,5].Value);
|
|
|
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(ctnno),trim(ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,3].Value);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,6].Value);
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,7].Value);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,8].Value);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,9].Value);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD>ط<EFBFBD>ʽ').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,10].Value);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,11].Value);
|
|
|
i:=i+1;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
ExcelTemplet.DisplayAlerts := false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|
|
ExcelTemplet.Quit;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.Button2Click(Sender: TObject);
|
|
|
begin
|
|
|
with t_op_ctn do
|
|
|
try
|
|
|
DisableControls;
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
if wwDBLookupCombo61.Value<>'' then
|
|
|
begin
|
|
|
Edit;
|
|
|
FieldByName('<27><>װ').AsString:=wwDBLookupCombo61.Value;
|
|
|
Post;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
finally
|
|
|
t_op_ctn.EnableControls;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.btn1Click(Sender: TObject);
|
|
|
begin
|
|
|
with t_op_ctn do
|
|
|
try
|
|
|
DisableControls;
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
if wwDBComboBox2.Value<>'' then
|
|
|
begin
|
|
|
Edit;
|
|
|
FieldByName('<27><><EFBFBD>ط<EFBFBD>ʽ').AsString:=wwDBComboBox2.Value;
|
|
|
Post;
|
|
|
end;
|
|
|
Next;
|
|
|
end;
|
|
|
finally
|
|
|
t_op_ctn.EnableControls;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton15Click(Sender: TObject);
|
|
|
var
|
|
|
yardcode:string;
|
|
|
IdHTTP1:TIdHTTP;
|
|
|
strmsg,company:string;
|
|
|
Url : string;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
ResponseStream : TStringStream; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
ResponseStr: string;
|
|
|
RequestStr : string; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
RequestStream : TStringStream;
|
|
|
jo:ISuperobject;
|
|
|
tt:TSuperArray;
|
|
|
i:Integer;
|
|
|
CTNALL,s_ctnno,s_ctnType,pkgs,kgs,cbm:string;
|
|
|
begin
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)='' then begin
|
|
|
ShowMessage('<27><>վ<EFBFBD><D5BE><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString)='' then begin
|
|
|
ShowMessage('<27><><EFBFBD>ᵥ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
yardcode:=getYardCode(Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString));
|
|
|
if (yardcode='') then begin
|
|
|
ShowMessage('<27><>վ<EFBFBD><D5BE>ʤ<EFBFBD><CAA4><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
exit;
|
|
|
end;
|
|
|
company:=frm_data_share.t_sys_company.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
ResponseStream := TStringStream.Create('');
|
|
|
RequestStream := TStringStream.Create('');
|
|
|
IdHTTP1:=TIdHTTP.Create(Application);
|
|
|
try
|
|
|
IdHttp1.Request.Accept := '*/*';
|
|
|
IdHttp1.Request.AcceptLanguage:='zh-CN';
|
|
|
IdHttp1.Request.UserAgent:='Mozilla/3.0 (compatible; Indy Library)';
|
|
|
IdHttp1.Request.ContentType:='application/x-www-form-urlencoded';
|
|
|
Url:='http://47.104.90.170:5000/query';
|
|
|
try
|
|
|
RequestStr:='webusername=&webuserpass=&mblno='+Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString)+'&yardid='+yardcode+'&isweb=0&custname='+company+'&psw='; //<2F><>С<EFBFBD><D0A1>
|
|
|
RequestStream.WriteString(RequestStr);
|
|
|
IdHttp1.post(Url,RequestStream,ResponseStream);
|
|
|
except
|
|
|
on e : Exception do
|
|
|
begin
|
|
|
end;
|
|
|
end;
|
|
|
ResponseStr := ResponseStream.DataString; //<2F><>ȡ<EFBFBD><C8A1>ҳ<EFBFBD><D2B3><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
|
|
|
ResponseStr := UTF8Decode(ResponseStr); //<2F><>ҳ<EFBFBD>еĴ<D0B5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>UTF8<46><38><EFBFBD><EFBFBD>
|
|
|
jo:=so(ResponseStr);
|
|
|
if (jo.O['status'].AsString='0') then begin
|
|
|
showmessage('<27><EFBFBD><DEB7><EFBFBD>ȡ,'+jo.O['message'].AsString);
|
|
|
end else begin
|
|
|
tt:=jo.O['message'].AsArray;
|
|
|
for i:=0 to tt.Length-1 do
|
|
|
begin
|
|
|
CTNALL:=tt.O[i].S['CTNALL'];
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',Trim(tt.O[i].S['CNTRNO']),[]) then
|
|
|
begin
|
|
|
t_op_ctn.Edit;
|
|
|
s_ctnno:=Copy(CTNALL,1,2);
|
|
|
s_ctnType:=Copy(CTNALL,3,2);
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
|
|
|
pkgs:=tt.O[i].S['PKGS'];
|
|
|
kgs:=tt.O[i].S['KGS'];
|
|
|
cbm:=tt.O[i].S['CBM'];
|
|
|
if pkgs='' then pkgs:='0';
|
|
|
if kgs='' then kgs:='0';
|
|
|
if cbm='' then cbm:='0';
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tt.O[i].S['SEALNO'];
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(pkgs);
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(kgs,0);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(cbm,0);
|
|
|
t_op_ctn.Post;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn.append;
|
|
|
|
|
|
s_ctnno:=Copy(CTNALL,1,2);
|
|
|
s_ctnType:=Copy(CTNALL,3,2);
|
|
|
pkgs:=tt.O[i].S['PKGS'];
|
|
|
kgs:=tt.O[i].S['KGS'];
|
|
|
cbm:=tt.O[i].S['CBM'];
|
|
|
if pkgs='' then pkgs:='0';
|
|
|
if kgs='' then kgs:='0';
|
|
|
if cbm='' then cbm:='0';
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(s_ctnno),trim(s_ctnType)]), []) then
|
|
|
begin
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tt.O[i].S['CNTRNO'];
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=tt.O[i].S['SEALNO'];
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(pkgs);
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').AsString;
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(kgs,0);
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloatDef(cbm,0);
|
|
|
t_op_ctn.Post;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(IdHTTP1);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
function Tfrm_op_ctn.getYardCode(yard: string): string;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select <20><>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+yard+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('<27><>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end.
|