|
|
|
|
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,DateUtils, inifiles,
|
|
|
|
|
Rio, SOAPHTTPClient,InvokeRegistry,DyxtService,Service,jfczService,myService,CaragtQuery_Cxwl,servicezh,
|
|
|
|
|
DBClient,XMLIntf,XMLDoc, xmldom, Xmlxform, kbmMemTable,IdHTTP,my_sys_function,
|
|
|
|
|
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient ,ComObj,superobject;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
t_op_ctndetailid: TAutoIncField;
|
|
|
|
|
t_op_ctndetailctn_id: TIntegerField;
|
|
|
|
|
t_op_ctndetailDSDesigner: TStringField;
|
|
|
|
|
t_op_ctndetailDSDesigner2: TStringField;
|
|
|
|
|
t_op_ctndetailDSDesigner3: TSmallintField;
|
|
|
|
|
t_op_ctndetailDSDesigner4: TStringField;
|
|
|
|
|
t_op_ctndetailDSDesigner5: TIntegerField;
|
|
|
|
|
t_op_ctndetailHTS: TStringField;
|
|
|
|
|
t_op_ctndetailDSDesigner6: TBCDField;
|
|
|
|
|
t_op_ctndetailDSDesigner7: TStringField;
|
|
|
|
|
t_op_ctndetailDSDesigner8: TStringField;
|
|
|
|
|
t_op_ctndetailDSDesigner9: TBCDField;
|
|
|
|
|
t_op_ctndetailPACKAGE: TStringField;
|
|
|
|
|
t_op_ctndetailTRADETYPE: TStringField;
|
|
|
|
|
bsSkinButton12: TbsSkinButton;
|
|
|
|
|
t_ch_fee: TADOQuery;
|
|
|
|
|
kbmMemTable1: TkbmMemTable;
|
|
|
|
|
kbmMemTable1StringField: TStringField;
|
|
|
|
|
kbmMemTable1StringField2: TStringField;
|
|
|
|
|
kbmMemTable1IntegerField: TIntegerField;
|
|
|
|
|
kbmMemTable1StringField3: TStringField;
|
|
|
|
|
kbmMemTable1FloatField: TFloatField;
|
|
|
|
|
kbmMemTable1FloatField2: TFloatField;
|
|
|
|
|
kbmMemTable1StringField4: TStringField;
|
|
|
|
|
kbmMemTable1StringField5: TStringField;
|
|
|
|
|
kbmMemTable1StringField6: TStringField;
|
|
|
|
|
IdHTTP2: TIdHTTP;
|
|
|
|
|
bsSkinButton14: TbsSkinButton;
|
|
|
|
|
DBMemo1: TDBMemo;
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
bsSkinButton13: TbsSkinButton;
|
|
|
|
|
OpenDialog1: TOpenDialog;
|
|
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
|
|
bsSkinButton15: TbsSkinButton;
|
|
|
|
|
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 bsSkinPanel1Resize(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton14Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton13Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton15Click(Sender: TObject);
|
|
|
|
|
private
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
mServiceSoap_dy:DyxtServiceSoap;
|
|
|
|
|
mServiceSoap_yzh:ServiceSoap;
|
|
|
|
|
mServiceSoap_zh:ServiceSoapzh;
|
|
|
|
|
mServiceSoap_zc:CaragtQuery_CxwlSoap;
|
|
|
|
|
mHttpRIO_dy,mHttpRIO_yzh,mHttpRIO_zc,mHttpRIO_zh:THTTPRIO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure getwebservice_dy; //<2F><>ȡ
|
|
|
|
|
procedure getwebservice_yzh; //<2F><>ȡ
|
|
|
|
|
procedure getwebservice_zc; //<2F><>ȡ
|
|
|
|
|
procedure getwebservice_zc_lw; //<2F><>ȡ
|
|
|
|
|
|
|
|
|
|
procedure getwebservice_zc_la;
|
|
|
|
|
procedure dewebservice; //<2F>ر<EFBFBD>
|
|
|
|
|
procedure getwebservice_zh; //<2F><>ȡ
|
|
|
|
|
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);
|
|
|
|
|
procedure GetdyczInfo_zc(s_caragt,s_key,s_billno,bsno:String);
|
|
|
|
|
procedure getssczinfor(mblno:string);
|
|
|
|
|
procedure getmjczinfor(mblno:string);
|
|
|
|
|
|
|
|
|
|
procedure GetdyczInfo_zh(s_caragt,s_key,s_billno,bsno:String);
|
|
|
|
|
function getYardCode(yard:string):string;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//20140923 dengyu ץȡ<D7A5><C8A1><EFBFBD>洢<EFBFBD><E6B4A2>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>ط<EFBFBD><D8B7><EFBFBD>
|
|
|
|
|
function SaveCTNINFO(s_caragt,s_key,s_billno,bsno:String;_CTNINFO:TContainerINFO):boolean;
|
|
|
|
|
//procedure DOSAVE_CTNINFO(_HEAD:TStringList;_BODY:TList);
|
|
|
|
|
|
|
|
|
|
public
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
dbserver:string;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frm_op_ctn: Tfrm_op_ctn;
|
|
|
|
|
frm_op_ctn_type:boolean;
|
|
|
|
|
op_ctn_limited:string;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses u_data_share, u_op_seae, u_op_seai,u_op_seai_sf, u_main,
|
|
|
|
|
u_op_seae_ctn;
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
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:jfczServiceSoap;
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
t_op_ctn.DisableControls;
|
|
|
|
|
cds:=TClientDataSet.Create(nil);
|
|
|
|
|
XMLTransformProvider1:=TXMLTransformProvider.Create(NIL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cds.Active:=false;
|
|
|
|
|
xmldoc:=NewXMLDocument;
|
|
|
|
|
xmldoc.Encoding:='UTF-8';
|
|
|
|
|
|
|
|
|
|
smartWS:=GetjfczServiceSoap(True,'');
|
|
|
|
|
s_web:=smartWS.GetBLNoInfo(s_billno,'18315FA0-8E5A-4935-8369-91BE89BC6B6A');
|
|
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
|
|
xmldoc.SaveToFile('c:\JFCZ.xml');
|
|
|
|
|
|
|
|
|
|
// ShowMessage('\\'+dbserver+'\jfcz\jfcz.xtr');
|
|
|
|
|
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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
kbmMemTable1.Post;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
kbmMemTable1.append;
|
|
|
|
|
s_ctnno:=Trim(FieldByName('CNTRSIZE').AsString);
|
|
|
|
|
s_ctnType:=Trim(FieldByName('CNTRTYPE').AsString);
|
|
|
|
|
if s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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.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_zc;
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
mHttpRIO_zc:=THTTPRIO.Create(nil);
|
|
|
|
|
mHttpRIO_zc.WSDLLocation:='http://www.cmlog.com.cn:8003/cmlwebservice/CaragtQuery_Cxwl.asmx?WSDL';
|
|
|
|
|
mHttpRIO_zc.URL:='http://www.cmlog.com.cn:8003/cmlwebservice/CaragtQuery_Cxwl.asmx';
|
|
|
|
|
mHttpRIO_zc.Port:='CaragtQuery_CxwlSoap';
|
|
|
|
|
mHttpRIO_zc.Service:='CaragtQuery_Cxwl';
|
|
|
|
|
mHttpRIO_zc.HTTPWebNode.UseUTF8InHeader:=true;
|
|
|
|
|
mServiceSoap_zc:=mHttpRIO_zc as CaragtQuery_CxwlSoap;
|
|
|
|
|
InvRegistry.RegisterInvokeOptions(TypeInfo(CaragtQuery_CxwlSoap),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_zc_lw;
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
mHttpRIO_zc:=THTTPRIO.Create(nil);
|
|
|
|
|
mHttpRIO_zc.WSDLLocation:='http://www.cmlog.com.cn:8003/cmlwebservice/CaragtQuery_Qlwwl.asmx?WSDL';
|
|
|
|
|
mHttpRIO_zc.URL:='http://www.cmlog.com.cn:8003/cmlwebservice/CaragtQuery_Qlwwl.asmx';
|
|
|
|
|
mHttpRIO_zc.Port:='CaragtQuery_QlwwlSoap';
|
|
|
|
|
mHttpRIO_zc.Service:='CaragtQuery_Qlwwl';
|
|
|
|
|
mHttpRIO_zc.HTTPWebNode.UseUTF8InHeader:=true;
|
|
|
|
|
mServiceSoap_zc:=mHttpRIO_zc as CaragtQuery_CxwlSoap;
|
|
|
|
|
InvRegistry.RegisterInvokeOptions(TypeInfo(CaragtQuery_CxwlSoap),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_zc_la;
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
mHttpRIO_zc:=THTTPRIO.Create(nil);
|
|
|
|
|
mHttpRIO_zc.WSDLLocation:='http://www.cmlog.com.cn:8003/cmlwebservice/CaragtQuery_QDLA.asmx?WSDL';
|
|
|
|
|
mHttpRIO_zc.URL:='http://www.cmlog.com.cn:8003/cmlwebservice/CaragtQuery_QDLA.asmx';
|
|
|
|
|
mHttpRIO_zc.Port:='CaragtQuery_QDLASoap';
|
|
|
|
|
mHttpRIO_zc.Service:='CaragtQuery_QDLA';
|
|
|
|
|
mHttpRIO_zc.HTTPWebNode.UseUTF8InHeader:=true;
|
|
|
|
|
mServiceSoap_zc:=mHttpRIO_zc as CaragtQuery_CxwlSoap;
|
|
|
|
|
InvRegistry.RegisterInvokeOptions(TypeInfo(CaragtQuery_CxwlSoap),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);
|
|
|
|
|
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.getwebservice_zh;
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
mHttpRIO_zh:=THTTPRIO.Create(nil);
|
|
|
|
|
mHttpRIO_zh.WSDLLocation:='http://221.215.94.251:8002/service.asmx?WSDL';
|
|
|
|
|
mHttpRIO_zh.URL:='http://221.215.94.251:8002/service.asmx';
|
|
|
|
|
mHttpRIO_zh.Port:='ServiceSoapzh';
|
|
|
|
|
mHttpRIO_zh.Service:='WebServicezh';
|
|
|
|
|
mHttpRIO_zh.HTTPWebNode.UseUTF8InHeader:=true;
|
|
|
|
|
mServiceSoap_zh:=mHttpRIO_zh as ServiceSoapzh;
|
|
|
|
|
InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceSoapzh),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_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');
|
|
|
|
|
|
|
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><><EFBFBD><EFBFBD>.xtr';
|
|
|
|
|
// 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;
|
|
|
|
|
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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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',' ',[]);
|
|
|
|
|
|
|
|
|
|
if FindField('SEALNO')<>nil then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('SEALNO').AsString;
|
|
|
|
|
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.append;
|
|
|
|
|
s_ctnno:=Trim(FieldByName('CTNSZ').AsString);
|
|
|
|
|
s_ctnType:=Trim(FieldByName('CTNTP').AsString);
|
|
|
|
|
if s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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',' ',[]);
|
|
|
|
|
|
|
|
|
|
if FindField('SEALNO')<>nil then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=FieldByName('SEALNO').AsString;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
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');
|
|
|
|
|
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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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');
|
|
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\<5C><>װ.xtr';
|
|
|
|
|
// XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'\<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.getmjczinfor(mblno:string);//qqctu<74><75>ȡ<EFBFBD>˵ֱ<CBB5><D6B1><EFBFBD><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
var
|
|
|
|
|
sl,sl_data:tstringlist;
|
|
|
|
|
IdHTTP1:TidHTTP;
|
|
|
|
|
i,j,k,m,n:integer;
|
|
|
|
|
istrue,QQCT,inmsg:boolean;
|
|
|
|
|
sldata:Array [1..13] of string[50];
|
|
|
|
|
s,s_ctnno,s_ctnType:widestring;
|
|
|
|
|
|
|
|
|
|
ss: TStringStream;
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
sl:=tstringlist.Create;
|
|
|
|
|
sl_data:=tstringlist.Create;
|
|
|
|
|
IdHTTP1 := TidHTTP.Create(nil);
|
|
|
|
|
QQCT:=false;
|
|
|
|
|
istrue:=true;
|
|
|
|
|
for i:=1 to 13 do
|
|
|
|
|
begin
|
|
|
|
|
sldata[i]:='';
|
|
|
|
|
end;
|
|
|
|
|
n:=0;
|
|
|
|
|
try
|
|
|
|
|
istrue:=true;
|
|
|
|
|
inmsg:=false;
|
|
|
|
|
ss := TStringStream.Create('');
|
|
|
|
|
try
|
|
|
|
|
IdHTTP1.Get('http://www.gfqd.com.cn/qdmj.asp?bl='+mblno, ss);
|
|
|
|
|
sl_data.text := ss.DataString;
|
|
|
|
|
finally
|
|
|
|
|
ss.Free;
|
|
|
|
|
end;
|
|
|
|
|
j:=0;
|
|
|
|
|
for i:=0 to sl_data.Count-1 do
|
|
|
|
|
begin
|
|
|
|
|
// s:=Trim(UTF8Decode(sl_data[i]));
|
|
|
|
|
s:=Trim(sl_data[i]);
|
|
|
|
|
if Trim(sl_data[i])<>'' then
|
|
|
|
|
if pos('</table>',sl_data[i])>0 then
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
s:=Copy(s,Pos('</<2F>ᵥ<EFBFBD><E1B5A5>></td></tr>',s)+16,Length(s)-1);
|
|
|
|
|
|
|
|
|
|
s:=StringReplace(s,'/tr>','/tr>'+#13#10,[rfReplaceAll]);
|
|
|
|
|
n:=1;
|
|
|
|
|
sl.text:=s;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
// ShowMessage(sl.text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
|
|
begin
|
|
|
|
|
if pos('</table>',sl[i])>0 then begin
|
|
|
|
|
istrue:=false;
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if pos('<27><><EFBFBD><EFBFBD>',sl[i])>0 then
|
|
|
|
|
begin
|
|
|
|
|
j:=i;
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[1]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+1) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[2]:=twsou('<<3C>ߴ<EFBFBD>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+2) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[3]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if istrue and (i=j+3) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[4]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if istrue and (i=j+4) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[5]:=twsou('<<3C><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+5) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[6]:=twsou('<Ƥ<><C6A4>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+6) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[7]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+7) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[8]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+8) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[9]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+9) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[10]:=twsou('<Ǧ<><C7A6><EFBFBD><EFBFBD>>','</td>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if istrue and (i=j+10) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[11]:=twsou('<<3C><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>','</<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>',sl[i]);
|
|
|
|
|
|
|
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',Trim(sldata[1]),[]) then
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.Edit;
|
|
|
|
|
s_ctnno:=Trim(sldata[2]);
|
|
|
|
|
s_ctnType:=Trim(sldata[3]);
|
|
|
|
|
|
|
|
|
|
if s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
//ShowMessage(s_ctnType);
|
|
|
|
|
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:=sldata[1];
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=sldata[10];
|
|
|
|
|
if sldata[7]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(sldata[7]);
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').AsString;
|
|
|
|
|
if sldata[8]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[8]);
|
|
|
|
|
if sldata[9]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[9]);
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.Append;
|
|
|
|
|
s_ctnno:=Trim(sldata[2]);
|
|
|
|
|
s_ctnType:=Trim(sldata[3]);
|
|
|
|
|
if s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
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:=sldata[1];
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=sldata[10];
|
|
|
|
|
if sldata[7]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(sldata[7]);
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').AsString;
|
|
|
|
|
if sldata[8]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[8]);
|
|
|
|
|
if sldata[9]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[9]);
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
freeandnil(sl);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.getssczinfor(mblno:string);//qqctu<74><75>ȡ<EFBFBD>˵ֱ<CBB5><D6B1><EFBFBD><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
var
|
|
|
|
|
sl,sl_data:tstringlist;
|
|
|
|
|
IdHTTP1:TidHTTP;
|
|
|
|
|
i,j,k,m,n:integer;
|
|
|
|
|
istrue,QQCT,inmsg:boolean;
|
|
|
|
|
sldata:Array [1..13] of string[50];
|
|
|
|
|
s,s_ctnno,s_ctnType:widestring;
|
|
|
|
|
|
|
|
|
|
ss: TStringStream;
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
sl:=tstringlist.Create;
|
|
|
|
|
sl_data:=tstringlist.Create;
|
|
|
|
|
IdHTTP1 := TidHTTP.Create(nil);
|
|
|
|
|
|
|
|
|
|
// ContentType:='us-ascii';
|
|
|
|
|
// CharSet:='GB2312';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
IdHTTP1.HandleRedirects:=true;
|
|
|
|
|
IDHTTP1.Request.ContentType:='us-ascii';
|
|
|
|
|
IDHTTP1.Request.Charset:='UTF-8';
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
IdHTTP1.ProtocolVersion:=pv1_1;
|
|
|
|
|
//IdHTTP.HTTPOptions:=IdHTTP1.HTTPOptions+[hoTreat302Like303];
|
|
|
|
|
IdHTTP1.Request.Accept:='text/html, application/xhtml+xml, */*';
|
|
|
|
|
IdHTTP1.Request.UserAgent:='Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko';
|
|
|
|
|
IdHTTP1.Request.AcceptEncoding:='gzip, deflate';
|
|
|
|
|
|
|
|
|
|
IdHTTP1.Request.ContentType:='application/x-www-form-urlencoded';
|
|
|
|
|
IdHTTP1.HTTPOptions:= [hoInProcessAuth,hoKeepOrigProtocol,hoForceEncodeParams];
|
|
|
|
|
|
|
|
|
|
IDHTTP1.Request.Charset:='UTF-8';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QQCT:=false;
|
|
|
|
|
istrue:=true;
|
|
|
|
|
for i:=1 to 13 do
|
|
|
|
|
begin
|
|
|
|
|
sldata[i]:='';
|
|
|
|
|
end;
|
|
|
|
|
n:=0;
|
|
|
|
|
try
|
|
|
|
|
istrue:=true;
|
|
|
|
|
inmsg:=false;
|
|
|
|
|
ss := TStringStream.Create('');
|
|
|
|
|
try
|
|
|
|
|
IdHTTP1.Get('http://www.ssqd.cn/agentui.aspx?bl='+mblno, ss);
|
|
|
|
|
sl_data.text := ss.DataString;
|
|
|
|
|
finally
|
|
|
|
|
ss.Free;
|
|
|
|
|
end;
|
|
|
|
|
// sl_data.text:=Trim(idhttp1.get('http://www.ssqd.cn/agentui.aspx?bl='+mblno));
|
|
|
|
|
j:=0;
|
|
|
|
|
for i:=0 to sl_data.Count-1 do
|
|
|
|
|
begin
|
|
|
|
|
// s:=Trim(sl_data[i]);
|
|
|
|
|
// s:=Trim(Utf8ToAnsi(sl_data[i]));
|
|
|
|
|
s:=Trim(UTF8Decode(sl_data[i]));
|
|
|
|
|
if Trim(sl_data[i])<>'' then
|
|
|
|
|
if pos('</table>',sl_data[i])>0 then
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
s:=Copy(s,Pos('</<2F>ᵥ<EFBFBD><E1B5A5>></td></tr>',s)+16,Length(s)-1);
|
|
|
|
|
|
|
|
|
|
s:=StringReplace(s,'/tr>','/tr>'+#13#10,[rfReplaceAll]);
|
|
|
|
|
n:=1;
|
|
|
|
|
sl.text:=s;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
// ShowMessage(sl.text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
|
|
begin
|
|
|
|
|
if pos('</table>',sl[i])>0 then begin
|
|
|
|
|
istrue:=false;
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if pos('<27><><EFBFBD><EFBFBD>',sl[i])>0 then
|
|
|
|
|
begin
|
|
|
|
|
j:=i;
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[1]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</<2F><><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+1) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[2]:=twsou('<<3C>ߴ<EFBFBD>>','</<2F>ߴ<EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+2) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[3]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</<2F><><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if istrue and (i=j+3) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[4]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</<2F><><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if istrue and (i=j+4) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[5]:=twsou('<<3C><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>','</<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+5) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[6]:=twsou('<Ƥ<><C6A4>>','</Ƥ<><C6A4>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+6) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[7]:=twsou('<<3C>ܼ<EFBFBD><DCBC><EFBFBD>>','</<2F>ܼ<EFBFBD><DCBC><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+7) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[8]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</<2F><><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+8) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[9]:=twsou('<<3C>ܳ<EFBFBD><DCB3><EFBFBD>>','</<2F>ܳ<EFBFBD><DCB3><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+9) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[10]:=twsou('<Ǧ<><C7A6><EFBFBD><EFBFBD>>','</Ǧ<><C7A6><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if istrue and (i=j+10) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[11]:=twsou('<<3C><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>','</<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>',sl[i]);
|
|
|
|
|
|
|
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',Trim(sldata[1]),[]) then
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.Edit;
|
|
|
|
|
s_ctnno:=Trim(sldata[2]);
|
|
|
|
|
s_ctnType:=Trim(sldata[3]);
|
|
|
|
|
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:=sldata[1];
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=sldata[10];
|
|
|
|
|
if sldata[7]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(sldata[7]);
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').AsString;
|
|
|
|
|
if sldata[8]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[8]);
|
|
|
|
|
if sldata[9]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[9]);
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.Append;
|
|
|
|
|
s_ctnno:=Trim(sldata[2]);
|
|
|
|
|
s_ctnType:=Trim(sldata[3]);
|
|
|
|
|
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:=sldata[1];
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=sldata[10];
|
|
|
|
|
if sldata[7]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(sldata[7]);
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').AsString;
|
|
|
|
|
if sldata[8]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[8]);
|
|
|
|
|
if sldata[9]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[9]);
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
freeandnil(sl);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
/////20140923 dengyu
|
|
|
|
|
function Tfrm_op_ctn.SaveCTNINFO(s_caragt, s_key, s_billno, bsno: String;
|
|
|
|
|
_CTNINFO: TContainerINFO):boolean;
|
|
|
|
|
var
|
|
|
|
|
_i,j,k,m,n:integer;
|
|
|
|
|
_Body:TStringList;
|
|
|
|
|
ctn_no,ctn_Type,ctn_Size:string;
|
|
|
|
|
GoodWeight:double;
|
|
|
|
|
begin
|
|
|
|
|
Result:=false;
|
|
|
|
|
with t_op_ctn do
|
|
|
|
|
try
|
|
|
|
|
DisableControls;
|
|
|
|
|
First;
|
|
|
|
|
while not eof do
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.Edit;
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=0;
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=0;
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=0;
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
Next;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
EnableControls;
|
|
|
|
|
First;
|
|
|
|
|
end;
|
|
|
|
|
_Body:=TStringList.create();
|
|
|
|
|
for _i:=0 to _Ctninfo.body.count-1 do
|
|
|
|
|
begin
|
|
|
|
|
_Body:=TStringList.create();
|
|
|
|
|
_Body.clear;
|
|
|
|
|
_Body.Assign(_CTNINFO.Body[_i]);
|
|
|
|
|
ctn_no:=_Body[_CTNINFO.ctn_no];
|
|
|
|
|
ctn_Type:=_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i);
|
|
|
|
|
ctn_Size:=_CTNINFO.GetINFO('<27>ߴ<EFBFBD>',_i);
|
|
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',trim(ctn_no),[]) then
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
t_op_ctn.Edit;
|
|
|
|
|
|
|
|
|
|
if _CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger+StrToInt(_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=_CTNINFO.GetINFO('<27><>װ',_i);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'') then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'') or (_CTNINFO.GetINFO('ʵװ<CAB5><D7B0><EFBFBD><EFBFBD>',_i)<>'') then
|
|
|
|
|
begin
|
|
|
|
|
if (_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'') then
|
|
|
|
|
GoodWeight:=StrToFloat(_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i));
|
|
|
|
|
if (_CTNINFO.GetINFO('ʵװ<CAB5><D7B0><EFBFBD><EFBFBD>',_i)<>'') then
|
|
|
|
|
GoodWeight:=StrToFloat(_CTNINFO.GetINFO('ʵװ<CAB5><D7B0><EFBFBD><EFBFBD>',_i));
|
|
|
|
|
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat+GoodWeight;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if _CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat+StrToFloat(_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i))
|
|
|
|
|
else if _CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat+StrToFloat(_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i));
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.Append;
|
|
|
|
|
if (_CTNINFO.GetINFO('<27>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD>',_i)<>'') then
|
|
|
|
|
begin
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.FieldByName('<27>ߴ<EFBFBD>').AsString:=ctn_Size;
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=ctn_Type;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if frm_data_share.t_code_ctn.Locate('<27>ߴ<EFBFBD>;<3B><><EFBFBD><EFBFBD>',VarArrayOf([trim(ctn_Size),trim(ctn_Type)]), []) 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:=ctn_no;
|
|
|
|
|
|
|
|
|
|
if (_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'') then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)
|
|
|
|
|
else if (_CTNINFO.GetINFO('Ǧ<><C7A6>',_i)<>'') then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=_CTNINFO.GetINFO('Ǧ<><C7A6>',_i);
|
|
|
|
|
|
|
|
|
|
if _CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=_CTNINFO.GetINFO('<27><>װ',_i);
|
|
|
|
|
|
|
|
|
|
if (_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'') or (_CTNINFO.GetINFO('ʵװ<CAB5><D7B0><EFBFBD><EFBFBD>',_i)<>'') then
|
|
|
|
|
begin
|
|
|
|
|
if (_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'') then
|
|
|
|
|
GoodWeight:=StrToFloat(_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i));
|
|
|
|
|
if (_CTNINFO.GetINFO('ʵװ<CAB5><D7B0><EFBFBD><EFBFBD>',_i)<>'') then
|
|
|
|
|
GoodWeight:=StrToFloat(_CTNINFO.GetINFO('ʵװ<CAB5><D7B0><EFBFBD><EFBFBD>',_i));
|
|
|
|
|
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat+GoodWeight;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if _CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i))
|
|
|
|
|
else if _CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i)<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(_CTNINFO.GetINFO('<27><><EFBFBD><EFBFBD>',_i));
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end;
|
|
|
|
|
if trim(ctn_no)<>'' then
|
|
|
|
|
begin
|
|
|
|
|
Result:=true;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
procedure Tfrm_op_ctn.getssczinfor(mblno:string);//qqctu<74><75>ȡ<EFBFBD>˵ֱ<CBB5><D6B1><EFBFBD><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
var
|
|
|
|
|
sl:tstringlist;
|
|
|
|
|
IdHTTP1:TidHTTP;
|
|
|
|
|
i,j,k,m,n:integer;
|
|
|
|
|
istrue,QQCT,inmsg:boolean;
|
|
|
|
|
sldata:Array [1..13] of string[50];
|
|
|
|
|
s,s_ctnno,s_ctnType:widestring;
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
sl:=tstringlist.Create;
|
|
|
|
|
IdHTTP1 := TidHTTP.Create(nil);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IdHTTP1.HandleRedirects:=true;
|
|
|
|
|
QQCT:=false;
|
|
|
|
|
istrue:=true;
|
|
|
|
|
for i:=1 to 13 do
|
|
|
|
|
begin
|
|
|
|
|
sldata[i]:='';
|
|
|
|
|
end;
|
|
|
|
|
n:=0;
|
|
|
|
|
try
|
|
|
|
|
istrue:=true;
|
|
|
|
|
inmsg:=false;
|
|
|
|
|
sl.text:=idhttp1.get('http://www.ssqd.cn/agentui.aspx?bl='+mblno);
|
|
|
|
|
j:=0;
|
|
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
|
|
begin
|
|
|
|
|
s:=Utf8ToAnsi(sl[i]);
|
|
|
|
|
|
|
|
|
|
if pos('</table>',sl[i])>0 then
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
s:=Copy(s,Pos('</<2F>ᵥ<EFBFBD><E1B5A5>></td></tr>',s)+16,Length(s)-1);
|
|
|
|
|
|
|
|
|
|
s:=StringReplace(s,'/tr>','/tr>'+#13#10,[rfReplaceAll]);
|
|
|
|
|
n:=1;
|
|
|
|
|
sl.text:=s;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for i:=0 to sl.Count-1 do
|
|
|
|
|
begin
|
|
|
|
|
if pos('</table>',sl[i])>0 then begin
|
|
|
|
|
istrue:=false;
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if pos('<27><><EFBFBD><EFBFBD>',sl[i])>0 then
|
|
|
|
|
begin
|
|
|
|
|
j:=i;
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[1]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</<2F><><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+1) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[2]:=twsou('<<3C>ߴ<EFBFBD>>','</<2F>ߴ<EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+2) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[3]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</<2F><><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+3) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[4]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</<2F><><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+4) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[5]:=twsou('<<3C><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>','</<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+5) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[6]:=twsou('<Ƥ<><C6A4>>','</Ƥ<><C6A4>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+6) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[7]:=twsou('<<3C>ܼ<EFBFBD><DCBC><EFBFBD>>','</<2F>ܼ<EFBFBD><DCBC><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+7) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[8]:=twsou('<<3C><><EFBFBD><EFBFBD>>','</<2F><><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+8) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[9]:=twsou('<<3C>ܳ<EFBFBD><DCB3><EFBFBD>>','</<2F>ܳ<EFBFBD><DCB3><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+9) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[10]:=twsou('<Ǧ<><C7A6><EFBFBD><EFBFBD>>','</Ǧ<><C7A6><EFBFBD><EFBFBD>>',sl[i]);
|
|
|
|
|
end;
|
|
|
|
|
if istrue and (i=j+10) then
|
|
|
|
|
begin
|
|
|
|
|
sldata[11]:=twsou('<<3C><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>','</<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>',sl[i]);
|
|
|
|
|
|
|
|
|
|
if t_op_ctn.Locate('<27><><EFBFBD><EFBFBD>',Trim(sldata[1]),[]) then
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.Edit;
|
|
|
|
|
s_ctnno:=Trim(sldata[2]);
|
|
|
|
|
s_ctnType:=Trim(sldata[3]);
|
|
|
|
|
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:=sldata[1];
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=sldata[10];
|
|
|
|
|
if sldata[7]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(sldata[7]);
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').AsString;
|
|
|
|
|
if sldata[8]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[8]);
|
|
|
|
|
if sldata[9]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[9]);
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.Append;
|
|
|
|
|
s_ctnno:=Trim(sldata[2]);
|
|
|
|
|
s_ctnType:=Trim(sldata[3]);
|
|
|
|
|
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:=sldata[1];
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=sldata[10];
|
|
|
|
|
if sldata[7]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(sldata[7]);
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').AsString;
|
|
|
|
|
if sldata[8]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[8]);
|
|
|
|
|
if sldata[9]<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(sldata[9]);
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
freeandnil(sl);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.GetdyczInfo_zc(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;
|
|
|
|
|
if trim(s_caragt)='' then
|
|
|
|
|
getwebservice_zc
|
|
|
|
|
else
|
|
|
|
|
if trim(s_caragt)='<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
getwebservice_zc_la
|
|
|
|
|
else
|
|
|
|
|
getwebservice_zc_lw;
|
|
|
|
|
cds:=TClientDataSet.Create(nil);
|
|
|
|
|
XMLTransformProvider1:=TXMLTransformProvider.Create(NIL);
|
|
|
|
|
|
|
|
|
|
// s_billno:='HLCUTA1130371756'; //QDJY000476
|
|
|
|
|
|
|
|
|
|
cds.Active:=false;
|
|
|
|
|
xmldoc:=NewXMLDocument;
|
|
|
|
|
xmldoc.Encoding:='UTF-8';
|
|
|
|
|
|
|
|
|
|
s_web:=mServiceSoap_zc.GetInfo(s_billno,s_key); //83891620 <20><>˧
|
|
|
|
|
|
|
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
|
|
xmldoc.SaveToFile('c:\<5C><><EFBFBD><EFBFBD>.xml');
|
|
|
|
|
//ShowMessage('\\'+dbserver+'\<5C>д<EFBFBD><D0B4><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr');
|
|
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C>д<EFBFBD><D0B4><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.DataSource.DataSet.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.DataSource.DataSet.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_zh(s_caragt,s_key,s_billno,bsno:String); //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
var
|
|
|
|
|
b:Boolean;
|
|
|
|
|
s_web: WideString;
|
|
|
|
|
xmldoc:IXMLDocument;
|
|
|
|
|
cds:TClientDataSet;
|
|
|
|
|
XMLTransformProvider1:TXMLTransformProvider;
|
|
|
|
|
s_ctnno,s_ctnType:string;
|
|
|
|
|
|
|
|
|
|
sl:tstringlist;
|
|
|
|
|
i:integer;
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
t_op_ctn.DisableControls;
|
|
|
|
|
getwebservice_zh;
|
|
|
|
|
cds:=TClientDataSet.Create(nil);
|
|
|
|
|
XMLTransformProvider1:=TXMLTransformProvider.Create(NIL);
|
|
|
|
|
|
|
|
|
|
// s_billno:='HLCUTA1130371756'; //QDJY000476
|
|
|
|
|
|
|
|
|
|
cds.Active:=false;
|
|
|
|
|
xmldoc:=NewXMLDocument;
|
|
|
|
|
xmldoc.Encoding:='UTF-8';
|
|
|
|
|
|
|
|
|
|
s_web:=mServiceSoap_zh.GetReturnDataXml(s_caragt,s_key,s_billno);
|
|
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
|
|
xmldoc.SaveToFile('c:\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xml');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if FileExists(ExtractFilePath(Application.ExeName)+'<27><EFBFBD>վ\<5C><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr') then
|
|
|
|
|
begin
|
|
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'<27><EFBFBD>վ\<5C><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr';
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
CreateDirectory(pChar(ExtractFilePath(Application.ExeName)+'<27><EFBFBD>վ'),nil);
|
|
|
|
|
CopyFile(pChar('\\'+dbserver+'\<5C><EFBFBD>վ\<5C><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr'),pChar(ExtractFilePath(Application.ExeName)+'<27><EFBFBD>վ\<5C><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr'),True);
|
|
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'<27><EFBFBD>վ\<5C><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C><EFBFBD>վ\<5C><EFBFBD>װ<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>ߴ<EFBFBD>').AsString);
|
|
|
|
|
s_ctnType:=Trim(FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
if s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
if FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsString<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsInteger;
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:='';
|
|
|
|
|
if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
if FieldByName('<27>ܳ<EFBFBD><DCB3><EFBFBD>').AsString<>'' then
|
|
|
|
|
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>ߴ<EFBFBD>').AsString);
|
|
|
|
|
s_ctnType:=Trim(FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
if s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
if FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsString<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsInteger;
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:='';
|
|
|
|
|
if FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
if FieldByName('<27>ܳ<EFBFBD><DCB3><EFBFBD>').AsString<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27>ܳ<EFBFBD><DCB3><EFBFBD>').AsFloat;
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
end;
|
|
|
|
|
Next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
t_op_ctn.EnableControls;
|
|
|
|
|
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:='HLCUTA1130371756'; //QDJY000476
|
|
|
|
|
|
|
|
|
|
cds.Active:=false;
|
|
|
|
|
xmldoc:=NewXMLDocument;
|
|
|
|
|
xmldoc.Encoding:='UTF-8';
|
|
|
|
|
|
|
|
|
|
s_web:=mServiceSoap_yzh.P_GETDATA(s_billno,'YT');
|
|
|
|
|
// ShowMessage(s_web);
|
|
|
|
|
xmldoc.LoadFromXML(s_web);
|
|
|
|
|
xmldoc.SaveToFile('c:\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xml');
|
|
|
|
|
|
|
|
|
|
XMLTransformProvider1.TransformRead.TransformationFile:='\\'+dbserver+'\<5C><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ\<5C><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ.xtr';
|
|
|
|
|
// XMLTransformProvider1.TransformRead.TransformationFile:=ExtractFilePath(Application.ExeName)+'\<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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
if FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsString<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsInteger;
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:='';
|
|
|
|
|
if FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
if FieldByName('<27>ܳ<EFBFBD><DCB3><EFBFBD>').AsString<>'' then
|
|
|
|
|
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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
if FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsString<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('<27>ܼ<EFBFBD><DCBC><EFBFBD>').AsInteger;
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:='';
|
|
|
|
|
if FieldByName('<27><><EFBFBD><EFBFBD>').AsString<>'' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
if FieldByName('<27>ܳ<EFBFBD><DCB3><EFBFBD>').AsString<>'' then
|
|
|
|
|
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://221.215.96.158:8190/WebServiceTest/services/myService?wsdl',nil);
|
|
|
|
|
|
|
|
|
|
// 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');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//ShowMessage('1');
|
|
|
|
|
|
|
|
|
|
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';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//ShowMessage('\\'+dbserver+'\½<><C2BD><EFBFBD><EFBFBD>վ\<5C><><EFBFBD>䷵<EFBFBD><E4B7B5>.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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
if FieldByName('PKGS').Value<>'null' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('PKGS').AsInteger;
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=FieldByName('PKTP').AsString;
|
|
|
|
|
if FieldByName('ALKWGT').Value<>'null' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALKWGT').AsFloat;
|
|
|
|
|
if FieldByName('ALCUBAGE').Value<>'null' then
|
|
|
|
|
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 s_ctnType='HQ' then
|
|
|
|
|
s_ctnType:='HC';
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
if FieldByName('PKGS').Value<>'null' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('PKGS').AsInteger;
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=FieldByName('PKTP').AsString;
|
|
|
|
|
if FieldByName('ALKWGT').Value<>'null' then
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('ALKWGT').AsFloat;
|
|
|
|
|
if FieldByName('ALCUBAGE').Value<>'null' then
|
|
|
|
|
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='10'then
|
|
|
|
|
t_op_ctn['TEU']:=0.5*t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').asFloat;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if op_ctn_limited='0002'then
|
|
|
|
|
begin
|
|
|
|
|
if (not t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull) and (not t_op_ctn.FieldByName('ж<><D0B6>ʱ<EFBFBD><CAB1>').IsNull) then
|
|
|
|
|
begin
|
|
|
|
|
if (daysBetween(t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value,t_op_ctn.FieldByName('ж<><D0B6>ʱ<EFBFBD><CAB1>').Value)-t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value)>0 then
|
|
|
|
|
t_op_ctn.FieldByName('ʵ<>ʶѴ<CAB6><D1B4><EFBFBD><EFBFBD><EFBFBD>').Value:=daysBetween(t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value,t_op_ctn.FieldByName('ж<><D0B6>ʱ<EFBFBD><CAB1>').Value)+1-t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value
|
|
|
|
|
else t_op_ctn.FieldByName('ʵ<>ʶѴ<CAB6><D1B4><EFBFBD><EFBFBD><EFBFBD>').Value:=0;
|
|
|
|
|
t_op_ctn.FieldByName('ʵ<>ʶѴ<CAB6><D1B4><EFBFBD>').Value:=t_op_ctn.FieldByName('ʵ<>ʶѴ<CAB6><D1B4><EFBFBD><EFBFBD><EFBFBD>').Value*t_op_ctn.FieldByName('<27>Ѵ<EFBFBD><D1B4>ѱ<EFBFBD>').Value;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if (not t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull) and (not t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull) then
|
|
|
|
|
begin
|
|
|
|
|
if (daysBetween(t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value,t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value)-t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>').Value)>0 then
|
|
|
|
|
t_op_ctn.FieldByName('ʵ<><CAB5><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>').Value:=daysBetween(t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value,t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value)+1-t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>').Value
|
|
|
|
|
else t_op_ctn.FieldByName('ʵ<><CAB5><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>').Value:=0;
|
|
|
|
|
t_op_ctn.FieldByName('ʵ<><CAB5><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>').Value:=t_op_ctn.FieldByName('ʵ<><CAB5><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>').Value*t_op_ctn.FieldByName('<27><>ʹ<EFBFBD><CAB9>').Value;
|
|
|
|
|
end;
|
|
|
|
|
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
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
while not t_op_ctndetail.eof do
|
|
|
|
|
t_op_ctndetail.delete;
|
|
|
|
|
|
|
|
|
|
t_op_ctn.Delete;
|
|
|
|
|
end;
|
|
|
|
|
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
|
|
|
|
|
loadwwgrid(frm_op_ctn.wwDBGrid1,'<27><>װ<EFBFBD><D7B0>');
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
if if_reg(2601) then // jfcz <20>ݷ᳡վͨ<D5BE><CDA8>
|
|
|
|
|
begin
|
|
|
|
|
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);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if if_reg(2602) then // <20><><EFBFBD>dz<EFBFBD>վ
|
|
|
|
|
begin
|
|
|
|
|
FromFileName:='\\'+dbserver+'\<5C><><EFBFBD>dz<EFBFBD>վ\midas.dll';
|
|
|
|
|
ToFileName:=ExtractFilePath(application.ExeName)+'midas.dll';
|
|
|
|
|
|
|
|
|
|
if not FileExists(ExtractFilePath(application.ExeName)+'midas.dll') then
|
|
|
|
|
CopyFile(pChar(FromFileName),pChar(ToFileName),False);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if if_reg(2603) then // <20><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ
|
|
|
|
|
begin
|
|
|
|
|
FromFileName:='\\'+dbserver+'\<5C><>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վ\midas.dll';
|
|
|
|
|
ToFileName:=ExtractFilePath(application.ExeName)+'midas.dll';
|
|
|
|
|
|
|
|
|
|
if not FileExists(ExtractFilePath(application.ExeName)+'midas.dll') then
|
|
|
|
|
CopyFile(pChar(FromFileName),pChar(ToFileName),False);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
bsSkinButton15.Visible:=if_reg(2612);
|
|
|
|
|
|
|
|
|
|
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.bsSkinButton6Click(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
bok:Tbookmark;
|
|
|
|
|
if_first:boolean;
|
|
|
|
|
pkgs,as_id:integer;
|
|
|
|
|
kgs,cbm:double;
|
|
|
|
|
s,package:string;
|
|
|
|
|
aQuery,aQueryEmp:TAdoQuery;
|
|
|
|
|
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
|
|
|
|
|
if op_ctn_limited='0003'then
|
|
|
|
|
begin
|
|
|
|
|
op_befor_post(frm_op_seai_sf.t_op_seai,op_ctn_limited);
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
op_befor_post(frm_op_seai.t_op_seai,op_ctn_limited);
|
|
|
|
|
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;
|
|
|
|
|
t_op_ctn.DataSource.DataSet.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)<>'') then
|
|
|
|
|
// 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)<>'') then
|
|
|
|
|
// 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 (FormatFloat('0.0000;-0.0000;0',pkgs)<>FormatFloat('0.0000;-0.0000;0',t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger))
|
|
|
|
|
or (FormatFloat('0.0000;-0.0000;0',kgs)<>FormatFloat('0.0000;-0.0000;0',t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat))
|
|
|
|
|
or (FormatFloat('0.0000;-0.0000;0',cbm)<>FormatFloat('0.0000;-0.0000;0',t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat))
|
|
|
|
|
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
|
|
|
|
|
//showmessage(op_ctn_limited+' '+memo3.Lines.Text);
|
|
|
|
|
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
aQueryEmp:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
if assigned(frm_op_seae) then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.BeforePost:=nil;
|
|
|
|
|
frm_op_seae.t_op_seae.BeforeEdit:=nil;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
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><><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><>װ']:=t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:='SAY:'+ntoc(pkgs,true)+t_op_ctn.fieldbyname('<27><>װ').asstring+' ONLY.';
|
|
|
|
|
t_op_ctn.DataSource.DataSet.post;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aQuery.close;aQuery.sql.clear;
|
|
|
|
|
aQuery.sql.Add('select AS_ID from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']+'''');
|
|
|
|
|
aQuery.open;
|
|
|
|
|
as_id:=aQuery.fieldbyname('AS_ID').AsInteger;
|
|
|
|
|
|
|
|
|
|
aQuery.Close;aQuery.sql.Clear;
|
|
|
|
|
aQuery.sql.Add('select * from t_op_ctn_fendan');
|
|
|
|
|
aQuery.sql.Add('where as_id=:as_id');
|
|
|
|
|
aQuery.Parameters.ParamByName('as_id').Value:=as_id;
|
|
|
|
|
aQuery.open;aQuery.First;
|
|
|
|
|
|
|
|
|
|
aQuery.close;aQuery.sql.clear;
|
|
|
|
|
aQuery.sql.Add('select count(AS_ID) as count from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']+'''');
|
|
|
|
|
aQuery.open;
|
|
|
|
|
|
|
|
|
|
if aQuery.fieldbyname('count').AsInteger=1 then
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
aQuery.close;aQuery.sql.clear;
|
|
|
|
|
aQuery.sql.Add('select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='''+t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']+'''');
|
|
|
|
|
aQuery.open;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aQuery.edit;
|
|
|
|
|
aQuery['<27><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>']:=memo1.Lines.Text;
|
|
|
|
|
aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ']:=memo2.Lines.Text;
|
|
|
|
|
aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=memo3.Lines.Text;
|
|
|
|
|
aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=memo4.Lines.Text;
|
|
|
|
|
aQuery['<27><><EFBFBD><EFBFBD>']:=pkgs;
|
|
|
|
|
aQuery['<27><><EFBFBD><EFBFBD>']:=kgs;
|
|
|
|
|
aQuery['<27><><EFBFBD><EFBFBD>']:=cbm;
|
|
|
|
|
aQuery['<27><>װ']:=t_op_ctn.fieldbyname('<27><>װ').asstring;
|
|
|
|
|
aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:='SAY:'+ntoc(pkgs,true)+t_op_ctn.fieldbyname('<27><>װ').asstring+' ONLY.';
|
|
|
|
|
aQuery.post;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
aQuery.Close;aQuery.sql.Clear;
|
|
|
|
|
aQuery.sql.Add('select * from t_op_ctn_fendan');
|
|
|
|
|
aQuery.sql.Add('where as_id=:as_id');
|
|
|
|
|
aQuery.Parameters.ParamByName('as_id').Value:=as_id;
|
|
|
|
|
aQuery.open;aQuery.First;
|
|
|
|
|
|
|
|
|
|
with aQueryEmp do
|
|
|
|
|
begin
|
|
|
|
|
close;sql.clear;
|
|
|
|
|
sql.Add('select * from t_op_ctn where <20><><EFBFBD><EFBFBD>='''+t_op_ctn.DataSource.DataSet['<27><><EFBFBD><EFBFBD>']+'''');
|
|
|
|
|
Open;First;
|
|
|
|
|
while not eof do
|
|
|
|
|
begin
|
|
|
|
|
if aQuery.Locate('<27><><EFBFBD><EFBFBD>', FieldByName('<27><><EFBFBD><EFBFBD>').AsString,[]) then
|
|
|
|
|
begin
|
|
|
|
|
aQuery.Edit;
|
|
|
|
|
if FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger<>0 then
|
|
|
|
|
aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger;
|
|
|
|
|
if FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat<>0 then
|
|
|
|
|
aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
if FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat<>0 then
|
|
|
|
|
aQuery.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
if trim(FieldByName('<27><>װ').AsString)<>'' then
|
|
|
|
|
aQuery.FieldByName('<27><>װ').AsString:=FieldByName('<27><>װ').AsString;
|
|
|
|
|
aQuery.Post;
|
|
|
|
|
end;
|
|
|
|
|
Next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
if assigned(frm_op_seae) then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.Beforepost:=frm_op_seae.t_op_seaeBeforepost;
|
|
|
|
|
frm_op_seae.t_op_seae.BeforeEdit:=frm_op_seae.t_op_seaeBeforeEdit;
|
|
|
|
|
end;
|
|
|
|
|
aQueryEmp.Free;
|
|
|
|
|
aQuery.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
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['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:='SAY:'+ntoc(pkgs,true)+t_op_ctn.DataSource.DataSet.fieldbyname('<27><>װ').asstring+' ONLY.';
|
|
|
|
|
|
|
|
|
|
t_op_ctn.DataSource.DataSet.post;
|
|
|
|
|
end;
|
|
|
|
|
if op_ctn_limited='0003'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;
|
|
|
|
|
if memo1.Lines.Count>=1 then
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
if assigned(frm_op_seae) then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.BeforePost:=nil;
|
|
|
|
|
frm_op_seae.t_op_seae.BeforeEdit:=nil;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
t_op_ctn.DataSource.DataSet.edit;
|
|
|
|
|
t_op_ctn.DataSource.DataSet['<27><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>']:=memo1.Lines.Text;
|
|
|
|
|
t_op_ctn.DataSource.DataSet.post;
|
|
|
|
|
finally
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
if assigned(frm_op_seae) then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.Beforepost:=frm_op_seae.t_op_seaeBeforepost;
|
|
|
|
|
frm_op_seae.t_op_seae.BeforeEdit:=frm_op_seae.t_op_seaeBeforeEdit;
|
|
|
|
|
end;
|
|
|
|
|
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.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
|
|
|
|
|
if op_ctn_limited='0002'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
|
|
|
|
|
if op_ctn_limited='0002'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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 Trim(t_op_ctndetail['hts'])='' then
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('HS NO <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>');
|
|
|
|
|
Abort;
|
|
|
|
|
end;
|
|
|
|
|
if Trim(t_op_ctndetail['<27><>װ'])='' then
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('<27><>װ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>');
|
|
|
|
|
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;
|
|
|
|
|
t_op_ctndetail['hts']:=t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD>䷽ʽ').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')
|
|
|
|
|
and (t_op_ctn.fields[i].FieldName<>'<27><><EFBFBD><EFBFBD>')
|
|
|
|
|
and (t_op_ctn.fields[i].FieldName<>'<27><><EFBFBD><EFBFBD>')
|
|
|
|
|
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);
|
|
|
|
|
var Days,holidays:integer;
|
|
|
|
|
begin
|
|
|
|
|
if t_op_ctn.DataSource.DataSet.FieldByName('ҵ<><D2B5>״̬').AsString='ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then exit;
|
|
|
|
|
// if (t_op_ctn.State not)
|
|
|
|
|
|
|
|
|
|
if strtobool(get_parameters_value(320,'false'))then
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
if t_op_ctn.DataSource.DataSet.State=dsinsert then
|
|
|
|
|
else
|
|
|
|
|
if not t_op_ctn.DataSource.DataSet.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').asboolean then
|
|
|
|
|
begin
|
|
|
|
|
if trim(t_op_ctn.DataSource.DataSet.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='<27><>ͨ<EFBFBD><CDA8>' then
|
|
|
|
|
begin
|
|
|
|
|
if not t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull then
|
|
|
|
|
begin
|
|
|
|
|
holidays:=GetHoliday(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
|
|
if frm_data_share.t_crm_client_ship.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>˾').asstring,[]) then
|
|
|
|
|
begin
|
|
|
|
|
Days:=frm_data_share.t_crm_client_ship.fieldbyname('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger;
|
|
|
|
|
end;
|
|
|
|
|
if (date-t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime)>Days+holidays then
|
|
|
|
|
begin
|
|
|
|
|
showmessage('ҵ<><D2B5><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FloatToStr((date-t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asdatetime))+' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+FloatToStr(Days+holidays)+' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<DEB8><C4A3><EFBFBD>');
|
|
|
|
|
//exit;
|
|
|
|
|
end
|
|
|
|
|
else;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if strtobool(get_parameters_value(317,'true')) then
|
|
|
|
|
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
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.BeforePost:=nil;
|
|
|
|
|
frm_op_seae.t_op_seae.BeforeEdit:=nil;
|
|
|
|
|
end;
|
|
|
|
|
update_ctn(t_op_ctn);
|
|
|
|
|
bsSkinButton6.OnClick(bsSkinButton6);
|
|
|
|
|
finally
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.Beforepost:=frm_op_seae.t_op_seaeBeforepost;
|
|
|
|
|
frm_op_seae.t_op_seae.BeforeEdit:=frm_op_seae.t_op_seaeBeforeEdit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
// savewwgrid(frm_op_ctn.wwDBGrid1,'<27><>װ<EFBFBD><D7B0>');
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
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
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.BeforePost:=nil;
|
|
|
|
|
frm_op_seae.t_op_seae.BeforeEdit:=nil;
|
|
|
|
|
end;
|
|
|
|
|
update_ctn(t_op_ctn);
|
|
|
|
|
finally
|
|
|
|
|
if op_ctn_limited='0001'then
|
|
|
|
|
begin
|
|
|
|
|
frm_op_seae.t_op_seae.Beforepost:=frm_op_seae.t_op_seaeBeforepost;
|
|
|
|
|
frm_op_seae.t_op_seae.BeforeEdit:=frm_op_seae.t_op_seaeBeforeEdit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton8Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
frm_main.view_momo(t_op_ctn1,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton10Click(Sender: TObject);
|
|
|
|
|
var s_czmc,s_user,s_key,s_yzh,s_yzhuser,s_yzhkey,s_lh,s_zc,s_zcuser,s_zckey,s_sscz:string;
|
|
|
|
|
s_CRCZ,MBLNO,BSNO,s_GL,s_STKY,MJCZ,userzh,passwordzh,zhcz:string;
|
|
|
|
|
CTNINFO:TContainerInfo;
|
|
|
|
|
i:integer;
|
|
|
|
|
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');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s_zc:=get_parameters_value(2113,'false');
|
|
|
|
|
|
|
|
|
|
s_zcuser:=get_parameters_value(2111,'');
|
|
|
|
|
s_zckey:=get_parameters_value(2112,'false');
|
|
|
|
|
|
|
|
|
|
s_sscz:=get_parameters_value(2114,'false');
|
|
|
|
|
|
|
|
|
|
s_CRCZ:=get_parameters_value(2115,'false');
|
|
|
|
|
|
|
|
|
|
s_GL:=get_parameters_value(2116,'false');
|
|
|
|
|
s_STKY:=get_parameters_value(2116,'false');
|
|
|
|
|
|
|
|
|
|
MJCZ:=get_parameters_value(2118,'false');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userzh:=get_parameters_value(2119,'false');
|
|
|
|
|
passwordzh:=get_parameters_value(2120,'false');
|
|
|
|
|
zhcz:=get_parameters_value(2121,'false');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_czmc then
|
|
|
|
|
if if_reg(2602) 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
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD>dz<EFBFBD>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_yzh then
|
|
|
|
|
if if_reg(2603) 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
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_lh then
|
|
|
|
|
if if_reg(2604) 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
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2>½<EFBFBD><C2BD><EFBFBD><EFBFBD>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=zhcz then
|
|
|
|
|
if if_reg(2611) then
|
|
|
|
|
GetdyczInfo_zh(userzh,passwordzh,Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),'') //NSSLTACQB4264902
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_CRCZ then
|
|
|
|
|
begin
|
|
|
|
|
if 1=1 then
|
|
|
|
|
begin
|
|
|
|
|
MBLNO:=Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString);
|
|
|
|
|
BSNO:=Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
for i:=1 to 10 do
|
|
|
|
|
begin
|
|
|
|
|
ctninfo:=TCR.Create('<27><><EFBFBD>ٳ<EFBFBD>վ');
|
|
|
|
|
CTNINFO.Search('tdh='+MBLNO);
|
|
|
|
|
if SaveCTNINFO(s_user,s_zckey,MBLNO,BSNO,CTNINFO) then
|
|
|
|
|
begin
|
|
|
|
|
break;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD>᳤<EFBFBD>ٳ<EFBFBD>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_GL then
|
|
|
|
|
begin
|
|
|
|
|
if 1=1 then
|
|
|
|
|
begin
|
|
|
|
|
MBLNO:=Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString);
|
|
|
|
|
BSNO:=Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
ctninfo:=TGL.Create('<27><>½<EFBFBD><C2BD>վ');
|
|
|
|
|
CTNINFO.Search(MBLNO);
|
|
|
|
|
SaveCTNINFO(s_user,s_zckey,MBLNO,BSNO,CTNINFO);
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>½<EFBFBD><C2BD>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_STKY then
|
|
|
|
|
begin
|
|
|
|
|
if 1=1 then
|
|
|
|
|
begin
|
|
|
|
|
MBLNO:=Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString);
|
|
|
|
|
BSNO:=Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
ctninfo:=TSTKY.Create('<27><><EFBFBD>ڿ<EFBFBD><DABF>˳<EFBFBD>վ');
|
|
|
|
|
CTNINFO.Search(MBLNO);
|
|
|
|
|
SaveCTNINFO(s_user,s_zckey,MBLNO,BSNO,CTNINFO);
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF>˳<EFBFBD>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_GL then
|
|
|
|
|
begin
|
|
|
|
|
if 1=1 then
|
|
|
|
|
begin
|
|
|
|
|
MBLNO:=Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString);
|
|
|
|
|
BSNO:=Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
ctninfo:=TCR.Create('<27><>½<EFBFBD><C2BD>վ');
|
|
|
|
|
CTNINFO.Search('tdh='+MBLNO);
|
|
|
|
|
SaveCTNINFO(s_user,s_zckey,MBLNO,BSNO,CTNINFO);
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>½<EFBFBD><C2BD>վ,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_zc then
|
|
|
|
|
begin
|
|
|
|
|
if if_reg(2610) then
|
|
|
|
|
GetdyczInfo_zc(s_zcuser,s_zckey,Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2><EFBFBD>д<EFBFBD><D0B4><EFBFBD>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=s_sscz then
|
|
|
|
|
begin
|
|
|
|
|
if if_reg(2605) then
|
|
|
|
|
getssczinfor(Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString))
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2>ʤʨ<CAA4><CAA8>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><>վ').AsString)=MJCZ then
|
|
|
|
|
begin
|
|
|
|
|
if if_reg(2606) then
|
|
|
|
|
getmjczinfor(Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString))
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
if if_reg(2601) then
|
|
|
|
|
GetdyczInfo_jfcz('','',Trim(t_op_ctn.DataSource.DataSet.fieldbyname('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),'')
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('û<><C3BB>ע<EFBFBD><D7A2><EFBFBD>ݷ᳡վͨ<D5BE><CDA8>,<2C><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>ʤע<CAA4><D7A2>');
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
t_op_ctn.Requery;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
//getssczinfor
|
|
|
|
|
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);
|
|
|
|
|
var i,k:integer;
|
|
|
|
|
begin
|
|
|
|
|
if t_op_ctn.DataSource.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>״̬').asstring='<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>' then
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('ҵ<><D2B5><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><D3B7><EFBFBD>');
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
try
|
|
|
|
|
k:=0;
|
|
|
|
|
t_ch_fee.Close;
|
|
|
|
|
t_ch_fee.Open;
|
|
|
|
|
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 (t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat<>0)
|
|
|
|
|
and (trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asString)<>'')
|
|
|
|
|
and (trim(t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asString)<>'')
|
|
|
|
|
// and (trim(t_op_ctn.fieldbyname('<27><>ַ').asString)<>'')
|
|
|
|
|
then
|
|
|
|
|
begin
|
|
|
|
|
t_ch_fee.Append;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD>']:='<27><>';
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asfloat;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD>״̬']:='¼<><C2BC>״̬';
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['<27><><EFBFBD><EFBFBD>'];
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='½<>˷<EFBFBD>';
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD>Ӣ<EFBFBD><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
|
|
|
|
|
t_ch_fee['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asString;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD>㵥λ']:='<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
t_ch_fee['<27><>']:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ').asString;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=1;
|
|
|
|
|
t_ch_fee['<27>ұ<EFBFBD>']:='RMB';
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=1;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
|
|
t_ch_fee['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=0;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD>뿪Ʊ']:=0;
|
|
|
|
|
|
|
|
|
|
t_ch_fee['<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>']:=0;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
|
|
|
|
|
|
|
t_ch_fee['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
|
|
t_ch_fee['<27>Ƿ<EFBFBD><C7B7>渶']:=0;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ']:=0;
|
|
|
|
|
|
|
|
|
|
t_ch_fee['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
|
|
|
|
|
t_ch_fee['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
|
|
|
|
|
t_ch_fee['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
|
|
t_ch_fee['<27><><EFBFBD><EFBFBD>']:=0;
|
|
|
|
|
|
|
|
|
|
t_ch_fee['<27><>ע']:=t_op_ctn.fieldbyname('<27><><EFBFBD><EFBFBD>').asString+','+t_op_ctn.fieldbyname('<27><>ַ').asString+','+t_op_ctn.fieldbyname('<27><>ע').asString;
|
|
|
|
|
t_ch_fee.post;
|
|
|
|
|
k:=k+1;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ');
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
ShowMessage('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
if k>0 then
|
|
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+IntToStr(k)+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinPanel1Resize(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
i:integer;
|
|
|
|
|
begin
|
|
|
|
|
i:=round(bsSkinPanel1.Width/14);
|
|
|
|
|
bsSkinButton1.Width:=i;
|
|
|
|
|
bsSkinButton2.Width:=i;
|
|
|
|
|
bsSkinButton3.Width:=i;
|
|
|
|
|
bsSkinButton4.Width:=i;
|
|
|
|
|
bsSkinButton6.Width:=i;
|
|
|
|
|
bsSkinButton7.Width:=i;
|
|
|
|
|
bsSkinButton8.Width:=i;
|
|
|
|
|
bsSkinButton9.Width:=i;
|
|
|
|
|
bsSkinButton10.Width:=i;
|
|
|
|
|
bsSkinButton12.Width:=i;
|
|
|
|
|
bsSkinButton13.Width:=i;
|
|
|
|
|
bsSkinButton14.Width:=i;
|
|
|
|
|
bsSkinButton15.Width:=i;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton14Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
savewwgrid(frm_op_ctn.wwDBGrid1,'<27><>װ<EFBFBD><D7B0>');
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_ctn.bsSkinButton13Click(Sender: TObject);
|
|
|
|
|
var Ext,ctnno,ctnType,cnts:string;
|
|
|
|
|
ExcelTemplet:Variant;
|
|
|
|
|
i:integer;
|
|
|
|
|
begin
|
|
|
|
|
if OpenDialog1.Execute then begin
|
|
|
|
|
Ext:=lowercase(ExtractFileExt(OpenDialog1.FileName));
|
|
|
|
|
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,4].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,4].Value)<>'' do //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
begin
|
|
|
|
|
begin
|
|
|
|
|
if VartoStr(ExcelTemplet.ActiveSheet.Cells[I,10].Value)<>'' then //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.append;
|
|
|
|
|
cnts:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,12].Value);
|
|
|
|
|
cnts:=copy(cnts,pos('*',cnts)+1,4);
|
|
|
|
|
ctnno:=copy(cnts,1,2);;
|
|
|
|
|
ctnType:=copy(cnts,3,2);
|
|
|
|
|
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,10].Value);
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,11].Value);
|
|
|
|
|
|
|
|
|
|
t_op_ctn.FieldByName('<27><>ͷ').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,2].Value);
|
|
|
|
|
|
|
|
|
|
t_op_ctn.FieldByName('<27><>װ').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,3].Value);
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,4].Value);
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,5].Value);
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=VartoStr(ExcelTemplet.ActiveSheet.Cells[I,6].Value);
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t_op_ctndetail.Append;
|
|
|
|
|
t_op_ctndetail.FieldByName('ctn_id').AsInteger:=t_op_ctn.FieldByName('ctn_id').AsInteger;
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><>װ').AsString:=Vartostr(ExcelTemplet.ActiveSheet.Cells[I,3].Value);
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(Vartostr(ExcelTemplet.ActiveSheet.Cells[I,4].Value));
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(Vartostr(ExcelTemplet.ActiveSheet.Cells[I,5].Value));
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(Vartostr(ExcelTemplet.ActiveSheet.Cells[I,6].Value));
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=Vartostr(ExcelTemplet.ActiveSheet.Cells[I,8].Value);
|
|
|
|
|
t_op_ctndetail.FieldByName('hts').AsString:=Vartostr(ExcelTemplet.ActiveSheet.Cells[I,7].Value);
|
|
|
|
|
t_op_ctndetail.Post;
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
t_op_ctn.Edit;
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger+StrToInt(Vartostr(ExcelTemplet.ActiveSheet.Cells[I,4].Value));
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat+StrToFloat(Vartostr(ExcelTemplet.ActiveSheet.Cells[I,5].Value));
|
|
|
|
|
t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_ctn.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat+StrToFloat(Vartostr(ExcelTemplet.ActiveSheet.Cells[I,6].Value));
|
|
|
|
|
t_op_ctn.Post;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t_op_ctndetail.Append;
|
|
|
|
|
t_op_ctndetail.FieldByName('ctn_id').AsInteger:=t_op_ctn.FieldByName('ctn_id').AsInteger;
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><>װ').AsString:=Vartostr(ExcelTemplet.ActiveSheet.Cells[I,3].Value);
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=StrToInt(Vartostr(ExcelTemplet.ActiveSheet.Cells[I,4].Value));
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(Vartostr(ExcelTemplet.ActiveSheet.Cells[I,5].Value));
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=StrToFloat(Vartostr(ExcelTemplet.ActiveSheet.Cells[I,6].Value));
|
|
|
|
|
t_op_ctndetail.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=Vartostr(ExcelTemplet.ActiveSheet.Cells[I,8].Value);
|
|
|
|
|
t_op_ctndetail.FieldByName('hts').AsString:=Vartostr(ExcelTemplet.ActiveSheet.Cells[I,7].Value);
|
|
|
|
|
t_op_ctndetail.Post;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
i:=i+1;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
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.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.
|
|
|
|
|
|