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.

2347 lines
78 KiB
Plaintext

11 months ago
unit u_op_seae_edi_NB;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, StdCtrls, ExtCtrls, DB, ADODB,XMLDoc, XMLIntf,
xmldom, msxmldom, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP, IdCoder, IdCoder3to4, IdCoderMIME,DateUtils,EncdDecd,Httpapp,
IdHashMessageDigest,IdGlobal, IdHash,U_md5, IdMessage, IdURI, IniFiles,
IdExplicitTLSClientServerBase, IdMessageClient, IdSMTPBase, IdSMTP,IdAttachmentFile;
type
// head
NBEDIhead =
record
sndcom:string; // <20><> <20><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>˾
sender:string; // <20><> <20><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>
fromop:string; // <20><> <20><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>
fromtele:string; // <20><> <20><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ϵ<EFBFBD>
fromfax:string; // <20><> <20><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>
frommail:string; // <20><> <20><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ϵ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ַ
fromopc:string; // <20><> <20><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ϵ<EFBFBD>ֻ<EFBFBD>
fromope:string; // <20><> <20><><EFBFBD><EFBFBD>Աȫ<D4B1><C8AB>
accom:string; // <20><> <20><><EFBFBD>շ<EFBFBD><D5B7><EFBFBD>˾
accepter:string; // <20><> <20><><EFBFBD>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>
toop:string; // <20><> <20><><EFBFBD>շ<EFBFBD> <20><><EFBFBD><EFBFBD>Ա
sendtime:TDateTime; // <20><> <20><><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>ʱ<EFBFBD><CAB1>
editype:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(VGM:VERMAS ; <20><>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>:IFTMBF ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B6A9>:SHPORD ; <20><>˾<EFBFBD>ᵥ:SHPMIN)
EdiID:string; // <20><> <20><><EFBFBD>IJο<C4B2><CEBF><EFBFBD>
EdiName:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
EdiMode:string; // <20><> <20><><EFBFBD>ĸ<EFBFBD>ʽ := 'HYXML';
EdiReceiver:string; // <20><> <20><><EFBFBD>շ<EFBFBD>EDI<44><49><EFBFBD><EFBFBD>
EdiSender:string; // <20><> <20><><EFBFBD>շ<EFBFBD>EDI<44><49><EFBFBD><EFBFBD>
end;
//Forward
NBEDIForward =
record
EdiForwardFMT:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> <20><>ʽҪ<CABD><D2AA><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>ʽ
EdiForwardType:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> ת<><D7AA><EFBFBD><EFBFBD>ʽ
EdiForwardURL:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> ת<><D7AA><EFBFBD><EFBFBD>ַ
EdiForwardId:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> ת<><D7AA><EFBFBD>˺<EFBFBD>
EdiForwardPass:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> ת<><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
EdiForwardREFE1:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> ͨ<>ò<EFBFBD><C3B2><EFBFBD>1
EdiForwardREFE2:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> ͨ<>ò<EFBFBD><C3B2><EFBFBD>2
EdiForwardREFE3:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> ͨ<>ò<EFBFBD><C3B2><EFBFBD>3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
EdiForwardREFE4:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> ͨ<>ò<EFBFBD><C3B2><EFBFBD>4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
EdiForwardREFE5:string; // <20><> EDI<44>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> ͨ<>ò<EFBFBD><C3B2><EFBFBD>5 <20><><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD>(9<><39><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5<><35><EFBFBD>޸<EFBFBD> 1<><31>ȡ<EFBFBD><C8A1>)
end;
//reference
NBEDIreference =
record
blfreight:string; // <20><> <20><><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD>(9<><39><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5<><35><EFBFBD>޸<EFBFBD> 1<><31>ȡ<EFBFBD><C8A1>)
refid:string; // <20><> <20>ͻ<EFBFBD><CDBB><EFBFBD>ϵͳ<CFB5>е<EFBFBD>ID
freid:string; // <20><> <20><><EFBFBD><EFBFBD>ϵͳ<CFB5>е<EFBFBD>ID
referenceno:string; // <20><> <20><><EFBFBD>˱<EFBFBD><CBB1><EFBFBD>
bookingno:string; // <20><> <20><><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>
workno:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
sale:string; // <20><> <20><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>Ա
billofladingno:string; // <20><> <20><EFBFBD><E1B5A5>
end;
//baseinfo
NBEDIbaseinfo =
record
orderman:string; // <20><> <20><><EFBFBD>յ<EFBFBD>λ
source:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ
usdaccountshipper:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>Բ)
customshipper:string; // <20><> <20><><EFBFBD>ػ<EFBFBD><D8BB><EFBFBD>
rmbaccountshipper:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
paymenttermcode:string; // <20><> <20><><EFBFBD>ʽ<EEB7BD><CABD><EFBFBD><EFBFBD>(P/C/E) Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
paymentterm:string; // <20><> <20><><EFBFBD>ʽ
payableat:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD>ص<EFBFBD>
shippingitem:string; // <20><> <20>˷<EFBFBD><CBB7><EFBFBD><EFBFBD><EFBFBD>
billofladingtype:string; // <20><> <20><EFBFBD><E1B5A5><EFBFBD><EFBFBD>
shipper:string; // <20><> <20><EFBFBD><E1B5A5><EFBFBD><EFBFBD> <20><>99<39><39>ѭ<EFBFBD><D1AD> <20><><EFBFBD>г<EFBFBD><D0B3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>У<EFBFBD>ע<EFBFBD><EFBFBD>շ<EFBFBD>ͨÿ<CDA8><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
consignee:string; // <20><> <20>ջ<EFBFBD><D5BB><EFBFBD> <20><>99<39><39>ѭ<EFBFBD><D1AD> <20><><EFBFBD>г<EFBFBD><D0B3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>У<EFBFBD>ע<EFBFBD><EFBFBD>շ<EFBFBD>ͨÿ<CDA8><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
notifyparty:string; // <20><> ֪ͨ<CDA8><D6AA> <20><>99<39><39>ѭ<EFBFBD><D1AD> <20><><EFBFBD>г<EFBFBD><D0B3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>У<EFBFBD>ע<EFBFBD><EFBFBD>շ<EFBFBD>ͨÿ<CDA8><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
notifyparty2:string; // <20><> <20>ڶ<EFBFBD>֪ͨ<CDA8><D6AA> <20><>99<39><39>ѭ<EFBFBD><D1AD> <20><><EFBFBD>г<EFBFBD><D0B3><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>У<EFBFBD>ע<EFBFBD><EFBFBD>շ<EFBFBD>ͨÿ<CDA8><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>35<33><35><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
ordermemo:string; // <20><> <20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
numberoforiginals:string; // <20><> <20><EFBFBD><E1B5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
numberofcopys:string; // <20><> <20><EFBFBD><E1B5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
placeofissuecode:string; // <20><> ǩ<><C7A9><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>
placeofissue:string; // <20><> ǩ<><C7A9><EFBFBD><EFBFBD>
timeofissue:string; // <20><> ǩ<><C7A9>ʱ<EFBFBD><CAB1>
end;
//cargo
NBEDIcargo =
record
APPLICANT:string; // <20><> ѯ<>۵<EFBFBD>λ
BOKKINGPARTY:string; // <20><> ǩЭ<C7A9><D0AD><EFBFBD>ĵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
FOBPARTY:string; // <20><> <20><><EFBFBD><EFBFBD>յ<EFBFBD>λ
SCNO:string; // <20><> <20><><EFBFBD>߷<EFBFBD><DFB7><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>
QUARANTINECODING:string; // <20><> <20><><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD>
SCACCODE:string; // <20><> <20><><EFBFBD>߷<EFBFBD><DFB7><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>
QUOTATIONNO:string; // <20><> <20>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>
CHARGETYPE:string; // <20><> <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>
NVOCCHBLNO:string; // <20><> NVOCC<43><43>
realshipper:string; // <20><> <20><>ʵ<EFBFBD><EFBFBD><E1B5A5><EFBFBD><EFBFBD> <20><>99<39><39>ѭ<EFBFBD><D1AD>
realconsignee:string; // <20><> <20><>ʵ<EFBFBD>ջ<EFBFBD><D5BB><EFBFBD> <20><>99<39><39>ѭ<EFBFBD><D1AD>
realnotifyparty:string; // <20><> <20><>ʵ֪ͨ<CDA8><D6AA> <20><>99<39><39>ѭ<EFBFBD><D1AD>
realnotifyparty2:string; // <20><> <20><>ʵ<EFBFBD>ڶ<EFBFBD>֪ͨ<CDA8><D6AA> <20><>99<39><39>ѭ<EFBFBD><D1AD>
end;
//booking
NBEDIbooking =
record
shipmentdate:string; // <20><> װ<><D7B0>
expirydate:string; // <20><> Ч<><D0A7>
tranship:string; // <20><> ת<><D7AA><EFBFBD><EFBFBD>ʶ
batch:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ
quotationno:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>
end;
//freight
NBEDIfreight =
record
fl:string; // <20><> <20><><EFBFBD><EFBFBD>ƴ<EFBFBD><C6B4><EFBFBD><EFBFBD>׼(F/L)
masterlclno:string; // <20><> <20><>Ʊ<EFBFBD><EFBFBD><E1B5A5>
requestdate:string; // <20><> Ҫ<><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
lastdate:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
arrivedate:string; // <20><> Ҫ<>󵽴<EFBFBD><F3B5BDB4><EFBFBD><EFBFBD><EFBFBD>
end;
//port
ediport =
record
placeofreceipt:string; // <20><> <20>ջ<EFBFBD><D5BB>ص<EFBFBD>
portofloading:string; // <20><> װ<><D7B0><EFBFBD><EFBFBD>
portoftranship:string; // <20><> <20><>ת<EFBFBD><D7AA>
portofdischarge:string; // <20><> ж<><D0B6><EFBFBD><EFBFBD>
placeofdelivery:string; // <20><> Ŀ<>ĸ<EFBFBD>
finaldestination:string; // <20><> <20><><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĵ<EFBFBD>
co_placeofreceipt:string; // <20><> <20>ջ<EFBFBD><D5BB>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
co_portofloading:string; // <20><> װ<><D7B0><EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
co_portoftranship:string; // <20><> <20><>ת<EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
co_portofdischarge:string; // <20><> ж<><D0B6><EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
co_placeofdelivery:string; // <20><> Ŀ<>ĸ۴<C4B8><DBB4><EFBFBD>
co_finaldestination:string; // <20><> <20><><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĵش<C4B5><D8B4><EFBFBD>
end;
//vessel
edivessel =
record
carrier:string; // <20><> <20><><EFBFBD><EFBFBD>˾
oceanvessel:string; // <20><> <20><><EFBFBD><EFBFBD>
voyno:string; // <20><> <20><><EFBFBD><EFBFBD>
etd:TDateTime; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
deliverymode:string; // <20><> <20><><EFBFBD>ʽ
end;
//info2nd
ediinfo2nd =
record
carrier:string; // <20><> <20><><EFBFBD>̴<EFBFBD><CCB4><EFBFBD>˾
oceanvessel:string; // <20><> <20><><EFBFBD>̴<EFBFBD><CCB4><EFBFBD>
voyno:string; // <20><> <20><><EFBFBD>̺<EFBFBD><CCBA><EFBFBD>
etd:string; // <20><> <20><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
deliverymode:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
remarks:string; // <20><> <20><><EFBFBD>̱<EFBFBD>ע <20><>99<39><39>ѭ<EFBFBD><D1AD>
end;
//containers
edicontainers =
record
containertype:string; // <20><> <20><><EFBFBD><EFBFBD>
containerno:string; // <20><> <20><><EFBFBD><EFBFBD>
sealno:string; // <20><> <20><><EFBFBD><EFBFBD>
containernoofpkgs:string; // <20><> <20><><EFBFBD><EFBFBD>
containergrossweight:string; // <20><> ë<><C3AB>
containercbm:string; // <20><> <20><><EFBFBD><EFBFBD>
containerpackagingcode:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>
containerpackaging:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
containerdescription:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
containermarksandnumbers:string; // <20><> <20><><EFBFBD><EFBFBD>ͷ
vgmgrossmassweight:string; // <20><> VGM<47><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
vgmweighingmethod:string; // <20><> VGM<47><4D><EFBFBD>ط<EFBFBD>ʽ
vgmweighingtime:string; // <20><> VGM<47><4D><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
vgmresponsibleparty:string; // <20><> VGM<47><4D>ϵ<EFBFBD><CFB5>λ
vgmauthorizedperson:string; // <20><> VGM<47><4D>Ȩ<EFBFBD><C8A8>ϵ<EFBFBD><CFB5>
vgmauthorizedpersontele:string; // <20><> VGM<47><4D>Ȩ<EFBFBD><C8A8>ϵ<EFBFBD>˵绰
vgmauthorizedpersonmail:string; // <20><> VGM<47><4D>Ȩ<EFBFBD><C8A8>ϵ<EFBFBD><CFB5><EFBFBD>ʼ<EFBFBD>
vgmremark:string; // <20><> VGM<47><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>
end;
//goods
NBEDIgoods =
record
marksandnumbers:string; // <20><> <20><>ͷ <20><>99<39><39>ѭ<EFBFBD><D1AD>
noofpkgs:string; // <20><> <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
packagingcode:string; // <20><> <20><>װ<EFBFBD><D7B0><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>
packaging:string; // <20><> <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
cargoid:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(GC/RF/DR)
hscode:string; // <20><> <20><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>
description:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>Ļ<EFBFBD><C4BB><EFBFBD>) <20><>99<39><39>ѭ<EFBFBD><D1AD>
cdescription:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD>) <20><>99<39><39>ѭ<EFBFBD><D1AD>
grossweight:string; // <20><> ë<><C3AB>
cbm:string; // <20><> <20><><EFBFBD><EFBFBD>
specialgoods:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5> <20><>99<39><39>ѭ<EFBFBD><D1AD>
end;
//dr
NBEDIdr =
record
ediCLASS:string; // <20><> CLASS Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
PAGE:string; // <20><> Σ<><CEA3>Ʒҳ<C6B7><D2B3>
UNDGNO:string; // <20><> <20><><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
TECNAME:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
PACKGROUP:string; // <20><> <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
ediLABEL:string; // <20><> LABEL Σ<><CEA3>Ʒ<EFBFBD><C6B7>ǩ <20><>99<39><39>ѭ<EFBFBD><D1AD>
FLASHPOINT:string; // <20><> Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
FLASHUNIT:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ C=<3D><><EFBFBD><EFBFBD> F=<3D><><EFBFBD><EFBFBD>
EMSNO:string; // <20><> Ӧ<><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
MFAGNO:string; // <20><> ҽ<>Ƽ<EFBFBD><C6BC>ȴ<EFBFBD>ʩָ<CAA9>Ϻ<EFBFBD>
MPT:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱦ Y/N
Elinkman:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5> EMS CONTACTӦ<54><D3A6><EFBFBD><EFBFBD>ϵ
DANGEROUS:string; // <20><> Σ<><CEA3>Ʒ<EFBFBD><C6B7>Ϣ
TEMPERATURE:string; // <20><> <20><><EFBFBD><EFBFBD>Ʒ<EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>
TEMPERATUREUNIT:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ C=<3D><><EFBFBD><EFBFBD> F=<3D><><EFBFBD><EFBFBD>
MINTEMPERATURE:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MAXTEMPERATURE:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ALLCOLDTORAGE:string; // <20><> ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Y/N
VENTI:string; // <20><> ͨ<><CDA8><EFBFBD><EFBFBD>
REEFER:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ <20><>99<39><39>ѭ<EFBFBD><D1AD>
end;
//loadplan
NBEDIloadplan =
record
entryno:string; // <20><> <20><><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>
warehouse:string; // <20><> <20>ֿ<EFBFBD>
landcarrier:string; // <20><> <20><><EFBFBD><EFBFBD>
stuffdate:TDateTime; // <20><> װ<><D7B0>ʱ<EFBFBD><CAB1>
stuffmode:string; // <20><> װ<>ʽ
stuffaddress:string; // <20><> װ<><D7B0><EFBFBD>ص<EFBFBD>
stuffmemo:string; // <20><> װ<>䱸ע
end;
//announce
NBEDIannounce =
record
announce:string; //<2F><> <20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
end;
//goodsdetail VGMû<4D><C3BB> <20><>˾<EFBFBD><CBBE><EFBFBD>ա<EFBFBD><D5A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ա<EFBFBD><D5A1><EFBFBD>˾<EFBFBD><EFBFBD><E1B5A5>
NBEDIgoodsdetail =
record
cargosequenceno:string; // <20><> <20>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
marksandnumbers:string; // <20><> <20><>ͷ <20><>99<39><39>ѭ<EFBFBD><D1AD>
noofpkgs:string; // <20><> <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
packagingcode:string; // <20><> <20><>װ<EFBFBD><D7B0><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>
packaging:string; // <20><> <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
cargoid:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(GC/RF/DR)
hscode:string; // <20><> <20><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>
description:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>Ļ<EFBFBD><C4BB><EFBFBD>) <20><>99<39><39>ѭ<EFBFBD><D1AD>
cdescription:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD>) <20><>99<39><39>ѭ<EFBFBD><D1AD>
grossweight:string; // <20><> ë<><C3AB>
cbm:string; // <20><> <20><><EFBFBD><EFBFBD>
specialgoods:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5> <20><>99<39><39>ѭ<EFBFBD><D1AD>
end;
//goodsdetail_dr VGMû<4D><C3BB> <20><>˾<EFBFBD><CBBE><EFBFBD>ա<EFBFBD><D5A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ա<EFBFBD><D5A1><EFBFBD>˾<EFBFBD><EFBFBD><E1B5A5>
NBEDIgoodsdetail_dr =
record
ediCLASS:string; // <20><> CLASS Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
PAGE:string; // <20><> Σ<><CEA3>Ʒҳ<C6B7><D2B3>
UNDGNO:string; // <20><> <20><><EFBFBD>Ϲ<EFBFBD>Σ<EFBFBD><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>
TECNAME:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
PACKGROU:string; // <20><> <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
ediLABEL:string; // <20><> LABEL Σ<><CEA3>Ʒ<EFBFBD><C6B7>ǩ <20><>99<39><39>ѭ<EFBFBD><D1AD>
FLASHPOINT:string; // <20><> Σ<>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
FLASHUNIT:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ C=<3D><><EFBFBD><EFBFBD> F=<3D><><EFBFBD><EFBFBD>
EMSNO:string; // <20><> Ӧ<><D3A6><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9>
MFAGNO:string; // <20><> ҽ<>Ƽ<EFBFBD><C6BC>ȴ<EFBFBD>ʩָ<CAA9>Ϻ<EFBFBD>
MPT:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱦ Y/N
Elinkman:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5> EMS CONTACTӦ<54><D3A6><EFBFBD><EFBFBD>ϵ
DANGEROUS:string; // <20><> Σ<><CEA3>Ʒ<EFBFBD><C6B7>Ϣ
TEMPERATURE:string; // <20><> <20><><EFBFBD><EFBFBD>Ʒ<EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>
TEMPERATUREUNIT:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD>¶ȼ<C2B6><C8BC><EFBFBD><EFBFBD><EFBFBD>λ C=<3D><><EFBFBD><EFBFBD> F=<3D><><EFBFBD><EFBFBD>
MINTEMPERATURE:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MAXTEMPERATURE:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ALLCOLDTORAGE:string; // <20><> ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Y/N
VENTI:string; // <20><> ͨ<><CDA8><EFBFBD><EFBFBD>
REEFER:string; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ <20><>99<39><39>ѭ<EFBFBD><D1AD>
end;
//goodsdetail_containers ֻ<>д<EFBFBD>˾<EFBFBD><EFBFBD><E1B5A5>
NBEDIgoodsdetail_containers =
record
containertype:string; // <20><> <20><><EFBFBD><EFBFBD>
containerno:string; // <20><>
sealno:string; // <20><>
containernoofpkgs:string; // <20><>
containergrossweight:string; // <20><>
containercbm:string; // <20><>
end;
var
MyContainers : array [0..99] of edicontainers;
MyNBEDIgoodsdetail : array [0..99] of NBEDIgoodsdetail;
MyNBEDIgoodsdetail_containers : array [0..99] of array [0..99] of NBEDIgoodsdetail_containers;
goods_ctn_count: array [0..99] of integer;
type
TFrm_op_seae_edi_NB = class(TForm)
bsSkinPanel1: TbsSkinPanel;
bsSkinPanel2: TbsSkinPanel;
WJGN: TbsSkinRadioGroup;
HDTD: TbsSkinCheckGroup;
BWTYPE: TbsSkinRadioGroup;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
t_sys_company: TADOQuery;
XMLDocument1: TXMLDocument;
SaveDialog1: TSaveDialog;
IdSMTP1: TIdSMTP;
IdMessage1: TIdMessage;
CheckBox1: TCheckBox;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
procedure bsSkinButton3Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
function GetNBEDIhead(var MyNBEDIhead : NBEDIhead):Boolean;
function GetNBEDIForward(var MyNBEDIForward : NBEDIForward):Boolean;
function GetNBEDIreference(var MyNBEDIreference : NBEDIreference):Boolean;
function GetNBEDIbaseinfo(var MyNBEDIbaseinfo : NBEDIbaseinfo):Boolean;
function GetNBEDIcargo(var MyNBEDIcargo : NBEDIcargo):Boolean;
function GetNBEDIbooking(var MyNBEDIbooking : NBEDIbooking):Boolean;
function GetNBEDIfreight(var MyNBEDIfreight : NBEDIfreight):Boolean;
function Getediport(var MyPort : ediport):Boolean;
function Getedivessel(var MyVessel : edivessel):Boolean;
function Getediinfo2nd(var Myinfo2nd : ediinfo2nd):Boolean;
function Getedicontainers(var ContainerCount:Integer):Boolean;
function GetNBEDIgoods(var MyNBEDIgoods : NBEDIgoods):Boolean;
function GetNBEDIdr(var MyNBEDIdr : NBEDIdr):Boolean;
function GetNBEDIloadplan(var MyNBEDIloadplan : NBEDIloadplan):Boolean;
function GetNBEDIgoodsdetail(var goodscount : Integer):Boolean;
function GetNBEDIannounce(var myNBEDIannounce :NBEDIannounce):Boolean;
public
{ Public declarations }
function GetCompany:String;
function CheckParaExist(para:string):Boolean;
function GetCntrVGM(cntrsize: String):String;
function GetPackVGM(cntrsize: String):String;
function GetECodeVGM(cntrsize: String):String;
function GetTelVGM(cntrsize: String):String;
function GetDepartmentVGM(cntrsize: String):String;
function CheckSendorCode:Boolean;
function IsZhongwen(Str: String): Boolean;
function SeparateEC(Str: String): string;
function GetEmailVGM(cntrsize: String):String;
function GetShipVGM(Ship:String): String;
function GetShipFTP(Ship:String): String;
function Changestr(str:widestring):string;
function GetClient(str:string):TStringList;
procedure MakeVGM(xmltype:Integer);
procedure sendmail;
procedure SendFile;
function GetCustCode(CorpID:string):string;
end;
var
Frm_op_seae_edi_NB: TFrm_op_seae_edi_NB;
HasM:Boolean; //<2F>Ƿ<EFBFBD><C7B7>д<EFBFBD>
RequestFile:string;
filerole,filetype,filename,goodstype:string; //<2F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MyNBEDIgoodsdetail_dr : array of NBEDIgoodsdetail_dr;
const
PackageName:array[0..50] of string= (
'Bag','Bale, compressed','Barrel','Basket','Bin','Bobbin','Box',
'Bucket','Bundle','Cage','Can, cylindrical','Carboy, non-protected','Carton','Case',
'Cask','Chest','Coil','Cone','Container','Crate','Cylinder',
'Drum','Flask','Frame','Hamper','Hogshead','Intermediate bulk container','Jar',
'Jug','Keg','Liftvan','Package','Pail','Pallet','Pieces',
'Rack','Reel','Roll','Sack','Set','Sheet','Skid',
'Spool','Tank, rectangular','Tray','Trunk','Tub','Tube','Unit',
'Unpacked or unpackaged','Van Pack'
);
PackageCode:array[0..50] of string= (
'BG','BL','BA','BK','BI','BB','BX',
'BJ','BE','CG','CX','CO','CT','CS',
'CK','CH','CL','AJ','CN','CR','CY',
'DR','FL','FR','HR','HG','WA','JR',
'JG','KG','LV','PK','PL','PX','PP',
'RK','RL','RO','SA','SX','ST','SI',
'SO','TK','PU','TR','TP','TU','UN',
'NE','VK'
);
implementation
uses u_op_seae, my_sys_function, u_main, u_data_share, u_op_seae_assistant;
{$R *.dfm}
function TFrm_op_seae_edi_NB.GetNBEDIhead(var MyNBEDIhead : NBEDIhead):Boolean;
var
aQuery:TADOQuery;
SQLStr:string;
begin
Result:=False;
if BWTYPE.ItemIndex=0 then filetype:='SHPMBF'; // IFTMBF ?
if BWTYPE.ItemIndex=1 then filetype:='SHPORD';
if BWTYPE.ItemIndex=2 then filetype:='VERMAS';
if BWTYPE.ItemIndex=3 then filetype:='SHPMIN';
if hdtd.Checked[0] then filename:=frm_op_seae.t_op_seae.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString+':'+FormatDateTime('yyyymmddhhmmss',Now)
else filename:='TD:'+frm_op_seae.t_op_seae.fieldbyname('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString+':'+FormatDateTime('yyyymmddhhmmss',Now) ;
aQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
if not t_sys_company.Active then t_sys_company.Open;
if (IsZhongwen(t_sys_company.fieldbyname('VGM<47><4D><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>').AsString)) or (not CheckParaExist(t_sys_company.fieldbyname('VGM<47><4D><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>').AsString)) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD>ܰ<EFBFBD><DCB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡');
Exit;
end;
MyNBEDIhead.sndcom := t_sys_company.fieldbyname('VGM<47><4D><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>').AsString;
if (IsZhongwen(GetECodeVGM(employee))) or (not CheckParaExist(GetECodeVGM(employee))) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>Ϊ<EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡');
Exit;
end;
MyNBEDIhead.fromop:=GetECodeVGM(employee);
if not CheckParaExist(GetTelVGM(employee)) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ϵ<EFBFBD>绰δ<E7BBB0><CEB4><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡');
Exit;
end;
MyNBEDIhead.fromtele:=GetTelVGM(employee);
if bwtype.ItemIndex=2 then MyNBEDIhead.frommail:= 'dongshengsoft@dongshengsoft.com'
else MyNBEDIhead.frommail:= GetEmailVGM(employee) ;
if Trim(MyNBEDIhead.frommail)='' then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡');
Exit;
end;
MyNBEDIhead.fromopc := empmobil;
MyNBEDIhead.fromope := employeecode;
if Trim(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>˾').AsString)='' then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD>շ<EFBFBD><D5B7><EFBFBD>˾Ϊ<CBBE>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
MyNBEDIhead.accom := aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>˾').AsString;
MyNBEDIhead.sendtime := Now;
MyNBEDIhead.editype := filetype;
MyNBEDIhead.EdiID :=filename;
MyNBEDIhead.EdiName:= filename;
MyNBEDIhead.EdiMode :='HYXML';
if Trim(GetShipVGM(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>˾').AsString))='' then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE>'+BWTYPE.Items[BWTYPE.ItemIndex]+'<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>');
Exit;
end;
MyNBEDIhead.EdiReceiver:=GetShipVGM(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>˾').AsString);
MyNBEDIhead.EdiSender:=t_sys_company.fieldbyname('VGM<47><4D><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>').AsString;
FreeAndNil(aQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIForward(var MyNBEDIForward : NBEDIForward):Boolean;
begin
Result:=False;
if WJGN.ItemIndex=0 then filerole:='9';
if WJGN.ItemIndex=1 then filerole:='5';
if WJGN.ItemIndex=2 then filerole:='1';
MyNBEDIForward.EdiForwardREFE5:= filerole;
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIreference(var MyNBEDIreference : NBEDIreference):Boolean;
var
aQuery:TADOQuery;
SQLStr:string;
begin
Result:=False;
aQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
if WJGN.ItemIndex=0 then filerole:='9';
if WJGN.ItemIndex=1 then filerole:='5';
if WJGN.ItemIndex=2 then filerole:='1';
MyNBEDIreference.blfreight:= filerole;
MyNBEDIreference.bookingno:= frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
MyNBEDIreference.referenceno:= aQuery.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
MyNBEDIreference.workno:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
if CheckBox1.Checked then MyNBEDIreference.sale:=Edit1.Text else MyNBEDIreference.sale:='gu';
if CheckBox1.Checked then
begin
if not CheckParaExist(MyNBEDIreference.sale) then
begin
HasM:=True;
ShowMessage('COSCO<43><4F>˾<EFBFBD><CBBE><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>Ա<EFBFBD><D4B1><EFBFBD>ţ<EFBFBD>');
Exit;
end;
end;
MyNBEDIreference.billofladingno := aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString;
if not CheckParaExist(MyNBEDIreference.billofladingno) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>XML<4D><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡');
Exit;
end;
FreeAndNil(aQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIbaseinfo(var MyNBEDIbaseinfo : NBEDIbaseinfo):Boolean;
var
aQuery:TADOQuery;
SQLStr:string;
begin
Result:=False;
aQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
MyNBEDIbaseinfo.orderman:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>˾').AsString;
MyNBEDIbaseinfo.paymentterm:=aQuery.fieldbyname('<27><><EFBFBD>ѷ<EFBFBD>ʽ').AsString;
{
if not CheckParaExist(MyNBEDIbaseinfo.paymentterm) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD>ѷ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>XML<4D><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡');
Exit;
end;
}
if Pos('PREPAID',MyNBEDIbaseinfo.paymentterm)>0 then MyNBEDIbaseinfo.paymenttermcode:='P'
else if Pos('COLLECT',MyNBEDIbaseinfo.paymentterm)>0 then MyNBEDIbaseinfo.paymenttermcode:='C'
else MyNBEDIbaseinfo.paymenttermcode:='E';
MyNBEDIbaseinfo.shippingitem:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
// <20>շ<EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д
MyNBEDIbaseinfo.shipper := aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString;
{ if not CheckParaExist(MyNBEDIbaseinfo.shipper) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>');
Exit;
end; }
MyNBEDIbaseinfo.consignee:=aQuery.fieldbyname('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString;
{ if not CheckParaExist(MyNBEDIbaseinfo.consignee) then
begin
HasM:=True;
ShowMessage('<27>ջ<EFBFBD><D5BB>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>');
Exit;
end; }
MyNBEDIbaseinfo.notifyparty:=aQuery.fieldbyname('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString;
{ if not CheckParaExist(MyNBEDIbaseinfo.notifyparty) then
begin
HasM:=True;
ShowMessage('֪ͨ<CDA8>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>');
Exit;
end; }
if not HDTD.Checked[0] then MyNBEDIbaseinfo.notifyparty2:=aQuery.fieldbyname('<27>ڶ<EFBFBD>֪ͨ<CDA8><D6AA>').AsString;
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='ONE' then MyNBEDIbaseinfo.numberoforiginals:='1';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='TWO' then MyNBEDIbaseinfo.numberoforiginals:='2';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='THREE' then MyNBEDIbaseinfo.numberoforiginals:='3';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='FOUR' then MyNBEDIbaseinfo.numberoforiginals:='4';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='FIVE' then MyNBEDIbaseinfo.numberoforiginals:='5';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='SIX' then MyNBEDIbaseinfo.numberoforiginals:='6';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='SEVEN' then MyNBEDIbaseinfo.numberoforiginals:='7';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='EIGHT' then MyNBEDIbaseinfo.numberoforiginals:='8';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='NINE' then MyNBEDIbaseinfo.numberoforiginals:='9';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='THEN' then MyNBEDIbaseinfo.numberoforiginals:='10';
if aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString='NONE' then MyNBEDIbaseinfo.numberoforiginals:='0';
if Trim(aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString)='' then MyNBEDIbaseinfo.numberoforiginals:='0';
// MyNBEDIbaseinfo.numberoforiginals:=aQuery.fieldbyname('<27><EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString;
MyNBEDIbaseinfo.placeofissuecode:='NBPORTEDI';
MyNBEDIbaseinfo.placeofissue:=aQuery.fieldbyname('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').AsString;
MyNBEDIbaseinfo.timeofissue:=aQuery.fieldbyname('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
FreeAndNil(aQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIcargo(var MyNBEDIcargo : NBEDIcargo):Boolean;
var
aQuery:TADOQuery;
SQLStr:string;
begin
Result:=False;
aQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
MyNBEDIcargo.QUOTATIONNO := aQuery.fieldbyname('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').AsString;
FreeAndNil(aQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIbooking(var MyNBEDIbooking : NBEDIbooking):Boolean;
begin
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIfreight(var MyNBEDIfreight : NBEDIfreight):Boolean;
begin
Result:=True;
end;
function TFrm_op_seae_edi_NB.Getediport(var MyPort : ediport):Boolean;
var
aQuery:TADOQuery;
SQLStr:string;
begin
Result:=False;
aQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
MyPort.portofloading:=aQuery.fieldbyname('װ<><D7B0><EFBFBD><EFBFBD>').AsString;
{if not CheckParaExist(MyPort.portofloading) then
begin
HasM:=True;
ShowMessage('װ<><D7B0><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end; }
MyPort.portofdischarge:=aQuery.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD>').AsString;
MyPort.placeofdelivery:=aQuery.fieldbyname('Ŀ<>ĵ<EFBFBD>').AsString;
MyPort.co_portofloading:=aQuery.fieldbyname('װ<>۴<EFBFBD><DBB4><EFBFBD>').AsString;
{ if not CheckParaExist(MyPort.co_portofloading) then
begin
HasM:=True;
ShowMessage('װ<>۴<EFBFBD><DBB4><EFBFBD><EBB2BB>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end; }
MyPort.co_portofdischarge:=aQuery.fieldbyname('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
MyPort.co_placeofdelivery:=aQuery.fieldbyname('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').AsString;
FreeAndNil(aQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.Getedivessel(var MyVessel : edivessel):Boolean;
var
aQuery:TADOQuery;
SQLStr:string;
begin
Result:=False;
aQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
MyVessel.carrier:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>˾').AsString;
MyVessel.oceanvessel:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
{ if BWTYPE.ItemIndex<>0 then
begin
if not CheckParaExist(MyVessel.oceanvessel) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
end; }
MyVessel.voyno:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
MyVessel.etd:= aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime;
{ if not CheckParaExist(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end; }
FreeAndNil(aQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.Getediinfo2nd(var Myinfo2nd : ediinfo2nd):Boolean;
begin
Result:=True;
end;
function TFrm_op_seae_edi_NB.Getedicontainers(var ContainerCount:Integer):Boolean;
var
aQuery,bQuery:TADOQuery;
SQLStr:string;
i:Integer;
begin
Result:=False;
aQuery:=CreateAdoQuery;
bQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with bQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
if HDTD.Checked[0] then
begin
SQLStr:='SELECT t_op_ctn_fendan.*,t_code_ctn.EDI<44><49><EFBFBD><EFBFBD> FROM t_op_ctn_fendan INNER JOIN t_code_ctn ON t_op_ctn_fendan.<2E><><EFBFBD><EFBFBD>=t_code_ctn.<2E><><EFBFBD><EFBFBD>'
+' where as_id='+QuotedStr(bQuery.fieldbyname('as_id').AsString);
end
else
begin
SQLStr:='SELECT t_op_ctn.*, t_code_ctn.EDI<44><49><EFBFBD><EFBFBD> FROM t_op_ctn INNER JOIN t_code_ctn ON t_op_ctn.<2E><><EFBFBD><EFBFBD> = t_code_ctn.<2E><><EFBFBD><EFBFBD>'
+' WHERE t_op_ctn.<2E><><EFBFBD><EFBFBD>='+QuotedStr(bQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
end;
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
ContainerCount:=aQuery.RecordCount;
if ContainerCount=0 then
begin
HasM:=True;
ShowMessage('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
aQuery.First;
for i:=0 to ContainerCount-1 do
begin
MyContainers[i].containertype:=GetCntrVGM(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
if not CheckParaExist(MyContainers[i].containertype) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD>'+BWTYPE.Items[BWTYPE.ItemIndex]+'<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ã<EFBFBD>');
Exit;
end;
MyContainers[i].containerno:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
if BWTYPE.ItemIndex<>0 then
begin
if not CheckParaExist(MyContainers[i].containerno) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
end;
MyContainers[i].sealno:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
{ if BWTYPE.ItemIndex<>0 then
begin
if not CheckParaExist(MyContainers[i].sealno) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
end; }
MyContainers[i].containernoofpkgs:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
{if not CheckParaExist(MyContainers[i].containernoofpkgs) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end; }
MyContainers[i].containergrossweight:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
{if BWTYPE.ItemIndex<>0 then
begin
if not CheckParaExist(MyContainers[i].containergrossweight) then
begin
HasM:=True;
ShowMessage('ë<>ز<EFBFBD><D8B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
end; }
MyContainers[i].containercbm:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
{ if BWTYPE.ItemIndex<>0 then
begin
if not CheckParaExist(MyContainers[i].containercbm) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
end; }
MyContainers[i].containerpackagingcode:=aQuery.fieldbyname('<27><>װ').AsString;
{ MyContainers[i].containerpackagingcode:=GetPackVGM(aQuery.fieldbyname('<27><>װ').AsString);
if BWTYPE.ItemIndex<>0 then
begin
if not CheckParaExist(MyContainers[i].containerpackagingcode) then
begin
HasM:=True;
ShowMessage('<27><>װ'+BWTYPE.Items[BWTYPE.ItemIndex]+'<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD>ã<EFBFBD>'); //<2F><>װEDI<44><49><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>(VGM)
Exit;
end;
end; }
MyContainers[i].containerpackaging:=aQuery.fieldbyname('<27><>װ').AsString;
{ if BWTYPE.ItemIndex<>0 then
begin
if not CheckParaExist(MyContainers[i].containerpackaging) then
begin
HasM:=True;
ShowMessage('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
end; }
//t_op_ctn_fendan û<>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶΣ<D6B6><CEA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if HDTD.Checked[0] then
begin
if BWTYPE.ItemIndex<>2 then MyContainers[i].vgmgrossmassweight:='' else
MyContainers[i].vgmgrossmassweight:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
end
else
begin
if BWTYPE.ItemIndex<>2 then MyContainers[i].vgmgrossmassweight:='' else
MyContainers[i].vgmgrossmassweight:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
if BWTYPE.ItemIndex=2 then
begin
if not CheckParaExist(MyContainers[i].vgmgrossmassweight) then
begin
HasM:=True;
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
end;
//t_op_ctn_fendan û<>г<EFBFBD><D0B3>ط<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>SM1<4D><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if not HDTD.Checked[0] then
begin
if BWTYPE.ItemIndex<>2 then MyContainers[i].vgmweighingmethod:='' else
begin
if (Trim(aQuery.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').AsString)='') or (Trim(aQuery.fieldbyname('<27><><EFBFBD>ط<EFBFBD>ʽ').AsString)='<27>ۼ<EFBFBD>') then
MyContainers[i].vgmweighingmethod:='SM2'else MyContainers[i].vgmweighingmethod:= 'SM1';
end;
end;
if HDTD.Checked[0] then
begin
if BWTYPE.ItemIndex=2 then
MyContainers[i].vgmweighingmethod:= 'SM1';
end;
//t_op_ctn_fendan û<><C3BB>VGM<47><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3>ÿ<EFBFBD><C3BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if HDTD.Checked[0] then
begin
if BWTYPE.ItemIndex=2 then
MyContainers[i].vgmweighingtime:=FormatDateTime('yyyy-mm-dd',bQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime-3);
end
else
begin
if BWTYPE.ItemIndex=2 then
begin
if Trim(aQuery.fieldbyname('VGM<47><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString)='' then
MyContainers[i].vgmweighingtime:=FormatDateTime('yyyy-mm-dd',bQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsDateTime-3)
else MyContainers[i].vgmweighingtime:=aQuery.fieldbyname('VGM<47><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
end;
if BWTYPE.ItemIndex=2 then
begin
MyContainers[i].vgmresponsibleparty :=GetDepartmentVGM(employee);
if not CheckParaExist(MyContainers[i].vgmresponsibleparty) then
begin
HasM:=True;
ShowMessage(BWTYPE.Items[BWTYPE.ItemIndex]+'<27><>ϵ<EFBFBD><CFB5>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end;
end;
MyContainers[i].vgmauthorizedperson:=employeecode;
MyContainers[i].vgmauthorizedpersontele:=emptel;
aQuery.Next;
end;
FreeAndNil(aQuery);
FreeAndNil(bQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIgoods(var MyNBEDIgoods : NBEDIgoods):Boolean;
var
aQuery:TADOQuery;
SQLStr:string;
s:string;
begin
Result:=False;
aQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
MyNBEDIgoods.marksandnumbers:=aQuery.fieldbyname('<27><>ͷ').AsString;
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{if not CheckParaExist(MyNBEDIgoods.marksandnumbers) then
begin
HasM:=True;
ShowMessage('<27><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
Exit;
end; }
MyNBEDIgoods.noofpkgs:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoods.packagingcode:=trim(GetPackVGM(aQuery.fieldbyname('<27><>װ').AsString));
//MyNBEDIgoods.packagingcode:=aQuery.fieldbyname('<27><>װ').AsString;
MyNBEDIgoods.packaging:=aQuery.fieldbyname('<27><>װ').AsString;
//* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(GC/RF/DR)
s:= aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').AsString;
if s='D' then goodstype:='DR' else if s='R' then goodstype:='RF' else goodstype:='GC';
MyNBEDIgoods.cargoid:=goodstype;
MyNBEDIgoods.description:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoods.cdescription:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoods.grossweight:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoods.cbm:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
FreeAndNil(aQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIdr(var MyNBEDIdr : NBEDIdr):Boolean;
var
aQuery:TADOQuery;
SQLStr:string;
begin
Result:=False;
aQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').AsString ='D' then
begin
MyNBEDIdr.ediclass:=aQuery.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString;
MyNBEDIdr.UNDGNO:= aQuery.fieldbyname('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString;
end;
if aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').AsString ='R' then
begin
MyNBEDIdr.TEMPERATURE:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
MyNBEDIdr.TEMPERATUREUNIT:=aQuery.fieldbyname('<27>¶ȵ<C2B6>λ').AsString;
MyNBEDIdr.MINTEMPERATURE:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
MyNBEDIdr.MAXTEMPERATURE:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
end;
FreeAndNil(aQuery);
Result:=True;
end;
procedure TFrm_op_seae_edi_NB.MakeVGM(xmltype:Integer);
var
fNode,pNode,mNode,cNode,dNode,eNode,gNode: IXMLNode; {<7B><><EFBFBD><EFBFBD>7<EFBFBD><37><EFBFBD>ڵ<EFBFBD>}
sl:TStringList;
i,k,Elength,Wlength,Clength:Integer;
myhead:NBEDIhead;
myForward:NBEDIForward;
myreference:NBEDIreference;
mybaseinfo:NBEDIbaseinfo;
mycargo:NBEDIcargo;
mybooking:NBEDIbooking;
myfreight:NBEDIfreight;
myport:ediport;
myvessel:edivessel;
myinfo:ediinfo2nd;
ContainerCount,goodscount:Integer;
mygoods:NBEDIgoods;
mydr:NBEDIdr;
myloadolan:NBEDIloadplan;
myNBEDIannounce :NBEDIannounce;
begin
XMLDocument1.XML.Clear;
XMLDocument1.Active := True;
XMLDocument1.Version := '1.0';
XMLDocument1.Encoding := 'GB2312';
//<2F><><EFBFBD>Ӹ<EFBFBD><D3B8>ڵ<EFBFBD> edi
fNode := XMLDocument1.AddChild('edi');
// Ϊ<><CEAA><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD>:HEAD
pNode := fNode.AddChild('head');
GetNBEDIhead(myhead);
cNode := pNode.AddChild('sndcom'); //*
cNode.Text := myhead.sndcom;
cNode := pNode.AddChild('sender');
cNode.Text :=myhead.sender;
cNode := pNode.AddChild('fromop'); //*
cNode.Text := myhead.fromop;
cNode := pNode.AddChild('fromtele'); //*
cNode.Text := myhead.fromtele;
cNode := pNode.AddChild('fromfax');
cNode.Text := myhead.fromfax;
cNode := pNode.AddChild('frommail'); //*
cNode.Text := myhead.frommail;
cNode := pNode.AddChild('fromopc');
cNode.Text := myhead.fromopc;
cNode := pNode.AddChild('fromope');
cNode.Text := myhead.fromope;
cNode := pNode.AddChild('accom'); //*
cNode.Text :=myhead.accom;
cNode := pNode.AddChild('accepter');
cNode.Text :=myhead.accepter;
cNode := pNode.AddChild('toop');
cNode.Text :=myhead.toop;
cNode := pNode.AddChild('sendtime'); //*
cNode.Text:=FormatDateTime('yyyy-mm-dd hh:mm:ss',myhead.sendtime);
cNode := pNode.AddChild('editype'); //*
cNode.Text:=myhead.editype;
cNode := pNode.AddChild('EdiID'); //*
cNode.Text:=myhead.EdiID;
cNode := pNode.AddChild('EdiName');
cNode.Text:=myhead.EdiName;
cNode := pNode.AddChild('EdiMode'); //*
cNode.Text:=myhead.EdiMode;
cNode := pNode.AddChild('EdiReceiver'); //*
cNode.Text := myhead.EdiReceiver;
cNode := pNode.AddChild('EdiSender'); //*
cNode.Text := myhead.EdiSender;
// Ϊ<><CEAA><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD>:Forward
pNode := fNode.AddChild('Forward');
GetNBEDIForward(myForward);
cNode := pNode.AddChild('EdiForwardFMT');
cNode.Text := myForward.EdiForwardFMT;
cNode := pNode.AddChild('EdiForwardType');
cNode.Text := myForward.EdiForwardType;
cNode := pNode.AddChild('EdiForwardURL');
cNode.Text := myForward.EdiForwardURL;
cNode := pNode.AddChild('EdiForwardId');
cNode.Text := myForward.EdiForwardId;
cNode := pNode.AddChild('EdiForwardPass');
cNode.Text := myForward.EdiForwardPass;
cNode := pNode.AddChild('EdiForwardREFE1');
cNode.Text := myForward.EdiForwardREFE1;
cNode := pNode.AddChild('EdiForwardREFE2');
cNode.Text := myForward.EdiForwardREFE2;
cNode := pNode.AddChild('EdiForwardREFE3');
cNode.Text := myForward.EdiForwardREFE3;
cNode := pNode.AddChild('EdiForwardREFE4');
cNode.Text := myForward.EdiForwardREFE4;
cNode := pNode.AddChild('EdiForwardREFE5');
cNode.Text := myForward.EdiForwardREFE5;
// Ϊ<><CEAA><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD>:reference
pNode := fNode.AddChild('reference');
GetNBEDIreference(myreference);
cNode := pNode.AddChild('blfreight'); //*
cNode.Text := myreference.blfreight;
cNode := pNode.AddChild('refid');
cNode.Text := myreference.refid;
cNode := pNode.AddChild('freid');
cNode.Text := myreference.freid;
cNode := pNode.AddChild('referenceno');
cNode.Text := myreference.referenceno;
cNode := pNode.AddChild('bookingno'); //*
cNode.Text := myreference.bookingno;
cNode := pNode.AddChild('workno'); //*
cNode.Text := myreference.workno;
cNode := pNode.AddChild('sale');
cNode.Text := myreference.sale;
cNode := pNode.AddChild('billofladingno'); //*
cNode.Text := myreference.billofladingno;
// Ϊ<><CEAA><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD>:detail
pNode := fNode.AddChild('detail');
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ӽڵ<D3BD> baseinfo
mNode:= pNode.AddChild('baseinfo');
GetNBEDIbaseinfo(mybaseinfo);
cNode := mNode.AddChild('orderman'); //* <20><><EFBFBD>յ<EFBFBD>λ <20><><EFBFBD><EFBFBD>¼<EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>մ<EFBFBD><D5B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û¼<C3BB><C2BC>ȡcompany<6E><79><EFBFBD><EFBFBD>shortname
cNode.Text := mybaseinfo.orderman;
cNode := mNode.AddChild('source');
cNode := mNode.AddChild('usdaccountshipper');
cNode.Text := mybaseinfo.usdaccountshipper;
cNode := mNode.AddChild('customshipper');
cNode.Text := mybaseinfo.customshipper;
cNode := mNode.AddChild('rmbaccountshipper');
cNode.Text := mybaseinfo.rmbaccountshipper;
cNode := mNode.AddChild('paymenttermcode'); //* <20><><EFBFBD>ʽ<EEB7BD><CABD><EFBFBD><EFBFBD>(P/C/E)
cNode.Text := mybaseinfo.paymenttermcode;
cNode := mNode.AddChild('paymentterm'); //*
cNode.Text := mybaseinfo.paymentterm;
cNode := mNode.AddChild('payableat');
cNode.Text := mybaseinfo.payableat;
cNode := mNode.AddChild('shippingitem'); //*
cNode.Text := mybaseinfo.shippingitem;
cNode := mNode.AddChild('billofladingtype'); //*
cNode.Text := mybaseinfo.billofladingtype;
cNode := mNode.AddChild('shipper'); //*
sl:=TStringList.Create;
sl.Text:=mybaseinfo.shipper;
for i:=0 to sl.Count-1 do
begin
dNode := cNode.AddChild('text');
dNode.Text:=sl[i];
end;
sl.Free;
cNode := mNode.AddChild('consignee'); //*
sl:=TStringList.Create;
sl.Text:=mybaseinfo.consignee;
for i:=0 to sl.Count-1 do
begin
dNode := cNode.AddChild('text');
dNode.Text:=sl[i];
end;
sl.Free;
cNode := mNode.AddChild('notifyparty'); //*
sl:=TStringList.Create;
sl.Text:=mybaseinfo.notifyparty;
for i:=0 to sl.Count-1 do
begin
dNode := cNode.AddChild('text');
dNode.Text:=sl[i];
end;
sl.Free;
cNode := mNode.AddChild('notifyparty2');
if Trim(mybaseinfo.notifyparty2)<>'' then
begin
sl:=TStringList.Create;
sl.Text:=mybaseinfo.notifyparty2;
for i:=0 to sl.Count-1 do
begin
dNode := cNode.AddChild('text');
dNode.Text:=sl[i];
end;
sl.Free;
end
else
begin
dNode := cNode.AddChild('text');
end;
cNode := mNode.AddChild('ordermemo');
cNode.Text := mybaseinfo.ordermemo;
cNode := mNode.AddChild('numberoforiginals'); //*
cNode.Text := mybaseinfo.numberoforiginals;
cNode := mNode.AddChild('numberofcopys');
cNode.Text := mybaseinfo.numberofcopys;
cNode := mNode.AddChild('placeofissuecode'); //*
cNode.Text := mybaseinfo.placeofissuecode;
cNode := mNode.AddChild('placeofissue'); //*
cNode.Text := mybaseinfo.placeofissue;
cNode := mNode.AddChild('timeofissue'); //*
cNode.Text := mybaseinfo.timeofissue;
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ӽڵ<D3BD> cargo
mNode:= pNode.AddChild('cargo');
GetNBEDIcargo(mycargo);
cNode := mNode.AddChild('APPLICANT');
cNode.Text := mycargo.APPLICANT;
cNode := mNode.AddChild('BOKKINGPARTY');
cNode.Text := mycargo.BOKKINGPARTY;
cNode := mNode.AddChild('FOBPARTY');
cNode.Text := mycargo.FOBPARTY;
cNode := mNode.AddChild('SCNO');
cNode.Text := mycargo.SCNO;
cNode := mNode.AddChild('QUARANTINECODING');
cNode.Text := mycargo.QUARANTINECODING;
cNode := mNode.AddChild('SCACCODE');
cNode.Text := mycargo.SCACCODE;
cNode := mNode.AddChild('QUOTATIONNO');
cNode.Text := mycargo.QUOTATIONNO;
cNode := mNode.AddChild('CHARGETYPE');
cNode.Text := mycargo.CHARGETYPE;
cNode := mNode.AddChild('NVOCCHBLNO');
cNode.Text := mycargo.NVOCCHBLNO;
cNode := mNode.AddChild('realshipper');
dNode := cNode.AddChild('text');
dNode.Text := mycargo.realshipper;
cNode := mNode.AddChild('realconsignee');
dNode := cNode.AddChild('text');
dNode.Text := mycargo.realconsignee;
cNode := mNode.AddChild('realnotifyparty');
dNode := cNode.AddChild('text');
dNode.Text := mycargo.realnotifyparty;
cNode := mNode.AddChild('realnotifyparty2');
dNode := cNode.AddChild('text');
dNode.Text := mycargo.realnotifyparty2;
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ӽڵ<D3BD> booking
mNode:= pNode.AddChild('booking');
GetNBEDIbooking(mybooking);
cNode := mNode.AddChild('shipmentdate');
cNode.Text := mybooking.shipmentdate;
cNode := mNode.AddChild('expirydate');
cNode.Text := mybooking.expirydate;
cNode := mNode.AddChild('tranship');
cNode.Text := mybooking.tranship;
cNode := mNode.AddChild('batch');
cNode.Text := mybooking.batch;
cNode := mNode.AddChild('quotationno');
cNode.Text := mybooking.quotationno;
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ӽڵ<D3BD> freight
mNode:= pNode.AddChild('freight');
GetNBEDIfreight(myfreight);
cNode := mNode.AddChild('fl');
cNode.Text := myfreight.fl;
cNode := mNode.AddChild('masterlclno');
cNode.Text := myfreight.masterlclno;
cNode := mNode.AddChild('requestdate');
cNode.Text := myfreight.requestdate;
cNode := mNode.AddChild('lastdate');
cNode.Text := myfreight.lastdate;
cNode := mNode.AddChild('arrivedate');
cNode.Text := myfreight.arrivedate;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD> port
cNode := mNode.AddChild('port');
Getediport(myport);
dNode := cNode.AddChild('placeofreceipt');
dNode.Text := myport.placeofreceipt;
dNode := cNode.AddChild('portofloading'); //* װ<><D7B0><EFBFBD><EFBFBD>
dNode.Text := myport.portofloading;
dNode := cNode.AddChild('portoftranship');
dNode.Text := myport.portoftranship;
dNode := cNode.AddChild('portofdischarge'); //* ж<><D0B6><EFBFBD><EFBFBD>
dNode.Text := myport.portofdischarge;
dNode := cNode.AddChild('placeofdelivery'); //* Ŀ<>ĸ<EFBFBD>
dNode.Text:=myport.placeofdelivery;
dNode := cNode.AddChild('finaldestination');
dNode.Text:=myport.finaldestination;
dNode := cNode.AddChild('co_placeofreceipt');
dNode.Text:=myport.co_placeofreceipt;
dNode := cNode.AddChild('co_portofloading'); //* װ<><D7B0><EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
dNode.Text:=myport.co_portofloading;
dNode := cNode.AddChild('co_portoftranship');
dNode.Text:=myport.co_portoftranship;
dNode := cNode.AddChild('co_portofdischarge'); //* ж<><D0B6><EFBFBD>۴<EFBFBD><DBB4><EFBFBD>
dNode.Text:=myport.co_portofdischarge;
dNode := cNode.AddChild('co_placeofdelivery'); //* Ŀ<>ĸ۴<C4B8><DBB4><EFBFBD>
dNode.Text:=myport.co_placeofdelivery;
dNode := cNode.AddChild('co_finaldestination');
dNode.Text:=myport.co_finaldestination;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD>vessel
cNode := mNode.AddChild('vessel');
Getedivessel(myvessel);
dNode := cNode.AddChild('carrier'); //* <20><><EFBFBD><EFBFBD>˾
dNode.Text:=myvessel.carrier;
dNode := cNode.AddChild('oceanvessel'); //* <20><><EFBFBD><EFBFBD>
dNode.Text:=myvessel.oceanvessel;
dNode := cNode.AddChild('voyno'); //* <20><><EFBFBD><EFBFBD>
dNode.Text:=myvessel.voyno;
dNode := cNode.AddChild('etd'); //* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
dNode.Text:= FormatDateTime('yyyy-mm-dd',myvessel.etd);
dNode := cNode.AddChild('deliverymode');
dNode.Text := myvessel.deliverymode;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD>info2nd
cNode := mNode.AddChild('info2nd');
Getediinfo2nd(myinfo);
dNode := cNode.AddChild('carrier');
dNode.Text := myinfo.carrier;
dNode := cNode.AddChild('oceanvessel');
dNode.Text := myinfo.oceanvessel;
dNode := cNode.AddChild('voyno');
dNode.Text := myinfo.voyno;
dNode := cNode.AddChild('etd');
dNode.Text := myinfo.etd;
dNode := cNode.AddChild('deliverymode');
dNode.Text := myinfo.deliverymode;
dNode := cNode.AddChild('remarks');
eNode := dNode.AddChild('text');
eNode.Text := myinfo.remarks;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽڵ<D3BD>container
cNode := mNode.AddChild('container'); //<2F><><EFBFBD><EFBFBD>װ<EFBFBD><D7B0>û¼<C3BB><C2BC><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
Getedicontainers(ContainerCount);
if ContainerCount =0 then
begin
HasM:=True;
ShowMessage('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>EDI<44>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡');
Exit;
end;
for i:=0 to ContainerCount-1 do
begin
dNode := cNode.AddChild('containers'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>
eNode := dNode.AddChild('containertype'); //* <20><><EFBFBD><EFBFBD> <20><><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>
eNode.Text:=mycontainers[i].containertype;
eNode := dNode.AddChild('containerno'); //* <20><><EFBFBD><EFBFBD> <20><><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>
eNode.Text:=mycontainers[i].containerno;
eNode := dNode.AddChild('sealno'); //* <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
eNode.Text:=mycontainers[i].sealno;
eNode := dNode.AddChild('containernoofpkgs'); //* <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
eNode.Text:=mycontainers[i].containernoofpkgs;
eNode := dNode.AddChild('containergrossweight'); //* ë<><C3AB> <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
eNode.Text:=mycontainers[i].containergrossweight;
eNode := dNode.AddChild('containercbm'); //* <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
eNode.Text:=mycontainers[i].containercbm;
eNode := dNode.AddChild('containerpackagingcode'); //* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD> <20><>װ<EFBFBD><D7B0><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>
eNode.Text:=mycontainers[i].containerpackagingcode;
eNode := dNode.AddChild('containerpackaging'); //* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
eNode.Text:=mycontainers[i].containerpackaging;
eNode := dNode.AddChild('containerdescription');
gNode := eNode.AddChild('text');
gNode.Text := mycontainers[i].containerdescription;
eNode := dNode.AddChild('containermarksandnumbers');
eNode.Text := mycontainers[i].containermarksandnumbers;
eNode := dNode.AddChild('vgmgrossmassweight'); //VGM<47><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
eNode.Text:=mycontainers[i].vgmgrossmassweight;
eNode := dNode.AddChild('vgmweighingmethod'); //VGM<47><4D><EFBFBD>ط<EFBFBD>ʽ <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
eNode.Text:=mycontainers[i].vgmweighingmethod;
eNode := dNode.AddChild('vgmweighingtime'); //VGM<47><4D><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1> <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA> <20><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>
eNode.Text:=mycontainers[i].vgmweighingtime;
eNode := dNode.AddChild('vgmresponsibleparty'); //VGM<47><4D>ϵ<EFBFBD><CFB5>λ
eNode.Text:=mycontainers[i].vgmresponsibleparty;
eNode := dNode.AddChild('vgmauthorizedperson'); //VGM<47><4D>Ȩ<EFBFBD><C8A8>ϵ<EFBFBD><CFB5>
eNode.Text:=mycontainers[i].vgmauthorizedperson;
eNode := dNode.AddChild('vgmauthorizedpersontele'); //VGM<47><4D>Ȩ<EFBFBD><C8A8>ϵ<EFBFBD>˵绰
eNode.Text:=mycontainers[i].vgmauthorizedpersontele;
eNode := dNode.AddChild('vgmauthorizedpersonmail'); //VGM<47><4D>Ȩ<EFBFBD><C8A8>ϵ<EFBFBD><CFB5><EFBFBD>ʼ<EFBFBD>
eNode.Text := mycontainers[i].vgmauthorizedpersonmail;
eNode := dNode.AddChild('vgmremark'); //VGM<47><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>
eNode.Text := mycontainers[i].vgmremark;
end;
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ӽڵ<D3BD> goods
mNode:= pNode.AddChild('goods');
GetNBEDIgoods(mygoods);
cNode := mNode.AddChild('marksandnumbers'); //* <20><>ͷ
if Trim(mygoods.marksandnumbers)='' then
begin
dNode := cNode.AddChild('text');
end
else
begin
sl:=TStringList.Create;
sl.Text:=mygoods.marksandnumbers;
for i:=0 to sl.Count-1 do
begin
dNode := cNode.AddChild('text');
dNode.Text:=sl[i];
end;
sl.Free;
end;
cNode := mNode.AddChild('noofpkgs'); //* <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
cNode.Text:=mygoods.noofpkgs;
cNode := mNode.AddChild('packagingcode'); //* <20><>װ<EFBFBD><D7B0><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>
cNode.Text:=mygoods.packagingcode;
cNode := mNode.AddChild('packaging'); //* <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>
cNode.Text:=mygoods.packaging;
cNode := mNode.AddChild('cargoid'); //* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(GC/RF/DR)
cNode.Text:=mygoods.cargoid;
cNode := mNode.AddChild('hscode'); //<2F><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>
cNode.Text:=mygoods.hscode;
cNode := mNode.AddChild('description'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>Ļ<EFBFBD><C4BB><EFBFBD>)
if Trim(mygoods.description)='' then
begin
dNode := cNode.AddChild('text');
end
else
begin
sl:=TStringList.Create;
sl.Text:=SeparateEC(mygoods.description);
for i:=0 to sl.Count-1 do
begin
dNode := cNode.AddChild('text');
dNode.Text:=sl[i];
end;
sl.Free;
end;
cNode := mNode.AddChild('cdescription'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD>)
Wlength:= Length(mygoods.description);
Elength:= Length(SeparateEC(mygoods.description));
if Trim(Copy(mygoods.description,Elength,WLength-Elength-1) )=''
then
begin
dNode := cNode.AddChild('text');
end
else
begin
sl:=TStringList.Create;
sl.Text:=Copy(mygoods.description,Elength,WLength-Elength-1);
for i:=0 to sl.Count-1 do
begin
dNode := cNode.AddChild('text');
dNode.Text:=sl[i];
end;
sl.Free;
end;
cNode := mNode.AddChild('grossweight'); //* ë<><C3AB>
cNode.Text:= mygoods.grossweight;
cNode := mNode.AddChild('cbm'); //* <20><><EFBFBD><EFBFBD>
cNode.Text:= mygoods.cbm;
cNode := mNode.AddChild('specialgoods'); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
dNode := cNode.AddChild('text');
dNode.Text := mygoods.specialgoods;
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ӽڵ<D3BD> dr
mNode := pNode.AddChild('dr');
GetNBEDIdr(mydr);
cNode := mNode.AddChild('CLASS');
cNode.Text := mydr.ediCLASS;
cNode := mNode.AddChild('PAGE');
cNode.Text := mydr.PAGE;
cNode := mNode.AddChild('UNDGNO');
cNode.Text := mydr.UNDGNO;
cNode := mNode.AddChild('TECNAME');
cNode.Text := mydr.TECNAME;
cNode := mNode.AddChild('PACKGROUP');
cNode.Text := mydr.PACKGROUP ;
cNode := mNode.AddChild('LABEL');
dNode := cNode.AddChild('text');
dNode.Text := mydr.ediLABEL;
cNode := mNode.AddChild('FLASHPOINT');
cNode.Text := mydr.FLASHPOINT;
cNode := mNode.AddChild('FLASHUNIT');
cNode.Text := mydr.FLASHUNIT;
cNode := mNode.AddChild('EMSNO');
cNode.Text := mydr.EMSNO;
cNode := mNode.AddChild('MFAGNO');
cNode.Text := mydr.MFAGNO;
cNode := mNode.AddChild('MPT');
cNode.Text := mydr.MPT;
cNode := mNode.AddChild('Elinkman');
cNode.Text := mydr.Elinkman;
cNode := mNode.AddChild('DANGEROUS');
dNode := cNode.AddChild('text');
dNode.Text := mydr.DANGEROUS;
cNode := mNode.AddChild('TEMPERATURE');
cNode.Text := mydr.TEMPERATURE;
cNode := mNode.AddChild('TEMPERATUREUNIT');
cNode.Text := mydr.TEMPERATUREUNIT;
cNode := mNode.AddChild('MINTEMPERATURE');
cNode.Text := mydr.MINTEMPERATURE;
cNode := mNode.AddChild('MAXTEMPERATURE');
cNode.Text := mydr.MAXTEMPERATURE;
cNode := mNode.AddChild('ALLCOLDTORAGE');
cNode.Text := mydr.ALLCOLDTORAGE;
cNode := mNode.AddChild('VENTI');
cNode.Text := mydr.VENTI;
cNode := mNode.AddChild('REEFER');
dNode := cNode.AddChild('text');
dNode.Text := mydr.REEFER;
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ӽڵ<D3BD> loadplan
mNode := pNode.AddChild('loadplan');
GetNBEDIloadplan(myloadolan);
cNode := mNode.AddChild('entryno');
cNode.Text := myloadolan.entryno;
cNode := mNode.AddChild('warehouse');
cNode.Text := myloadolan.warehouse;
cNode := mNode.AddChild('landcarrier');
cNode.Text := myloadolan.landcarrier;
cNode := mNode.AddChild('stuffdate');
// cNode.Text := myloadolan.stf
cNode := mNode.AddChild('stuffmode');
cNode.Text := myloadolan.stuffmode;
cNode := mNode.AddChild('stuffaddress');
cNode.Text := myloadolan.stuffaddress;
cNode := mNode.AddChild('stuffmemo');
cNode.Text := myloadolan.stuffmemo;
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ӽڵ<D3BD> announce
mNode := pNode.AddChild('announce');
GetNBEDIannounce(myNBEDIannounce);
sl:=TStringList.Create;
sl.Text:=myNBEDIannounce.announce;
for i:=0 to sl.Count-1 do
begin
cNode := mNode.AddChild('text');
cNode.Text:=sl[i];
end;
sl.Free;
//<2F><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>ӽڵ<D3BD> remarks
mNode := pNode.AddChild('remarks');
//<2F><>Ʒ<EFBFBD><C6B7> ֻҪ<D6BB><D2AA><EFBFBD><EFBFBD>VGM<47><4D><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD>
if xmltype <>2 then
begin
GetNBEDIgoodsdetail(goodscount);
for i:=0 to goodscount-1 do
begin
mNode := pNode.AddChild('goodsdetail');
cNode := mNode.AddChild('cargosequenceno');
cNode.Text:=MyNBEDIgoodsdetail[i].cargosequenceno;
cNode := mNode.AddChild('marksandnumbers');
dNode := cNode.AddChild('text');
dNode.Text:=MyNBEDIgoodsdetail[i].marksandnumbers;
cNode := mNode.AddChild('noofpkgs');
cNode.Text:=MyNBEDIgoodsdetail[i].noofpkgs;
cNode := mNode.AddChild('packagingcode');
cNode.Text:=MyNBEDIgoodsdetail[i].packagingcode;
cNode := mNode.AddChild('packaging');
cNode.Text:=MyNBEDIgoodsdetail[i].packaging;
cNode := mNode.AddChild('cargoid');
cNode.Text:=MyNBEDIgoodsdetail[i].cargoid;
cNode := mNode.AddChild('hscode');
cNode.Text:=MyNBEDIgoodsdetail[i].hscode;
cNode := mNode.AddChild('description');
dNode := cNode.AddChild('text');
dNode.Text:=MyNBEDIgoodsdetail[i].description;
cNode := mNode.AddChild('cdescription');
dNode := cNode.AddChild('text');
dNode.Text:=MyNBEDIgoodsdetail[i].cdescription;
cNode := mNode.AddChild('grossweight');
cNode.Text:=MyNBEDIgoodsdetail[i].grossweight;
cNode := mNode.AddChild('cbm');
cNode.Text:=MyNBEDIgoodsdetail[i].cbm;
cNode := mNode.AddChild('specialgoods');
dNode := cNode.AddChild('text');
dNode.Text:=MyNBEDIgoodsdetail[i].specialgoods;
// <20><>ʤ<EFBFBD><CAA4>û<EFBFBD>м<EFBFBD>dr<64><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//dNode := cNode.AddChild('dr');
//eNode := dNode.AddChild('CLASS') ;
//ֻ<>д<EFBFBD>˾<EFBFBD><EFBFBD><E1B5A5>
if xmltype=3 then
begin
cNode := mNode.AddChild('container');
for k:=0 to goods_ctn_count[i]-1 do
begin
dNode := cNode.AddChild('containers') ;
eNode := dNode.AddChild('containertype');
eNode.Text := MyNBEDIgoodsdetail_containers[i,k].containertype;
eNode := dNode.AddChild('containerno');
eNode.Text := MyNBEDIgoodsdetail_containers[i,k].containerno;
eNode := dNode.AddChild('sealno');
eNode.Text := MyNBEDIgoodsdetail_containers[i,k].sealno;
eNode := dNode.AddChild('containernoofpkgs');
eNode.Text := MyNBEDIgoodsdetail_containers[i,k].containernoofpkgs;
eNode := dNode.AddChild('containergrossweight');
eNode.Text := MyNBEDIgoodsdetail_containers[i,k].containergrossweight;
eNode := dNode.AddChild('containercbm');
eNode.Text := MyNBEDIgoodsdetail_containers[i,k].containercbm;
end;
end;
end;
end;
end;
function TFrm_op_seae_edi_NB.GetNBEDIloadplan(var MyNBEDIloadplan : NBEDIloadplan):Boolean;
begin
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIgoodsdetail(var goodscount :Integer):Boolean;
var
aQuery,bQuery,cQuery:TADOQuery;
SQLStr:string;
i,k:Integer;
begin
Result:=False;
aQuery:=CreateAdoQuery;
bQuery:=CreateAdoQuery;
cQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with bQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
if HDTD.Checked[0] then
begin
SQLStr:='select sum(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD> ,SUM(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,SUM(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,AS_ID,<2C><>ͷ,<2C><><EFBFBD><EFBFBD>,<2C><>װ,<2C><><EFBFBD><EFBFBD> from t_op_ctn_fendan '
+' where AS_ID='+QuotedStr(bQuery.fieldbyname('AS_ID').AsString)+' group by AS_ID,<2C><>ͷ,<2C><><EFBFBD><EFBFBD>,<2C><>װ,<2C><><EFBFBD><EFBFBD> ' ;
end
else
begin
SQLStr:='select sum(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD> ,SUM(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,SUM(<28><><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><>ͷ,<2C><><EFBFBD><EFBFBD>,<2C><>װ,<2C><><EFBFBD><EFBFBD> from t_op_ctn '
+' WHERE <20><><EFBFBD><EFBFBD>='+QuotedStr(bQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString) +' group by <20><><EFBFBD><EFBFBD>,<2C><>ͷ,<2C><><EFBFBD><EFBFBD>,<2C><>װ,<2C><><EFBFBD><EFBFBD>' ;
end;
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
goodscount:=aQuery.recordcount;
if goodscount=0 then
begin
// HasM:=True;
// ShowMessage('û<>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>');
Exit;
end;
aQuery.First;
for i:=0 to goodscount-1 do
begin
MyNBEDIgoodsdetail[i].cargosequenceno:=IntToStr(i+1);
MyNBEDIgoodsdetail[i].marksandnumbers:=aQuery.fieldbyname('<27><>ͷ').AsString;
MyNBEDIgoodsdetail[i].noofpkgs:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoodsdetail[i].packagingcode:=Trim(GetPackVGM(aQuery.fieldbyname('<27><>װ').AsString));
MyNBEDIgoodsdetail[i].packaging:=aQuery.fieldbyname('<27><>װ').AsString;
MyNBEDIgoodsdetail[i].cargoid:=goodstype;
MyNBEDIgoodsdetail[i].grossweight:=aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoodsdetail[i].cbm:= aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
if HDTD.Checked[0] then
begin
SQLStr:='select a.*,b.EDI<44><49><EFBFBD><EFBFBD> from t_op_ctn_fendan a INNER JOIN t_code_ctn b ON a.<2E><><EFBFBD><EFBFBD> = b.<2E><><EFBFBD><EFBFBD> where a.AS_ID='
+QuotedStr(aQuery.fieldbyname('AS_ID').AsString)+' and a.<2E><><EFBFBD><EFBFBD>='+QuotedStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
end
else
begin
SQLStr:='select a.*,b.EDI<44><49><EFBFBD><EFBFBD> from t_op_ctn a INNER JOIN t_code_ctn b ON a.<2E><><EFBFBD><EFBFBD> = b.<2E><><EFBFBD><EFBFBD> where a.<2E><><EFBFBD><EFBFBD>='
+QuotedStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)+' and a.<2E><><EFBFBD><EFBFBD>='+QuotedStr(aQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
end;
with cQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
goods_ctn_count[i]:=cQuery.RecordCount;
cQuery.First;
for k:=0 to cQuery.RecordCount-1 do
begin
MyNBEDIgoodsdetail_containers[i,k].containertype:=GetCntrVGM(cQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
MyNBEDIgoodsdetail_containers[i,k].containerno:=cQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoodsdetail_containers[i,k].sealno:=cQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoodsdetail_containers[i,k].containernoofpkgs:=cQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoodsdetail_containers[i,k].containergrossweight:=cQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
MyNBEDIgoodsdetail_containers[i,k].containercbm:=cQuery.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString;
cQuery.Next;
end;
aQuery.Next;
end;
FreeAndNil(aQuery);
FreeAndNil(bQuery);
FreeAndNil(cQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.GetNBEDIannounce(var myNBEDIannounce :NBEDIannounce):Boolean;
var
aQuery:TADOQuery;
SQLStr:string;
begin
Result:=False;
aQuery:=CreateAdoQuery;
if HDTD.Checked[0] then SQLStr:='select * from t_op_seae_assistant where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)
else SQLStr:='select * from t_op_seae where <20><><EFBFBD><EFBFBD>='+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString);
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add(SQLStr);
Open;
end;
if HDTD.Checked[0] then myNBEDIannounce.announce:='' else
myNBEDIannounce.announce:=aQuery.fieldbyname('<27><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>˵<EFBFBD><CBB5>').AsString;
FreeAndNil(aQuery);
Result:=True;
end;
function TFrm_op_seae_edi_NB.CheckParaExist(para:string):Boolean;
begin
Result:=False;
if Trim(para)<>'' then Result:=True;
end;
function TFrm_op_seae_edi_NB.GetEmailVGM(cntrsize: String):String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+cntrsize+'''');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
//<2F><>ȡʱ<C8A1><CAB1><EFBFBD><EFBFBD> java<76><61><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Ǵ<EFBFBD>1970<37><30>1<EFBFBD><31>1<EFBFBD><31>0<EFBFBD><EFBFBD><E3B5BD>ǰ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
function GetJavaTime( d: TDateTime ): Int64;
var
dJavaStart: TDateTime;
begin
dJavaStart := EncodeDateTime( 1970, 1, 1, 0, 0, 0, 0 );
Result := MilliSecondsBetween( d, dJavaStart );
end;
//<2F><>ȡXML<4D>ļ<EFBFBD><C4BC>ڵ<EFBFBD><DAB5><EFBFBD>Ϣ <20><><EFBFBD><EFBFBD><EFBFBD>κλس<CEBB><D8B3><EFBFBD><EFBFBD><EFBFBD>
function ReadXml(node: IXMLNode): string;
var
nodeList,attrList: IXMLNodeList;
str,strName,strValue: string;
i: Integer;
begin
Result := '';
if not node.HasChildNodes then Exit;
attrList := node.AttributeNodes; {<7B><><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>嵥}
nodeList := node.ChildNodes; {<7B><><EFBFBD>ڵ<EFBFBD><DAB5>µ<EFBFBD><C2B5>ӽڵ<D3BD><DAB5>б<EFBFBD>}
str := '<' + node.NodeName;
//<2F>ȶ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
for i := 0 to attrList.Count - 1 do
begin
strName := attrList[i].NodeName;
strValue := attrList[i].NodeValue;
str := str + ' ' + strName + '=' + AnsiQuotedStr(strValue, '"');
end;
str := str + '>';// + sLineBreak; {sLineBreak <20>dz<EFBFBD><C7B3><EFBFBD>, <20><EFBFBD><E0B5B1> #13#10 <20>˴<EFBFBD><CBB4><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD>վ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>}
//<2F><>ȡ<EFBFBD>ӽڵ<D3BD>
for i := 0 to nodeList.Count - 1 do
begin
strName := nodeList[i].NodeName;
if nodeList[i].IsTextElement then
begin
strValue := nodeList[i].NodeValue;
str := str + '<' + strName + '>' + strValue + '</' + strName + '>' ;//+ sLineBreak; //<2F>˴<EFBFBD><CBB4><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD>վ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
end else if nodeList[i].HasChildNodes then
begin
str := str + ReadXml(nodeList[i]); {<7B>ݹ<EFBFBD>}
str := str + '</' + strName + '>' ;//+ sLineBreak; {<7B><><EFBFBD><EFBFBD>} //<2F>˴<EFBFBD><CBB4><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD>վ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
end;
end;
str := str + '</' + node.NodeName + '>'; {<7B><><EFBFBD><EFBFBD>}
Result := str;
end;
function TFrm_op_seae_edi_NB.CheckSendorCode:Boolean;
begin
{ Result:=False;
with t_sys_company do
begin
Close;
SQL.Clear;
SQL.Add('select top 1 * from t_sys_company ');
Open;
end;
if Trim(Edit1.Text)=Trim(t_sys_company.fieldbyname('VGM<47><4D><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>').AsString) then Result:=True;
}
end;
function TFrm_op_seae_edi_NB.IsZhongwen(Str: String): Boolean;
var
i:Integer;
begin
Result:=false;
if Str='' then Exit;
for i:=1 to Length(Str) do begin
if (Str[i]>Chr(127)) or (Str[i]=Chr(9)) then begin
Result:=True;
Exit;
end;
end;
end;
function TFrm_op_seae_edi_NB.SeparateEC(Str: String): string;
var
i:Integer;
begin
if Str='' then Exit;
for i:=1 to Length(Str) do
begin
if (Str[i]<=Chr(127)) then Result:=Result+Str[i] else Break;
end;
end;
function TFrm_op_seae_edi_NB.GetShipVGM(Ship:String): String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add(' Select <20><><EFBFBD><EFBFBD>,VGM<47><4D><EFBFBD><EFBFBD>,FTP<54><50><EFBFBD>մ<EFBFBD><D5B4><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><C2BC><EFBFBD><EFBFBD><><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_crm_client ');
SQL.Add(' where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>''Ŀ<><C4BF>'' and <20><><EFBFBD><EFBFBD>˾=1 and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Ship+'''');
SQL.Add(' order by <20><><EFBFBD><EFBFBD> ');
Open;
if not IsEmpty then
Result:=Trim(FieldByName('VGM<47><4D><EFBFBD><EFBFBD>').asstring)
else
Result:='';
end;
finally
FreeAndNil(aQuery);
end;
end;
function TFrm_op_seae_edi_NB.GetShipFTP(Ship:String): String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD>,VGM<47><4D><EFBFBD><EFBFBD>,FTP<54><50><EFBFBD>մ<EFBFBD><D5B4><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><C2BC><EFBFBD><EFBFBD><><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_crm_client');
SQL.Add('where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><>''Ŀ<><C4BF>'' and <20><><EFBFBD><EFBFBD>˾=1 and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Ship+'''');
SQL.Add('order by <20><><EFBFBD><EFBFBD>');
Open;
if not IsEmpty then
Result:=Trim(FieldByName('FTP<54><50><EFBFBD>մ<EFBFBD><D5B4><EFBFBD>').asstring)
else
Result:='';
end;
finally
FreeAndNil(aQuery);
end;
end;
function TFrm_op_seae_edi_NB.Changestr(str:widestring):string;
var
i:integer;
strC:widestring;
begin
strC:=str;
strC:=StringReplace(strC,'''''','&quot;',[rfReplaceAll]);
strC:=StringReplace(strC,'''','&apos;',[rfReplaceAll]);
strC:=StringReplace(strC,'&','&amp;',[rfReplaceAll]);
strC:=StringReplace(strC,'>','&gt;',[rfReplaceAll]);
strC:=StringReplace(strC,'<','&lt;',[rfReplaceAll]);
result:=strC;
end;
function TFrm_op_seae_edi_NB.GetCntrVGM(cntrsize: String):String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select VGM<47><4D><EFBFBD><EFBFBD> from t_code_ctn where <20><><EFBFBD><EFBFBD>='''+cntrsize+'''');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('VGM<47><4D><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function TFrm_op_seae_edi_NB.GetPackVGM(cntrsize: String):String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select EDI<44><49><EFBFBD><EFBFBD> from t_code_package where <20><><EFBFBD><EFBFBD>='''+cntrsize+'''');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('EDI<44><49><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function TFrm_op_seae_edi_NB.GetDepartmentVGM(cntrsize: String):String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select VGM<47><4D><EFBFBD><EFBFBD> from t_code_subcomp where <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>=(select <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+cntrsize+''')');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('VGM<47><4D><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function TFrm_op_seae_edi_NB.GetECodeVGM(cntrsize: String):String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20><><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+cntrsize+'''');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function TFrm_op_seae_edi_NB.GetTelVGM(cntrsize: String):String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select <20>̶<EFBFBD><CCB6>绰 from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+cntrsize+'''');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('<27>̶<EFBFBD><CCB6>绰').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function TFrm_op_seae_edi_NB.GetCompany:String;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select top 1 <20><><EFBFBD><EFBFBD> from t_sys_company ');
Open;
if IsEmpty then
Result:=''
else
Result:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
function TFrm_op_seae_edi_NB.GetClient(str:string):TStringList;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
Result:=TStringList.Create;
with aQuery do
begin
Close;SQL.Clear;
SQL.Add('Select top 1 <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>,VGM<47><4D><EFBFBD><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+QuotedStr(str));
Open;
Result.Add(FieldByName('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').AsString);
Result.Add(FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString);
Result.Add(FieldByName('VGM<47><4D><EFBFBD><EFBFBD>').AsString);
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure TFrm_op_seae_edi_NB.bsSkinButton3Click(Sender: TObject);
begin
close;
end;
procedure TFrm_op_seae_edi_NB.FormShow(Sender: TObject);
var
ini:TIniFile;
begin
if frm_op_seae.t_op_seae.IsEmpty then
begin
ShowMessage('û<><C3BB><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>EDI<44><49><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC>飡');
Exit;
end;
ini:= Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
CheckBox1.checked:=False;
label2.visible:=False;
edit1.visible:=false;
Edit1.Text:=ini.ReadString('COSCO','Sale','');
ini.Free;
idsmtp1.Username:='admin@dongshengsoft.com'; //<2F><><EFBFBD>õ<EFBFBD>½<EFBFBD>ʺ<EFBFBD>
idsmtp1.Password:='ds!@#)(*';// <20><><EFBFBD>õ<EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD>
idsmtp1.Host:='smtpcom.263xmail.com';// <20><><EFBFBD><EFBFBD>SMTP<54><50>ַ
idsmtp1.Port :=25;
if idsmtp1.Connected = False then
begin
try
idsmtp1.Connect;
except
Exit; // <20><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7> <20>Ļ<EFBFBD> <20>˳<EFBFBD><CBB3><EFBFBD>ִ<EFBFBD>й<EFBFBD><D0B9><EFBFBD>
end;
end;
end;
procedure TFrm_op_seae_edi_NB.bsSkinButton1Click(Sender: TObject);
begin
SendFile;
end;
procedure TFrm_op_seae_edi_NB.bsSkinButton2Click(Sender: TObject);
begin
HasM:=False;
MakeVGM(BWTYPE.ItemIndex);
if HasM then Exit;
if SaveDialog1.Execute then
begin
XMLDocument1.SaveToFile(SaveDialog1.FileName+'.XML');
XMLDocument1.Active:=False;
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>');
end
else
begin
showmessage('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
exit;
end;
end;
procedure TFrm_op_seae_edi_NB.sendmail;
begin
with IdMessage1 do
begin
Body.Clear; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴη<CFB4><CEB7>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
CharSet :='GB2312'; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD>
Subject :='<27><><EFBFBD><EFBFBD><EBB7A2>VGM-<2D><><EFBFBD><EFBFBD><E1B5A5>: '+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString+' '+GetCustCode(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').AsString); // <20><><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>͵ı<CDB5><C4B1><EFBFBD>
Body.Text := '<27><>˾<EFBFBD><CBBE><EFBFBD>ƣ<EFBFBD>'+GetCompany+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>'+employee+#13#10+'<27><><EFBFBD><EFBFBD>:'+#13#10
+'<27><EFBFBD><E7BBB0>'+GetTelVGM(employee)+#13#10+'<27><><EFBFBD><EFBFBD>ţ<EFBFBD>'+frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString; //<2F><><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
From.Address := 'admin@dongshengsoft.com'; //<2F><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD>
Recipients.EMailAddresses :='dongshengsoft@dongshengsoft.com'; //<2F><><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD>
TIdAttachmentFile.Create(MessageParts,RequestFile);
end;
try
idsmtp1.Send(IdMessage1);
except
end;
end;
function FormatEncodeDate(s:string):string;
begin
Result:=StringReplace(s,' ','+',[rfreplaceall]);
Result:=StringReplace(Result,':','%3a',[rfreplaceall]);
end;
function URLEncode(const S: string; const InQueryString: Boolean): string;
var
Idx: Integer;
begin
Result := '';
for Idx := 1 to Length(S) do
begin
case S[Idx] of
'A'..'Z', 'a'..'z', '0'..'9', '-', '_', '.':
Result := Result + S[Idx];
' ':
if InQueryString then
Result := Result + '+'
else
Result := Result + '%20';
else
Result := Result + '%' + SysUtils.IntToHex(Ord(S[Idx]), 2);
end;
end;
end;
procedure TFrm_op_seae_edi_NB.SendFile;
var
s1,s2,s: string;
IdHttp : TIdHTTP;
Url : string;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
ResponseStream : TStringStream;
ResponseStr: string;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
RequestStr : string;
RequestStream : TStringStream;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Realdate:TDateTime;
Requestdate,RequestOrg,RequestSign:string;
RequestContent,RequestDateSTamp:string;
aQuery:TADOQuery;
begin
HasM:=false;
//<2F>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޱ<EFBFBD><DEB1><EFBFBD><EFBFBD>ŵķ<C5B5><C4B7>ͼ<EFBFBD>¼
aQuery:=TADOQuery.Create(nil);
aQuery.Connection:=frm_main.db;
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('select * from t_op_state where ҵ<><D2B5>״̬='+QuotedStr(BWTYPE.Items[BWTYPE.ItemIndex]+'<27>ѷ<EFBFBD><D1B7><EFBFBD>')+' and <20><><EFBFBD><EFBFBD>='+quotedstr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)+' order by ˳<><CBB3>');
Open;
end;
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> û<>е<EFBFBD>NO<4E><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ں<EFBFBD><DABA><EFBFBD>ͳɹ<CDB3><C9B9>ټ<EFBFBD><D9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD> t_op_state<74><65><EFBFBD><EFBFBD>
if aQuery.RecordCount>0 then
begin
if application.MessageBox(pchar('<27>Ѿ<EFBFBD><D1BE>б<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>'+BWTYPE.Items[BWTYPE.ItemIndex]+'<27><><EFBFBD>ͼ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>ʾ',mb_yesno)=idno then
begin
FreeAndNil(aQuery);
Exit;
end;
end;
MakeVGM(BWTYPE.ItemIndex);
//<2F>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>
if HasM then Exit;
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
IdHttp := TIdHTTP.Create(nil);
idhttp.Request.ContentType:='application/x-www-form-urlencoded';
//TStringStream<61><6D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>Ϣ
ResponseStream := TStringStream.Create('');
RequestStream := TStringStream.Create('');
Realdate:=Now;
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Requestdate:=FormatDateTime('yyyy-mm-dd hh:mm:ss',Realdate);
RequestDateSTamp:=FormatEncodeDate(Requestdate);
RequestOrg:='dssoft' + 'ced93003-1577-4ff4-9fcf-73a52408eb36' + Requestdate;
RequestSign:=UpperCase(MD5Print(MD5String(RequestOrg)));
RequestContent:=URLEncode(EncodeString(XMLDocument1.XML.GetText),False);
RequestFile:=IntToStr(GetJavaTime(Realdate))+'.XML';
XMLDocument1.SaveToFile(RequestFile);
try
Url := 'http://api.nbeport.com/router/rest' ;
try
//<2F><><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD>ʽ<EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD>
RequestStr:='user_id=dssoft&format=json&timestamp='+RequestDateSTamp+'&sign='+RequestSign
+'&method=cargoedi.demessage.msgrec.post&deaId='+t_sys_company.fieldbyname('VGM<47><4D><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>').AsString
+'&userId=dssoft&docName='+RequestFile+'&docType='+filetype+'&docLength='+IntToStr(Length(RequestContent))
+'&docContent='+RequestContent+'&channel=WSTOM&destDeaId='+ GetShipVGM(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>˾').AsString)
+'&port=CNTAO';
RequestStream.WriteString(RequestStr);
IdHttp.Post(Url,RequestStream,ResponseStream);
except
on e : Exception do
begin
ShowMessage(e.Message);
end;
end;
//<2F><>ȡ<EFBFBD><C8A1>ҳ<EFBFBD><D2B3><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>Ϣ
ResponseStr := ResponseStream.DataString;
//<2F><>ҳ<EFBFBD>еĴ<D0B5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>UTF8<46><38><EFBFBD><EFBFBD>
ResponseStr := UTF8Decode(ResponseStr);
//<2F><><EFBFBD>ͳɹ<CDB3><C9B9><EFBFBD>t_op_state<74><65><EFBFBD><EFBFBD><EFBFBD>Ӽ<EFBFBD>¼
if (Pos('T',ResponseStr)>0) then
begin
if WJGN.ItemIndex=0 then s:='<27><><EFBFBD><EFBFBD>';
if WJGN.ItemIndex=1 then s:='<27>޸<EFBFBD>';
if WJGN.ItemIndex=2 then s:='ȡ<><C8A1>';
with aQuery do
begin
Close;
SQL.Clear;
SQL.Add('insert into t_op_state (<28><><EFBFBD><EFBFBD><><D2B5>״̬,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><C2BC><EFBFBD><EFBFBD>,<2C><>ע,ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>) values ('
+QuotedStr(frm_op_seae.t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>').AsString)+','+QuotedStr(BWTYPE.Items[BWTYPE.ItemIndex]+'<27>ѷ<EFBFBD><D1B7><EFBFBD>')+',1,'
+QuotedStr(FormatDateTime('yyyy-mm-dd hh:mm:ss',Now))+','+QuotedStr(FormatDateTime('yyyy-mm-dd hh:mm:ss',Now))+','
+QuotedStr(employee)+','+QuotedStr(employee)+','+QuotedStr(s)+',1)');
ExecSQL;
end;
FreeAndNil(aQuery);
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ʼ<EFBFBD>
if BWTYPE.ItemIndex=2 then
sendmail;
//ShowMessage(ResponseStr);
ShowMessage('<27><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>') ;
end
else ShowMessage('<27>ύʧ<E1BDBB>ܣ<EFBFBD>'); //ShowMessage(ResponseStr);//
DeleteFile(RequestFile);
finally
IdHttp.Free;
RequestStream.Free;
ResponseStream.Free;
end;
end;
procedure TFrm_op_seae_edi_NB.CheckBox1Click(Sender: TObject);
var
ini:TIniFile;
begin
ini:= Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
if CheckBox1.Checked then
begin
Label2.Visible:=True;
Edit1.Visible:=True;
Edit1.Text:=ini.ReadString('COSCO','Sale','');
end
else
begin
Label2.Visible:=False;
Edit1.Visible:=False;
ini.WriteString('COSCO','Sale',Edit1.Text);
end;
ini.Free;
end;
procedure TFrm_op_seae_edi_NB.FormClose(Sender: TObject;
var Action: TCloseAction);
var
ini:TIniFile;
begin
if Trim(Edit1.Text)<>'' then
begin
ini:= Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
ini.WriteString('COSCO','Sale',Edit1.Text);
ini.Free;
end;
end;
function TFrm_op_seae_edi_NB.GetCustCode(CorpID: string): string;
var
i:integer;
aQuery:TADOQuery;
begin
Result:=CorpID;
aQuery:=createADOQuery;
with aQuery do
try
Close;SQL.Clear;
SQL.Add('select <20><><EFBFBD><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+CorpID+'''');
Open;
Result:=fieldByName('<27><><EFBFBD><EFBFBD>').AsString
finally
FreeAndNil(aQuery);
end;
end;
end.