You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS6JIEFENG/业务订舱/crm_OnLineShippingOrder.pas

566 lines
20 KiB
Plaintext

This file contains ambiguous Unicode characters!

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

unit crm_OnLineShippingOrder;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, BusinessSkinForm, bsSkinCtrls, dxExEdtr, dxCntner,
dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, Grids, DBGridEh, StdCtrls,
Mask, bsSkinBoxCtrls,u_op_seae_DsWebService,SoapHTTPClient,InvokeRegistry,
Menus, kbmMemTable,my_sys_function;
type
Tfrm_crm_OnLineShippingOrder = class(TForm)
bsSkinPanel2: TbsSkinPanel;
bsSkinPanel3: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
dxdbgrd1: TdxDBGrid;
bsBusinessSkinForm1: TbsBusinessSkinForm;
ds1: TDataSource;
qryInsert: TADOQuery;
dxdbgrd1Column2: TdxDBGridColumn;
dxdbgrd1Column3: TdxDBGridColumn;
dxdbgrd1Column5: TdxDBGridColumn;
dxdbgrd1Column6: TdxDBGridColumn;
qrysearch: TADOQuery;
MT2: TkbmMemTable;
StringField1: TStringField;
StringField2: TStringField;
StringField3: TStringField;
StringField4: TStringField;
StringField5: TStringField;
StringField6: TStringField;
StringField7: TStringField;
StringField8: TStringField;
StringField9: TStringField;
StringField10: TStringField;
StringField11: TStringField;
StringField12: TStringField;
StringField13: TStringField;
StringField14: TStringField;
StringField15: TStringField;
dxdbgrd1Column7: TdxDBGridColumn;
dxdbgrd1Column8: TdxDBGridColumn;
dxdbgrd1Column9: TdxDBGridColumn;
dxdbgrd1Column11: TdxDBGridColumn;
bsSkinButton3: TbsSkinButton;
t_ch_fee: TADOQuery;
bsSkinButton10: TbsSkinButton;
qryGetOpseae: TADOQuery;
qryGetOpseae2: TADOQuery;
qryGetCompany: TADOQuery;
MT1: TkbmMemTable;
MT1BSNO: TStringField;
MT1BSSTATUS: TStringField;
MT1BSDATE: TStringField;
MT1MBLNO: TStringField;
MT1CUSTNO: TStringField;
MT1SHIPPER: TStringField;
MT1SHIPPERID: TStringField;
MT1ETD: TStringField;
MT1ETA: TStringField;
MT1PORTLOADID: TStringField;
MT1PORTDISCHARGEID: TStringField;
MT1DESTINATIONID: TStringField;
MT1INPUTBY: TStringField;
MT1AUDITOR: TStringField;
MT1FORWARDER: TStringField;
MT1CARRIER: TStringField;
MT1CtnInfo: TStringField;
MT1CNTR: TStringField;
MT1TimeMark: TStringField;
MT1VESSEL: TStringField;
MT1VOYNO: TStringField;
MT1ISSUEPLACE: TStringField;
MT1BOOKINGTYPE: TStringField;
MT1OLDBSNO: TStringField;
MT1CONSIGNEE: TStringField;
MT1NOTIFYPARTY: TStringField;
MT1DESCRIPTION: TStringField;
MT1NOPKGS: TStringField;
MT1PKGS: TStringField;
MT1GROSSWEIGHT: TStringField;
MT1KGS: TStringField;
MT1MEASUREMENT: TStringField;
MT1CBM: TStringField;
MT1BOOKINGDESCRIPTION: TStringField;
MT1PLACEDELIVERY: TStringField;
MT1PLACEDELIVERYID: TStringField;
MT1SERVICE: TStringField;
MT1BLFRT: TStringField;
MT1PORTLOAD: TStringField;
MT1PORTDISCHARGE: TStringField;
MT1DESTINATION: TStringField;
MT1MARKS: TStringField;
MT1TOTALNO: TStringField;
MT1SENDERCOMPANY: TStringField;
MT1SENDERCOMPANYID: TStringField;
MT1SENDERNAME: TStringField;
MT1CARGOID: TStringField;
MT1COMPANYID: TStringField;
MT1KINDPKGS: TStringField;
MT1CLOSEDOCDATE: TStringField;
procedure bsSkinButton1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure dxdbgrd1DblClick(Sender: TObject);
function UnformatAfrstr(str:string):string;
procedure bsSkinButton3Click(Sender: TObject);
procedure SaveBooking;
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
private
XML,OPTYPE:String;
OpSeaeCount:Integer;
function REHH(str:string):string;
public
function GetXML(_OPTYPE:string):integer; overload;
function GetXML:integer; overload;
end;
var
frm_crm_OnLineShippingOrder: Tfrm_crm_OnLineShippingOrder;
implementation
uses u_op_seae, u_data_share, U_SelectLinkMan, u_sys_progress, u_main;
//using
{$R *.dfm}
procedure Tfrm_crm_OnLineShippingOrder.bsSkinButton1Click(Sender: TObject);
var _s,url:string; aa:DsWebServiceSoap;
begin
url:= get_WebseviceURL;
aa:=GetDsWebServiceSoap(false,get_WebseviceURL);//'http://192.168.1.105:5427/webservice/DsWebService.asmx');
//<2F><><EFBFBD>Ȼ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
_s:='<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
_s:=_s+'<BookingCargoSpace xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s:=_s+' <Head> ';
_s:=_s+' <OPID>'+frm_data_share.t_load_employee.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring+'</OPID> ';
_s:=_s+' <OPTYPE>1</OPTYPE> ';
_s:=_s+' <OPTIME></OPTIME> ';
_s:=_s+' <Version>1.0</Version> ';
_s:=_s+' </Head><OpseaeList> ';
_s:=_s+' <Opseae> ';
_s:=_s+' <BSNO>'+MT1.fieldbyname('BSNO').asstring+'</BSNO> ';
_s:=_s+' </Opseae></OpseaeList> ';
_s:=_s+'</BookingCargoSpace> ';
XML:=aa.SetBookingCargoSpaceAudit(_s);
//XML:=aa.ReceiveBookingCargoSpace(_s);
//Opseaecount:= frm_data_share.countString('Opseae',xml);
//result:= Opseaecount;
if (pos('<27>ɹ<EFBFBD>',XML)>0) then begin
ShowMessage('<27><><EFBFBD>سɹ<D8B3>');
MT1.Delete;
MT1.Post;
end else begin
ShowMessage('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>');
end;
end;
function Tfrm_crm_OnLineShippingOrder.GetXML(_OPTYPE:string): integer;
var _s,url,block,CompanySPXNO:string; aa:DsWebServiceSoap;
p1,p2:integer;
begin
OPTYPE:= _OPTYPE;
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(application);
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD>ڻ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ򡣡<C8BA><F2A1A3A1><EFBFBD>';
frm_sys_progress.bsSkinGauge1.MaxValue:=100;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.Value:=0;
qrysearch.Close;
qrysearch.SQL.text:='select * from t_code_subcomp where <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>=(select <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+employee+''')';
qrysearch.Open;
CompanySPXNO:=qrysearch.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring;
try
frm_data_share.t_load_employee.open;
//qryGetCompany.close;
//qryGetCompany.Parameters.ParamByName('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').Value:= frm_data_share.t_load_employee.fieldbyname('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').AsString;
//qryGetCompany.open;
url:= get_WebseviceURL;
aa:=GetDsWebServiceSoap(false,get_WebseviceURL);//'http://192.168.1.105:5427/webservice/DsWebService.asmx');
//<2F><><EFBFBD>Ȼ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
_s:='<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
_s:=_s+'<BookingCargoSpace xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s:=_s+' <Head> ';
_s:=_s+' <OPID>'+frm_data_share.t_load_employee.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring+'</OPID> ';
_s:=_s+' <COMPANYID>'+CompanySPXNO+'</COMPANYID> ';
_s:=_s+' <OPTYPE>'+OPTYPE+'</OPTYPE> ';
_s:=_s+' <OPTIME></OPTIME> ';
_s:=_s+' <Version>1.0</Version> ';
_s:=_s+' </Head> ';
_s:=_s+'</BookingCargoSpace> ';
//ShowMessage(_s);
XML:=aa.BusinessAction('ShippingOrder','Receive',_s);
XML:=StringReplace(XML,'#$A','',[rfReplaceAll]);
p1:=frm_data_share.GettimePotion(1,'<OpseaeList>',XML);
p2:=frm_data_share.GettimePotion(1,'</OpseaeList>',xml);
XML:=copy(XML,p1,p2-p1);
//ShowMessage(XML);
Opseaecount:= frm_data_share.countString('Opseae',xml);
result:= Opseaecount;
finally
frm_sys_progress.Close;
frm_sys_progress.Free;
frm_sys_progress:=nil;
if (XML='') then begin
result:=0;
//showmessage('û<><C3BB><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
end;
function Tfrm_crm_OnLineShippingOrder.GetXML: integer;
begin
result:=GetXML(OPTYPE);
end;
procedure Tfrm_crm_OnLineShippingOrder.FormShow(Sender: TObject);
var
_ts:widestring;
_s,Opseae,ctn,block,ctnblock,mes:string;
ctncount,p1,p2,p3,p4,_i:integer;
begin
//1.<2E><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>ٸ<EFBFBD>opseae<61><65>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD><EFBFBD>ݴ˷ֿ<CBB7>
MT1.close;
if (OpSeaeCount=0) then begin
ShowMessage('û<>д<EFBFBD><D0B4><EFBFBD><EFBFBD>յĶ<D5B5><C4B6><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<ͬ<><CDAC>shippingbox<6F><78>Ϣ>');
close;
end else begin
for _i:=1 to OpSeaeCount do begin
p1:=frm_data_share.GettimePotion(_i,'<Opseae>',xml);
p2:=frm_data_share.GettimePotion(_i,'</Opseae>',xml);
block:=Copy(xml,p1,p2-p1);
ctncount:=frm_data_share.countString('CTNINFO',block);
if (ctncount>0) then begin
p3:=frm_data_share.GettimePotion(1,'<CTNINFO>',block); //<2F><>һ<EFBFBD><D2BB>
p4:=frm_data_share.GettimePotion(ctncount,'</CTNINFO>',block)+10; //<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
ctnblock:= Copy(block,p3,p4-p3);
//<2F>Ѽ<EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣȥ<CFA2><C8A5>
p2:=frm_data_share.GettimePotion(_i,'<CTNINFO>',xml);
block:=Copy(xml,p1,p2-p1);
end;
MT1.Open;
MT1.Edit;
MT1.Insert;
MT1['BSNO']:=frm_data_share.GetXMLValue('BSNO',block);
MT1['MBLNO']:=frm_data_share.GetXMLValue('MBLNO',block);
MT1['ETD']:=frm_data_share.GetXMLValue('ETD',block);
MT1['CLOSINGDATE']:=frm_data_share.GetXMLValue('CLOSINGDATE',block);
MT1['PORTDISCHARGEID']:=frm_data_share.GetXMLValue('PORTDISCHARGEID',block);
MT1['PORTDISCHARGE']:=frm_data_share.GetXMLValue('PORTDISCHARGE',block);
MT1['VESSEL']:=frm_data_share.GetXMLValue('VESSEL',block);
MT1['VOYNO']:=frm_data_share.GetXMLValue('VOYNO',block);
MT1['ReceiverCOMPANY']:=frm_data_share.GetXMLValue('ReceiverCOMPANY',block);
MT1['ReceiverNAME']:=frm_data_share.GetXMLValue('ReceiverNAME',block);
MT1['CNTR']:=frm_data_share.GetXMLValue('CNTR',block);
MT1['TimeMark']:=frm_data_share.GetXMLValue('TIMEMARK',block);
MT1['CLOSEDOCDATE']:=frm_data_share.GetXMLValue('CLOSEDOCDATE',block);
MT1.Post;
end;
end;
end;
procedure Tfrm_crm_OnLineShippingOrder.SaveBooking;
var _s,_t,_id,_no,block,xml,onlinetimemark,onlinePosted,mttimemark,url,kjqj,wtdw,ETD,CLOSINGDATE,CLOSEDOCDATE,BSNO:string; //<2F><><EFBFBD><EFBFBD>
aa:DsWebServiceSoap;
p1,p2,_c,_i,_r,_L:Integer;
username,marks:string;
UPDField,MTField:TStringList;
begin
username:=frm_data_share.t_load_employee.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
UPDField:=TStringList.Create;
MTField:=TStringList.Create;
UPDField.Add('<27><><EFBFBD><EFBFBD><E1B5A5>');
MTField.Add('MBLNO');
UPDField.Add('<27><><EFBFBD><EFBFBD>');
MTField.Add('VESSEL');
UPDField.Add('<27><><EFBFBD><EFBFBD>');
MTField.Add('VOYNO');
UPDField.Add('ж<><D0B6><EFBFBD><EFBFBD>');
MTField.Add('PORTDISCHARGE');
UPDField.Add('<27>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>');
MTField.Add('CLOSINGDATE');
UPDField.Add('<27>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>');
MTField.Add('CLOSEDOCDATE');
UPDField.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
MTField.Add('ETD');
if (MT1.fieldbyname('CLOSINGDATE').asstring='') then begin
CLOSINGDATE:='null'; end
else begin CLOSINGDATE:=StringReplace(''''+MT1.fieldbyname('CLOSINGDATE').asstring+'''','/','-',[rfReplaceAll]); end;
if (MT1.fieldbyname('ETD').asstring='') then begin
ETD:='null'; end
else begin ETD:=StringReplace(''''+MT1.fieldbyname('ETD').asstring+'''','/','-',[rfReplaceAll]); end;
if (MT1.fieldbyname('CLOSEDOCDATE').asstring='') then begin
CLOSEDOCDATE:='null'; end
else begin CLOSEDOCDATE:=StringReplace(''''+MT1.fieldbyname('CLOSEDOCDATE').asstring+'''','/','-',[rfReplaceAll]); end;
BSNO:= MT1.fieldbyname('BSNO').AsString;
_r:= MessageDlg('<27><><EFBFBD>ܴ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD> '+#13#10+'ѡ<><D1A1><EFBFBD><EFBFBD>Yes<65><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>š<EFBFBD><C5A1><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD>Ρ<EFBFBD>ж<EFBFBD><D0B6><EFBFBD>ۡ<EFBFBD><DBA1>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD>ںͿ<DABA><CDBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+#13#10+'ѡ<><D1A1><EFBFBD><EFBFBD>NO<4E><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>Ŀǰδ<C7B0><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',mtWarning,[mbyes,mbno],0) ;
case _r of
mrYes:begin
//2 <20><>ѯ<EFBFBD><D1AF>bsno<6E><6F>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ǩ<EFBFBD>Ƿ<EFBFBD>
url:= get_WebseviceURL;
aa:=GetDsWebServiceSoap(false,url);
_s:='<?xml version="1.0" encoding="UTF-8" standalone="no"?> ';
_s:=_s+'<BookingInfo xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s:=_s+' <Booking> ';
_s:=_s+' <BSNO>'+BSNO+'</BSNO> ';
_s:=_s+' </Booking> ';
_s:=_s+'</BookingInfo> ';
xml:=aa.GetBsnoInfo(_s);
p1:=frm_data_share.GettimePotion(1,'<Booking>',xml);
p2:=frm_data_share.GettimePotion(1,'</Booking>',xml);
block:=Copy(xml,p1,p2-p1);
onlinetimemark:=frm_data_share.GetXMLValue('TimeMark',block);
onlinePosted:=frm_data_share.GetXMLValue('ISPOSTED',block);
mttimemark:=MT1.fieldbyname('TimeMark').AsString;
if (onlinetimemark<>mttimemark) then begin
ShowMessage('<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD><E4BBAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD>ѯ<EFBFBD><D1AF>');
end else begin
//if optype='1'
Qrysearch.Close;
Qrysearch.SQL.Text:='select * from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>='''+BSNO+'''';
Qrysearch.Open;
if (Qrysearch.RecordCount=0) then //0 <20><><EFBFBD><EFBFBD>
begin
//<2F>жϸö<CFB8><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD><D0BA>Ƿ<EFBFBD><C7B7><EFBFBD>ϵͳ<CFB5>ڴ<EFBFBD><DAB4>ڣ<EFBFBD><DAA3><EFBFBD><E7B2BB><EFBFBD><EFBFBD><EFBFBD>򱨾<EFBFBD><F2B1A8BE><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>
showmessage('<27><>ҵ<EFBFBD><D2B5><EFBFBD>ڱ<EFBFBD>ϵͳ<CFB5>в<EFBFBD><D0B2><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǹ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ѱ<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>');
end else
if (Qrysearch.RecordCount>0) then //1<><31><EFBFBD><EFBFBD>
begin
qryGetOpseae2.Close;
qryGetOpseae2.Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').Value:=BSNO;
qryGetOpseae2.Open;
with Qryinsert do
begin
Close; //function WeekofYear(Date: TDate): integer; //ȡ<>õ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ڵ<EFBFBD><DAB5>ܴ<EFBFBD>
_id:=qryGetOpseae2.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
_no:=get_no(Date,'SE');
kjqj:=inttostr(WeekofYear(Date));
sql.clear;
//SQL.Add(' delete from t_op_ctn where <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>='''+MT1.fieldbyname('OLDBSNO').asstring+''') ');
SQL.Add(' update t_op_seae set ');
SQL.Add(' <20><><EFBFBD><EFBFBD><E1B5A5>=:MBLNO, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+ETD+', <20>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD>='+CLOSINGDATE+', ж<><D0B6><EFBFBD><EFBFBD>=:PORTDISCHARGE');
SQL.Add(' ,ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:PORTDISCHARGEID ');
SQL.Add(' ,<2C><><EFBFBD><EFBFBD>=:VESSEL,<2C><><EFBFBD><EFBFBD>=:VOYNO,<2C>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>='+CLOSEDOCDATE);
SQL.Add(' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>=:BSNO');
Parameters.ParamByName('BSNO').Value:=BSNO;
Parameters.ParamByName('MBLNO').Value:=MT1.fieldbyname('MBLNO').asstring;
// Parameters.ParamByName('CUSTNO').Value:=_no;//
//Parameters.ParamByName('ETD').Value:=MT1.fieldbyname('ETD').asstring;
//Parameters.ParamByName('ETA').Value:=MT1.fieldbyname('ETA').asstring;
Parameters.ParamByName('PORTDISCHARGE').Value:=MT1.fieldbyname('PORTDISCHARGE').asstring;
Parameters.ParamByName('PORTDISCHARGEID').Value:=MT1.fieldbyname('PORTDISCHARGEID').asstring;
Parameters.ParamByName('VESSEL').Value:=MT1.fieldbyname('VESSEL').asstring;
Parameters.ParamByName('VOYNO').Value:=MT1.fieldbyname('VOYNO').asstring;
// Parameters.ParamByName('CLOSEDOCDATE').Value:=MT1.fieldbyname('CLOSEDOCDATE').asstring;
ExecSQL;
end;
//<2F><><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
_s:='<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
_s:=_s+'<BookingCargoSpace xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s:=_s+' <Head> ';
_s:=_s+' <OPID>'+frm_data_share.t_crm_client_weituo.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring+'</OPID> ';
_s:=_s+' <OPTYPE>3</OPTYPE> ';//3 <20><><EFBFBD><EFBFBD>֪ͨ
_s:=_s+' <OPTIME>'+datetimetostr(Date)+'</OPTIME> ';
_s:=_s+' <Version>1.0</Version> ';
_s:=_s+' </Head> ';
_s:=_s+'<OpseaeList> ';
_s:=_s+' <Opseae> ';
_s:=_s+' <BSNO>'+BSNO+'</BSNO> ';
_s:=_s+' </Opseae> ';
_s:=_s+'</OpseaeList> ';
_s:=_s+'</BookingCargoSpace> ';
XML:=aa.SetBookingCargoSpaceAudit(_s);
MT1.Delete ;
//<2F><>¼<EFBFBD><C2BC>־
qryGetOpseae.Close;
qryGetOpseae.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=_id;
qryGetOpseae.Open;
Booking_add(qryGetOpseae,_id,MT1.fieldbyname('ReceiverNAME').asstring,MT1.fieldbyname('ReceiverCOMPANY').asstring,BSNO,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ');
showmessage('<27><><EFBFBD>ճɹ<D5B3>');
end
end;
end;
mrNo:begin
url:= get_WebseviceURL;
aa:=GetDsWebServiceSoap(false,url);
_s:='<?xml version="1.0" encoding="UTF-8" standalone="no"?> ';
_s:=_s+'<BookingInfo xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s:=_s+' <Booking> ';
_s:=_s+' <BSNO>'+BSNO+'</BSNO> ';
_s:=_s+' </Booking> ';
_s:=_s+'</BookingInfo> ';
xml:=aa.GetBsnoInfo(_s);
p1:=frm_data_share.GettimePotion(1,'<Booking>',xml);
p2:=frm_data_share.GettimePotion(1,'</Booking>',xml);
block:=Copy(xml,p1,p2-p1);
onlinetimemark:=frm_data_share.GetXMLValue('TimeMark',block);
onlinePosted:=frm_data_share.GetXMLValue('ISPOSTED',block);
mttimemark:=MT1.fieldbyname('TimeMark').AsString;
if (onlinetimemark<>mttimemark) then begin
ShowMessage('<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD><E4BBAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD>ѯ<EFBFBD><D1AF>');
end else begin
//if optype='1'
Qrysearch.Close;
Qrysearch.SQL.Text:='select * from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>='''+BSNO+'''';
Qrysearch.Open;
if (Qrysearch.RecordCount=0) then //0 <20><><EFBFBD><EFBFBD>
begin
//<2F>жϸö<CFB8><C3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD><D0BA>Ƿ<EFBFBD><C7B7><EFBFBD>ϵͳ<CFB5>ڴ<EFBFBD><DAB4>ڣ<EFBFBD><DAA3><EFBFBD><E7B2BB><EFBFBD><EFBFBD><EFBFBD>򱨾<EFBFBD><F2B1A8BE><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>
showmessage('<27><>ҵ<EFBFBD><D2B5><EFBFBD>ڱ<EFBFBD>ϵͳ<CFB5>в<EFBFBD><D0B2><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǹ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ѱ<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>');
end else
if (Qrysearch.RecordCount>0) then //1<><31><EFBFBD><EFBFBD>
begin
qryGetOpseae2.Close;
qryGetOpseae2.Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>').Value:=BSNO;
qryGetOpseae2.Open;
_L:=UPDField.Count;
for _i:=0 to _L-1 do begin
with Qryinsert do
begin
Close; //function WeekofYear(Date: TDate): integer; //ȡ<>õ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ڵ<EFBFBD><DAB5>ܴ<EFBFBD>
if qryGetOpseae2.FieldByName(UPDField[_i]).AsString<>'' then Continue;
sql.clear;
//SQL.Add(' delete from t_op_ctn where <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>='''+MT1.fieldbyname('OLDBSNO').asstring+''') ');
SQL.Add(' update t_op_seae set ');
SQL.Add(UPDField[_i]+'=:'+MTField[_i]);
//ShowMessage(UPDField[_i]+'=:'+MTField[_i]);
SQL.Add(' where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>=:BSNO');
Parameters.ParamByName('BSNO').Value:=BSNO;
Parameters.ParamByName(MTField[_i]).Value:=MT1.fieldbyname(MTField[_i]).asstring;
ExecSQL;
end;
end;
//<2F><><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
_s:='<?xml version="1.0" encoding="UTF-8" standalone="no"?>';
_s:=_s+'<BookingCargoSpace xmlns="urn:Declaration:datamodel:standard:CN:MT2101:1"> ';
_s:=_s+' <Head> ';
_s:=_s+' <OPID>'+frm_data_share.t_crm_client_weituo.fieldbyname('<27><><EFBFBD><EFBFBD>ϵͳ<CFB5><CDB3><EFBFBD>к<EFBFBD>').asstring+'</OPID> ';
_s:=_s+' <OPTYPE>3</OPTYPE> ';//3 <20><><EFBFBD><EFBFBD>֪ͨ
_s:=_s+' <OPTIME>'+datetimetostr(Date)+'</OPTIME> ';
_s:=_s+' <Version>1.0</Version> ';
_s:=_s+' </Head> ';
_s:=_s+'<OpseaeList> ';
_s:=_s+' <Opseae> ';
_s:=_s+' <BSNO>'+BSNO+'</BSNO> ';
_s:=_s+' </Opseae> ';
_s:=_s+'</OpseaeList> ';
_s:=_s+'</BookingCargoSpace> ';
XML:=aa.SetBookingCargoSpaceAudit(_s);
MT1.Delete ;
//<2F><>¼<EFBFBD><C2BC>־
qryGetOpseae.Close;
qryGetOpseae.Parameters.ParamByName('<27><><EFBFBD><EFBFBD>').Value:=_id;
qryGetOpseae.Open;
Booking_add(qryGetOpseae,_id,MT1.fieldbyname('ReceiverNAME').asstring,MT1.fieldbyname('ReceiverCOMPANY').asstring,BSNO,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ');
showmessage('<27><><EFBFBD>ճɹ<D5B3>');
end
end;
end;
end;
if frm_op_seae.t_op_seae2.DataSet<>nil then begin
TADOQUERY(frm_op_seae.t_op_seae2.DataSet).Requery;
frm_op_seae.t_op_seae.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>',BSNO,[]);
end;
end;
function Tfrm_crm_OnLineShippingOrder.UnformatAfrstr(str: string): string;
begin
Result:=Trim(str);
Result:=StringReplace(Result,'&amp;','&',[rfReplaceAll]);
Result:=StringReplace(Result,'&lt;','<',[rfReplaceAll]);
Result:=StringReplace(Result,'&quot;','"',[rfReplaceAll]);
Result:=StringReplace(Result,'&gt;','>',[rfReplaceAll]);
Result:=StringReplace(Result,'&apos;','''',[rfReplaceAll]);
//Result:=StringReplace(Result,'\n;','#13#10',[rfReplaceAll]);
end;
function Tfrm_crm_OnLineShippingOrder.REHH(str: string): string;
var _r:string;
begin
_r:=StringReplace (str, '\\\\', #13#10, [rfReplaceAll]);
result:=_r;
end;
procedure Tfrm_crm_OnLineShippingOrder.bsSkinButton3Click(Sender: TObject);
var _s,url:string; aa:DsWebServiceSoap;
begin
SaveBooking;
end;
procedure Tfrm_crm_OnLineShippingOrder.dxdbgrd1DblClick(Sender: TObject);
begin
SaveBooking;
end;
procedure Tfrm_crm_OnLineShippingOrder.bsSkinButton4Click(Sender: TObject);
begin
{try
frm_SelectLinkMan:=Tfrm_SelectLinkMan.Create (self);
frm_SelectLinkMan.ShowModal;
finally
frm_SelectLinkMan.Free;
end;}
end;
procedure Tfrm_crm_OnLineShippingOrder.bsSkinButton10Click(Sender: TObject);
begin
GetXML();
FormShow(Sender);
end;
end.