- OOS- ãã¹ãŠãã·ã¢ã®å ¬åŒãŠã§ããµã€ãïŒ æ¿åºèª¿é ïŒã
- èšäºãç解ããããã«å¿ èŠãªç¥èïŒ VBAïŒMS ExcelïŒã
ã¯ããã«
åŒçšïŒ
ãååãäœåããµãŒãã¹ã®äŸçµŠã«é¢ãã泚æã«é¢ããæ å ±ãæäŸããããã®ã€ã³ã¿ãŒãããäžã®ãã·ã¢é£éŠã®å ¬åŒãŠã§ããµã€ãã¯ãååãäœåã®èª¿éããã³èª¿éã®åéã«ãããå¥çŽã·ã¹ãã ã«é¢ããå®å šãã€ä¿¡é Œã§ããæ å ±ãžã®ç¡æããã³ç¡æã¢ã¯ã»ã¹ãæäŸããããšãç®çãšããŠããŸãããµãŒãã¹ãç¹å®ã®çš®é¡ã®æ³äººãããã³ãã®ãããªæ å ±ã®åœ¢æãåŠçãä¿åã®ããã«ãã
å€ãã®åæ¥ããã³ãã®ä»ã®äŒæ¥ã«ãšã£ãŠããå ¬å ±èª¿éãã·ã¹ãã ã¯ãåœå®¶ïŒäºç®ïŒã®è³éãçµæžæŽ»åã«åŒãå¯ããäž»ãªæ¹æ³ã§ãã å·ã®åå äŒæ¥ïŒããã³ãã®ä»ã®åã ã®çš®é¡ã®äŒæ¥ïŒãïŒé£éŠæ³ç¬¬223ã94ã44é ã«åŸã£ãŠïŒå¿ ãå®æœããååããµãŒãã¹ãç 究掻åã®èª¿éã«é¢ããæ å ±ã¯ãæ¿åºèª¿éWebãµã€ãã«æ²èŒãããŠããŸãã å¶å©äŒæ¥ã¯ãå ¬å ±èª¿éã®å ¬åŒãŠã§ããµã€ãã«å ¥æãå ¬éããããšããããããŸãã
äžèšã®æ³åŸãžã®ãªã³ã¯ãCoâânsultantPlus Webãµã€ãã®æ å ±ïŒ
- 2005幎7æ21æ¥ã®é£éŠæ³N94-ïŒ2013幎7æ2æ¥ä¿®æ£ïŒãå·ããã³å°æ¹èªæ²»äœã®ããŒãºã«å¯Ÿããååã®äŸçµŠãäœæ¥ã®éè¡ãããã³ãµãŒãã¹ã®æäŸã®çºæ³šã«ã€ããŠã
- 2011幎7æ18æ¥ã®é£éŠæ³N223-ïŒ2014幎3æ12æ¥ä¿®æ£ã2014幎12æ29æ¥ä¿®æ£ïŒãç¹å®ã®çš®é¡ã®æ³äººã«ããç©åãäœåããµãŒãã¹ã®èª¿éãïŒä¿®æ£ããã³è¿œå ã 2015幎1æ1æ¥ããã®åïŒ
- é£éŠæ³2013幎5æ5æ¥ä»N44-ïŒ2015幎3æ8æ¥ä¿®æ£ïŒãå·ããã³å°æ¹èªæ²»äœã®ããŒãºãæºããããã®ç©åãå·¥äºããµãŒãã¹ã®èª¿éåéã«ãããå¥çŽã·ã¹ãã ã«ã€ããŠã
ãããã£ãŠãå ¬å ±èª¿éãŠã§ããµã€ãã«å ¬éãããå ¥æã«é¢ããæ å ±ã¯ãã»ãã¥ãªãã£ãµãŒãã¹ããå°çç©çåŠèª¿æ»ãŸã§ãããŸããŸãªæŽ»ååéã®å€ãã®äŒæ¥ã®ãããã¡ã€ã«ããšã®å¯èœãªãç¶æ ã泚æã«é¢ããé¢é£æ å ±ã®äžå¿çãªæ å ±æºã§ãã ãããã£ãŠãç¹å®ã®åºæºã«è©²åœããç¶ç¶äžã®å ¥æã«é¢ããæ å ±ãå®æçã«æŽæ°ããå¿ èŠæ§ã¯ãå ¬å ±èª¿éã«åå ããåçµç¹ããçããŸãã ãã®èšäºã§ã¯ãããŸããŸãªæ¹æ³ãšããã®ããŒãºã®å®è£ ã®å®éçãªäŸãæ€èšããŸãã
å ¬å ±èª¿éæ å ±ãååŸããããã®ãªãã·ã§ã³
ã»ãšãã©ã®å Žåãã¿ã¹ã¯ã¯äŒç€Ÿã®ããŒã±ãã£ã³ã°éšéãŸãã¯ITéšéã®åã®çµå¶é£ã«ãã£ãŠã ã次ã®åºæºãæºããå ¬å ±èª¿é競äºã®æ¥æ¬¡èŠçŽãå¿ èŠã§ãããšããèšèã§èšå®ãããŸã ã å ¥ææžé¡ã®çºè¡ãããã®ç³è«ã®çµäºãŸã§ã®éã«ãå¹³åã§çŽ2é±éã§ãã10æ¥éæªæºã®æéã宣èšãããããšããããããããã¯æ¯æ¥ã§ãã 競äºã«åå ããããã«å¿ èŠãªãã¹ãŠã®ææžãåéããæéã¯ããŸããããŸãããæ¯æ¥ããéèŠãã§ãã
ã¿ã¹ã¯ãå®è£ ããããã®ãªãã·ã§ã³ããªã¹ãããŸãã
1. OOS Webãµã€ãïŒå ¬å ±èª¿éïŒ
ãµã€ãèªäœhttp://zakupki.gov.ru/ã¯ããã©ã¡ãŒã¿ãŒã«ããã³ã³ãã¹ãã®æ€çŽ¢ãšéžæãã«ã¹ã¿ãã€ãºããæ©èœãæäŸããŸãã
çæïŒ
- æ€çŽ¢ãæ£ããæ©èœãããã³ã³ãã¹ãããèŠã€ãããªããããšããããŸãã ç§ã¯å ¬åŒãŠã§ããµã€ããéããŠæ£ç¢ºã«é·ã奎é·ã®èšŒäººã§ãã声æã確èªããŸããã
- å€ãã®å Žåããã®ãµã€ãã¯å€éãäŒæ¥ã«ã¯æ©èœããŸããã
- çµæã®æ°ã®å¶éã æ€çŽ¢çµæã500è¡ãè¶ ããå Žåããµã€ãã®ãªãœãŒã¹ã䜿çšããŠãã³ã³ãã¹ãã«é¢ããããŒã¿ãïŒ.csv圢åŒã®è¡šåœ¢åŒã§ïŒããŠã³ããŒãããããšã¯ã§ããŸããã
ããã»ã¹ãéšåçã«èªååããããã«ãFireFoxãã©ãŠã¶ãŒçšã®ãã©ã°ã€ã³ãäœæããŸãããããã¯ãéžæããã³ã³ãã¹ãã®æ¯æ¥ã®ããŠã³ããŒããè¡ãããšã«ãªã£ãŠããŸãã
äžèšã§èšãã°ããã©ã°ã€ã³ã¯æ¬¡ã®ãããªåœ¢åŒã§ã¢ãã¬ã¹ãçæããŸããã
"http://zakupki.gov.ru/epz/order/extendedsearch/search.html?" + "placeOfSearch=FZ_44" + "&orderPriceFrom=" + priceArray[i] + "&orderPriceTo=" + (priceArray[i+1]-1) + "&orderPriceCurrencyId=-1" + "&orderPublishDateFrom=" + OrderDate + "&orderPublishDateTo=" + OrderDate + "&headAgencyWithSubElements=true&matchingWordPlace44=NOTIFICATIONS" + "&law44.okpd.withSubElements=trueâ + "&law44.okpd.ids=31301%2C37097%2C50876%2C51122" + "&law44.advantages[MP44]=I&law44.advantages[UG44]=I" + "&law44.advantages[IN44]=I&law44.advantages[MPSP44]=I" + "&morphology=false&strictEqual=false";
åœç¶ãæ³åŸã®94ãš223ã§ã¯ãèŠæ±ãã©ã¡ãŒã¿ãŒãç°ãªããŸãã ã芧ã®ãšãããOKPDãäŸ¡æ Œåž¯ãªã©ã ããããªããšãèŠã€ãã£ãã³ã³ãã¹ãã®æ°ãå€ãããŠãæ€çŽ¢çµæãéšåçã«ããããŠã³ããŒãã§ããªãããããªã¯ãšã¹ãã«ãçž«ãä»ãããå¿ èŠããããŸãã
2.å°éã®ãŠã§ã-競äºæ€çŽ¢ãµãŒãã¹
åžå Žã®èŠæ±ã«å¿ããŠãããã€ãã®äŒæ¥ãé²è¡äžã®ç«¶äºã«é¢ããæ å ±ã®æ€çŽ¢ãµã€ããç·šæããŸããã å€ãã®å Žåããããããµã€ãã¯ãå ¬å ±èª¿éã«é¢ããæ å ±ã ãã§ãªããé»åãµã€ãããã®ããã©ã€ããŒããå ¥æã«é¢ããæ å ±ãæäŸããŸãã
ããã€ãã®ãã®ãããªã·ã¹ãã ïŒ
- Multitender.ru ïŒãæ¿åºèª¿éãšåæ¥å ¥æã远跡ã§ããç¡æã®å°çšæ€çŽ¢ãšã³ãžã³ãã
- TenderCAT ïŒãTenderCATã«ã¿ãã°ã¯ããã¹ãŠã®å°åããã³æŽ»åå°åã®æ¿åºèª¿éããŒã¿ã«ïŒhttp://zakupki.gov.ruïŒã§æ¯æ¥å ¬éããã倧éã®æ³šæã§ãå·ããã³åæ¥å ¥æããã³ãªãŒã¯ã·ã§ã³ã®æ€çŽ¢ã容æã«ããããã«èšèšãããŠããŸããã
- æ±äºç® ïŒãå ¬å ±èª¿éãšå ¥æã®ãŠã§ããµã€ã-æ±äºç®ããã®æé«ã®æ€çŽ¢ãšåæãã
- 360ãè³Œå ¥ãã
ãã®ä»ã
Habré ã«é¢ããèšäºããã£ã åœã®æ¯åºã«ã€ããŠã¯å¥ã«èšåããŸãã
ãã®èšäºã®ç®çã¯ããããã®ãªãœãŒã¹ãæ¯èŒãŸãã¯åæããããšã§ã¯ãªããããããã§ã¯ãªãœãŒã¹ã®å©ç¹ãæ¬ ç¹ã瀺ããŸããã
3.ã³ã³ãã¹ããããŠã³ããŒãããããã®èªå·±éçºã
ããã€ãã®ã±ãŒã¹ã§ã¯ãå ¥æã«åå ããŠããäŒç€Ÿã®çµå¶è ã¯ãæ å ±ã®éžæãæ€çŽ¢ã®èŠåæ§ãæ€çŽ¢çµæã®ãã¶ã€ã³ãªã©ã®ãã©ã¡ãŒã¿ã«é¢ããŠéåžžã«å ·äœçãªã¿ã¹ã¯ã課ããŠããŸãã ãã®ãããªå Žåã圌ãã¯ITå°é家ã«é Œããã³ã³ãã¹ãã®ç£èŠãšéžæã«é¢ãããæäœæ¥ãã¯æéãããããããŸãã
説æãããäœåãããªãŒã©ã³ãµãŒã«æ³šæããäŸããããŸãã ããšãã°ã SQL.ru ã Weblancerãªã© ã æåŸã«ããå®çžŸã®ããã ã¢ãŒãã£ã¹ãããã¿ãŒã³ããŒãœãªã¥ãŒã·ã§ã³ãè³Œå ¥ã§ããŸãã ãã ãããã®èšäºã®äž»èŠéšåã§ã¯ãã¿ã¹ã¯ãç¬ç«ããŠå®è¡ããæé ã«ã€ããŠèª¬æããŸãã
Excel VBAããŒã«ã䜿çšããŠhttp://zakupki.gov.ruãã競äºããŒã¿ãããŠã³ããŒããã
ãœãŒã¹ããŒã¿
ããŒã¿ãœãŒã¹ã«é¢ããäž»ãªå¿ èŠç¥èïŒ OOSïŒå ¬å ±èª¿éã®ããã®ãã¹ãŠãã·ã¢ã®å ¬åŒWebãµã€ãïŒã«ã¯ãå ¬éftpãµãŒããŒããããŸã ã åæã«ããã¡ã³ããã³ã¹ãã®ããã«httpãå®æçã«ïŒéåžžã¯å€éããã³äŒæ¥ã«ïŒå©çšã§ããªãå Žåãftpã¯ïŒç§ã®æ £ç¿ã«åŸã£ãŠïŒç¢ºå®ã«æ©èœããŸãã
ftpãµãŒããŒã®ã¢ãã¬ã¹ã¯ãå ¥æã«é©çšãããé£éŠæ³ã«åŸã£ãŠåå²ãããŸãã
é£éŠæ³ç¬¬223ïŒ ftp : //ftp.zakupki.gov.ru/out/
ãŠãŒã¶ãŒåãšãã¹ã¯ãŒãïŒ
fz223free
é£éŠæ³No. 94ããã³é£éŠæ³No. 44ïŒ ftp : //zakupki.gov.ru
ãŠãŒã¶ãŒåãšãã¹ã¯ãŒãïŒ
ç¡æ
223ã®æ³åŸã®ãã£ã¬ã¯ããªæ§é ã¯å®å šã«ééçã§ãã 94ããã³44ã«ã€ããŠã¯ã次ã®ãµããã£ã¬ã¯ããªãããã«ãããŸãã
- 94FZ ïŒãã®ä»ã®ã«ã¿ãã°-44FZïŒã«åºã¥ãå ¬éã¢ããããŒãã®ããŒã¿ãå«ã94fzã«ã¿ãã°ã
- 94FZã«åŸã£ãŠç°å¢ä¿è·ã·ã¹ãã ã§å ¬éãããæ å ±ã®å®å šãªå°åã¢ããããŒãã«é¢ããããŒã¿ãå«ãfcs_regionsãã£ã¬ã¯ããªã
ã«ã¿ãã°ã®æ®ãã®éšåã«ã¯ãèŠå¶ããã³åç §æ å ±ãéè¡ä¿èšŒã«é¢ããæ å ±ãèŠåã«åŸã£ãŠã®ã¢ã³ããŒããããã³åé¡è§£æ±ºã®äžç°ãšããŠã®é¢å¿ã¯ãããŸããã
ããã«ãå°åã§å ¬éãããŠããããã¥ã¡ã³ãã«é¢ããæ å ±ãå šãã·ã¢ã®å ¬åŒãµã€ãã®FTPãµãŒããŒã«ã¢ããããŒãããæé ã«é¢ãã説æããã®å¿ èŠãªæç²ãåŒçšç¬Šã®ã»ããïŒ
å®å šãªå°åã®ã¢ã³ããŒãã«ã¯ãOOSã§å ¬éãããŠãã次ã®ã¿ã€ãã®ãã¹ãŠã®ããã¥ã¡ã³ããå«ãŸããŸãã
â¢éç¥ã®çºè¡ã
â¢éç¥ã«å¯Ÿããå€æŽã®å ¬éã
â¢å ¬éããããããã³ã«ã
â¢å ¬éãããå¥çŽæ å ±ã
â¢å¥çŽå€æŽã®å ¬éã
â¢å¥çŽã®å±¥è¡/çµäºã«é¢ããæ å ±ãå ¬éããŸããã
ç§ãã¡ã®ç®çã§ã¯ãéç¥ã®ã¿ãéèŠã§ããããšã«æ³šæããŠãã ããã ä»ã®ãã¹ãŠã®çš®é¡ã®ããã¥ã¡ã³ãã¯ãã¿ã¹ã¯ã®äžéšãšããŠäœ¿çšãããŸããïŒ
ã¢ã³ããŒãã¯ãXML圢åŒã®ã¢ãŒã«ã€ããã¡ã€ã«ã§å®è¡ãããŸãã
1ã€ã®ãã¡ã€ã«ã«ã¯ã3,000ãšã³ããªãè¶ ããªãéã§ã1ã€ã®ã¿ã€ãã®ããã¥ã¡ã³ãã®ã¿ãå«ããããšãã§ããŸãã ã¢ããããŒãããããã¥ã¡ã³ãã®æ°ã3,000ãšã³ããªãè¶ ããå Žåãã·ã¹ãã ã¯è€æ°ã®ãã¡ã€ã«ãçæãããããããåå¥ã®ã¢ãŒã«ã€ãã«å ¥ããŸãã
çæããã³ã¢ãŒã«ã€ãããããã¹ãŠã®XMLãã¡ã€ã«ã¯FTPãµãŒããŒã«ã¢ããããŒããããŸã...ã¢ããããŒãå ã®ãã¡ã€ã«ã¯ãå°åã«å¯Ÿå¿ãããã£ã¬ã¯ããªã«åå²ãããŸãã é åã®åãã£ã¬ã¯ããªã«ã¯ãéç¥ããããã³ã«ãå¥çŽã®3ã€ã®ãã£ã¬ã¯ããªããããŸãã éç¥ããããã³ã«ãããã³å¥çŽã®åãã£ã¬ã¯ããªã«ã¯ãæ¯æ¥ã®ãã£ã¬ã¯ããªããããŸãã
å ¬éãããããã¥ã¡ã³ãã¯ã次ã®é åºã§FTPãµãŒããŒã«ã¢ããããŒããããŸãã
ã» åæŠæ¥ïŒæ¯æ¥ïŒã¯ãåã®æŠæ¥ã«çºè¡ãããããã¥ã¡ã³ãã®ãªã¹ããã¢ããããŒãããŸãã åæã«...å°åããšã®éç¥ã®ã¢ããããŒãã¯ã<å°åå> /éç¥/æ¯æ¥ã§è¡ãããŸãã
ã» åæŠæïŒæ¯æïŒã¯ãåã®æŠæã«çºè¡ãããããã¥ã¡ã³ãã®ãªã¹ããã¢ããããŒãããŸãã åæã«...å°åããšã®éç¥ã®ã¢ããããŒãã¯ã<å°åå> /éç¥ãã£ã¬ã¯ããªã§è¡ãããŸãã
æ¯æ¥ããã³æ¯æã®ããŠã³ããŒãã§ã¯ãéå»ã®æŠæ¥ãŸãã¯æŠæã«ããããçºè¡ããããã¹ãŠã®çš®é¡ã®ããã¥ã¡ã³ããåžžã«ã¢ã³ããŒããããŸãã
éå»ã®æéã«ã¢ããããŒããäœæããæç¹ã§ãã©ã®ã¿ã€ãã®å ¬éããã¥ã¡ã³ãã1ã€ããªãã£ãå Žåããã®ã¿ã€ãã®ããã¥ã¡ã³ããå«ãXMLãã¡ã€ã«ã¯ç©ºã§ã¢ã³ããŒããããŸãã
æ¯æã®ã¢ããããŒããå®äºãããšãéå»1ãæéã®æ¯æ¥ã®ã¢ããããŒãã®ãã£ã¬ã¯ããªãã¯ãªã¢ãããŸãã
å°åã¢ããããŒããã¡ã€ã«åã®æ§é ã¯æ¬¡ã®ãšããã§ãã
<document view_region_start_period_end_period_number.xml.zip>ã
ããã§ïŒ
â¢ããã¥ã¡ã³ããã¥ãŒ-éç¥ããããã³ã«ãããã³å¥çŽæ å ±ã®å€éç¥ããããã³ã«ããŸãã¯å¥çŽãããããåãåããŸãã
â¢region-ã¢ã³ããŒãé åã®ååã
â¢start-period-yyyyddmm_hhmmss圢åŒã®ã¢ããããŒããããããã¥ã¡ã³ãã®å ¬éæ¥æã«ããããã¥ã¡ã³ãéžææéã®éå§æ¥ãããã§ãyyyy-幎ãmm-æïŒæ°å€ïŒãdd-æ¥ãhh-æéãmm-åãss-ç§ã
â¢end-period-yyyyddmm_hhmmss圢åŒã®ã¢ããããŒããããããã¥ã¡ã³ãã®å ¬éæ¥ã«åŸã£ãŠããã¥ã¡ã³ããéžæããæéã®çµäºæ¥ãããã§ãyyyy-幎ãmm-æïŒæ°å€ïŒãdd-æ¥ãhh-æéãmm-åãss-ç§ã
â¢number-çæããããã¡ã€ã«ã®ã·ãªã¢ã«çªå·ã
äžèšã®æ å ±ã®çŸåšã®ããŒãžã§ã³ã¯ãããã¥ã¡ã³ããInformation Exchange Schemes ...ãã®åœ¢åŒã§OOSããããŠã³ããŒãã§ããŸãã
競åæ å ±ã®èªåããŠã³ããŒãçšããã°ã©ã ã®èª¬æïŒVBA MS ExcelãWindowsïŒã
æºåãã
- Microsoft Scripting Runtimeã®ã¹ã¯ãªãããæ¥ç¶ããŸãã FSOæ©èœã®å ŽåïŒ \ Windows \ System32 \ scrrun.dll ïŒ
- Microsoft XML v.6ã®ã¹ã¯ãªãããæ¥ç¶ããŸã
ã³ã³ãã¹ããããŠã³ããŒãããæ¥ä»ç¯å²ãèŠæ±ããããã«ã MonthViewèŠçŽ ã䜿çšããŠuserFormãäœæããŸããã ãã®èšå®ã«ããã2ãæ䞊ã¹ãŠïŒç¯å²ã1ãæ以å ã§ãããšä»®å®ïŒãçŸåšã®æ¥ä»ïŒèµ€ãããã¯ã¹ïŒã衚瀺ããããã©ã«ãã§éžæããæ¥ä»ç¯å²ãèšå®ã§ããŸãã
äŸãšããŠã2æ26æ¥ãã3æ4æ¥ãŸã§ã®ç¯å²ãéžæãããŠããŸãã éžæããæ¥ä»ã¯ããã©ãŒã ã®ããããã£ããèªã¿åãããŸãã
MonthView.SelStart MonthView.SelEnd
ãã®ãã£ã«ã¿ãŒã䜿çšãããšãç¹å®ã®æ¥ä»ç¯å²å ã®ãã¡ã€ã«ïŒæ¢ç¥ã®ååã®æ§é ïŒãéžæã§ããŸãã
fltr = "*_" & Format(targetDate, "yyyymmdd") & "*" & Format(targetDate + 1, "yyyymmdd") & "*.zip;" & "*_" & Format(targetDate, "yyyymmdd") & "*" & Format(targetDate, "yyyymmdd") & "*.zip"
ããã§ã¯ã»ãã³ãã³ã代æ¿ãªãã·ã§ã³ãåé¢ããŠãããããæå®ããããã£ã«ã¿ãŒã¯3ã€ã®ãã¹ãŠã®æ³åã«ãã£ãŠçæããããã¡ã€ã«ã«é©ããŠããããšã«æ³šæããŠãã ããã
æå®ãããã£ã¬ã¯ããªã«ãã¡ã€ã«ãããŠã³ããŒãããFSOã¡ãœããã䜿çšããŠå€ãããŠã³ããŒãããã¯ãªãŒã³ã¢ããããŸãã
Dim FSO As FileSystemObject Set FSO = New FileSystemObject
次ã«ãã¿ãŒã²ãããã©ã«ããŒbFld = FSO.GetFolderïŒ...ïŒãéžæãããµããã£ã¬ã¯ããªãç Žæ£ããŸãã
For Each SubFolder In bFld.SubFolders SubFolder.Delete Next
ããã°ã©ã ã®äœ¿çšã¯å®å šã«ãªãã·ã§ã³ã§ããããšãå€æããŸããããéåžžã«æåããŸããã
é·ãæé ã®é²è¡ã芳å¯ããªãããšã䟿å©ã§ãããããªãèªèº«ã®ããžãã¹ãããŠããéã次ã®ãããªã¡ãã»ãŒãžãïŒå¿å°ãã女æ§ã®å£°ã§ïŒå®æçã«èããŸããApplication.Speech.Speak
Application.Speech.Speak "Downloading purchase notices", True
2çªç®ã®ãã©ã¡ãŒã¿ãŒã¯éåæå®è¡ã§ãã
ãã¡ã€ã«ãããŠã³ããŒããã
ããŠã³ããŒããéå§ããŸãã ã䜿çšããŠå®å ãã©ã«ããååšããããšã確èªããŠãã ãã
å¿ èŠã«å¿ããŠã MkDiré¢æ°ã䜿çšããŠäœæããŸããFSO.FolderExists
ã·ã§ã«ãªããžã§ã¯ããäœæãã
Set myShell = CreateObject("Shell.Application")
ãããŠã説æãããã¢ãããŒãã®äž»ãªãæ©èœã- åå空éã¡ãœãããé©çšããŸã ã
Set ftpItems = myShell.Namespace(FTP).Items
æå®ãããè¡ã¯FTPã®åŒã³åºããå®è£ ãããã©ã«ããŒãšãã¡ã€ã«ãè¿ããŸãã æž¡ããããã©ã¡ãŒã¿ãŒã¯Stringã§ã¯ãªãVariantåã§ããå¿ èŠãããããšã«æ³šæããŠãã ããã
ãã¹ãŠã®ãã£ã¬ã¯ããªã次ã®ããã«éžæã§ããŸãã
ftpItems.Filter 32, "*".
ãµããã£ã¬ã¯ããªãšãã¡ã€ã«ïŒ 96 = 32 + 64 ïŒãéžæãã段èœã®æåã«äœæããããããªãã£ã«ã¿ãŒãé©çšããŠãæ¥ä»ã§ãã¡ã€ã«ãéžæããŸã-次ã®ããã«ïŒ
ftpItems.Filter 96, fltr.
åãæ¹æ³ã§ããŠã³ããŒãããã¿ãŒã²ããïŒããŒã«ã«ïŒãã©ã«ããŒãæå®ããããšã¯æ®ããŸãã
set tFolder = myShell.Namespace(tgtFolder)
ãããŠã次ã®ããã«ãã³ããŒããéå§ããŸãïŒãããŠã³ããŒããã§ããããŸãïŒã
tFolder.CopyHere ftpItems, 20
ãã®ã³ãã³ãã¯å€éšããã»ã¹ãéå§ãïŒWindowsã¯ãã¡ã€ã«ãã³ããŒããããã®æšæºããã°ã¬ã¹ããŒã衚瀺ããŸãïŒãvbaããã®å®è¡ã¯çŽæ¥å¶åŸ¡ãããŸããã ãã ããå®äºãããŸã§åŸ æ©ããå¿ èŠããããŸãããã®ãããã«ãŒãã§æ¬¡ã®ã¡ãœããã䜿çšããŠãã³ããŒãããæåŸã®ãã¡ã€ã«ã®ååšã確èªããŸãã
While Len(Dir$(tgtFolder & "\" & ftpItems.Item(ftpItems.Count - 1).Name)) = 0 Sleep 1: DoEvents Wend
ãã®ããã«é 眮ããããåŸ æ©ãã¯ããã¡ã€ã«ãã³ããŒãããéãç¶ç¶ããŸãã
ããŠã³ããŒããããã¡ã€ã«ã®è§£åïŒè§£åïŒ
ãã¹ãŠã®ãã£ã¬ã¯ããªãšãµããã£ã¬ã¯ããªãééãããã¹ãŠã®ãã£ã«ã¿ãªã³ã°ããããã¡ã€ã«ãããŠã³ããŒãããåŸãããŒã«ã«ãã·ã³ã§ã®åŠçã«é²ã¿ãŸãã
Application.Speech.Speak "Unzipping archives", True.
ãããè¡ãã«ã¯ãåã³åå空éã¡ãœããã䜿çšããŸã ã
ãã©ã«ããŒå ã®ãã¹ãŠã®ã¢ãŒã«ã€ãããœãŒãããŸã
For Each fl In tFolderItems
Windowsã®ãããã®ã¢ãŒã«ã€ãããµããã£ã¬ã¯ããªãšããŠè¡šç€ºããããšããäºå®ã掻çšããŠãã ããïŒ ãããã£ãŠãã¢ãŒã«ã€ãã®ã³ã³ãã³ãå šäœã¯æ¬¡ã®ããã«å©çšã§ããŸãã
Set flItems = myShell.Namespace(CVar(tgtFolder & "\" & fl.Name)).Items
ïŒç¹°ãè¿ããŸããããã©ã¡ãŒã¿ãŒãVariantã§ãªããã°ãªããªãããšã«æ³šæããŠãã ãããããããæååããã®åå€æãå¿ èŠãªçç±ã§ãïŒã
ãŸããåãCopyHereã³ãã³ãã䜿çšãããšãã¢ãŒã«ã€ããããã¹ãŠã®ãã¡ã€ã«ãã¿ãŒã²ãããã©ã«ããŒã«ãã³ããŒãïŒå®éã«æœåºïŒã§ããŸãã
myShell.Namespace(tgtFolder).CopyHere flItems, 20
ãŸããéåæå®è¡ã§ã¯ãäžèšãšåãæ¹æ³ã§ããã®ã³ãã³ãã®å®äºãã«ãŒãã§åŸ æ©ãããŸãã
解åããããã¡ã€ã«ã®äžã«ã¯ãå€ãã®ããŽããããããŸãã ããšãã°ãç¹å®ã®å°åã§ç¹å®ã®æ¥ã«è³Œå ¥ããªãã£ãå ŽåãOOSã¯ãã®æ¥ä»ã®ç©ºã®ãã¡ã€ã«ãçæããŸãã ãããã£ãŠãxmlã解æããåã«ãäœåãªéšåãåé€ããããšã奜ã¿ãŸãã FSOã䜿çšããŠãã¡ã€ã«ãå埩åŠçãã
Set fold = FSO.GetFolder(tgtFolder) For Each fl In fold.Files
ãã¹ã¯ãªãŒãã³ã°ãã¯ããã¡ã€ã«ã®ãµã€ãºïŒfl.Size <= 198ïŒãšãã®ååNotïŒLCaseïŒfl.NameïŒLike "* noti *"ïŒïŒã®ãã£ã«ã¿ãªã³ã°ã«ãã£ãŠç°¡åã«å®è¡ãããŸãã
ãã¡ã€ã«ã®åé€ã¯éåžžã«ç°¡åã§ãïŒ fl.Delete
競åããŒã¿ã䜿çšããXMLã®ãã³ãŒã
xmlã®ãã³ãŒãã¯ãOOSã§å€æŽãããå Žåãããã¹ããŒã ã«äŸåããŸãã ãã®ãããåã ã®ãã£ãŒã«ããšããŒã¿ã«çŠç¹ãåœãŠãªãåºæ¬çãªææ³ã¯æ¬¡ã®ãšããã§ãã ãã¡ãããç§ãã¡ã¯
Application.Speech.Speak "Decoding files", True.
ãã®ããŒãã§ã¯ãFSOã«å ããŠããã¡ã€ã«ãæäœããããã«XMLãå¿ èŠã«ãªããŸãã
Dim xml As MSXML2.DOMDocument60 Set xml = New DOMDocument60: xml.async = False: xml.validateOnParse = True
ãããŠããã¡ãããExcelããã¯ã®ã¿ãŒã²ããã·ãŒãïŒ ActiveSheet ïŒã«æ å ±ãæžã蟌ã¿ãŸãã
ã¡ãã€ãã®ãªãããã«ãã°ããExcelã¬ã³ããªã³ã°ãåæ¢ããããšããå§ããŸãããã
Application.ScreenUpdating = False
åºæ¬çãªãã€ã³ãã¯
ãXPathã¯ç©ºã®ãã¬ãã£ãã¯ã¹ãnullåå空éãšããŠæ±ããŸãã ã€ãŸããããŒã ã¹ããŒã¹ã«ãããã³ã°ããããã¬ãã£ãã¯ã¹ã®ã¿ãXPathã¯ãšãªã§äœ¿çšã§ããŸãã ã€ãŸããXMLããã¥ã¡ã³ãã§åå空éã®ã¯ãšãªãäœæããå¿ èŠãããå Žåããããæ¢å®ã®åå空éã§ãã£ãŠãããã®ãã¬ãã£ãã¯ã¹ãå®çŸ©ããå¿ èŠããããŸãããããã£ãŠãããã©ã«ãã®ããŒã ã¹ããŒã¹ã®ããŠã³ããŒããããããã¥ã¡ã³ãã®ãã£ãŒã«ããæ£åžžã«è§£æããããã«ãç¹å®ã®ãã¬ãã£ãã¯ã¹ãè¿œå ããŸãã ããšãã°ããqãïŒ
xml.setProperty "SelectionNamespaces", " xmlns:q= 'http://zakupki.gov.ru/oos/export/1' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:oos='http://zakupki.gov.ru/oos/types/1'"
ããã¯ãé£éŠæ³94ã§äœæãããxmlã解æããããã®åå空éå®çŸ©ã®å€èŠ³ã§ãã 44ã§ã¯ãå°ãç°ãªããŸãã
xml.setProperty "SelectionNamespaces", "xmlns:q='http://zakupki.gov.ru/oos/types/1' xmlns:ns2='http://zakupki.gov.ru/oos/export/1' xmlns:ns3='http://zakupki.gov.ru/oos/printform/1'"
å®éã«ã¯ãæå®ããããã¹ãŠã®ããŒã¿ã¯ããŠã³ããŒããããxmlãã¡ã€ã«ã®ããããŒããååŸãããããã©ã«ãã§ã¯åå空éã«qã®ã¿ãè¿œå ãããŸãã
次ã«ãããŠã³ããŒãããå¿ èŠããããã£ãŒã«ãïŒããæ£ç¢ºã«ã¯ãããããæãxpath ïŒã決å®ãããŸãã çŸåšã94é£éŠæ³ã§ã¯ãã.// oos ïŒ notificationNumberããã.// oos ïŒ lotããã.// oos ïŒ orderNameããã.// oos ïŒ maxPriceãã®ããã«ãªã£ãŠããŸãã 44ã®é£éŠæ³ã«ã¯ãå¥ã®æ§é ããããŸãïŒOOSããã°ã©ãã®ãããã§ãïŒïŒã.//q:purchaseNumberããã.//q:lotããã.//q:purchaseObjectInfoããã.//q:maxPrice|.// qïŒäŸ¡æ Œ| .// qïŒtotalSum " ã
確å®æ§ã¯ãªãããšãããããŸããå ¬éãããã¹ããŒã ã ãã§ãªããããŒã¿ã解èªããå®éã®çµéšã«åºã¥ããŠè§£æãæ§æããå¿ èŠããããŸãã
xmlãã¡ã€ã«ãäºéæ¡ä»¶ã§ãèªã¿åãå¯èœããã©ããã確èªããŸãã
If Not xml.Load(tgtFolder & "\" & fl.Name) thenâŠIf (xml.parseError.ErrorCode <> 0) thenâŠ
ãã¡ã€ã«ãèªã¿èŸŒãŸããå ŽåïŒãããŸã§ã®ãšãããOOSããããŠã³ããŒããããã¡ã€ã«ã«åé¡ã¯ãããŸããã§ããïŒãå®éã«ãã®å 容ã解æã§ããŸãã ãŸããã¡ãã»ãŒãžã®æ§æïŒ notice ïŒã説æãããã£ãŒã«ããèªãããšããå§ãããŸãã
purchaseType = LCase(xml.DocumentElement.ChildNodes(0).BaseName) documentType = LCase(xml.DocumentElement.BaseName)
ãããŠããã¡ã€ã«ã®å 容ãããã®ãã£ã³ã»ã«ããããã³ã«ã®å ¬éã®éç¥ãªã©ã§ã¯ãªãããŸãã«ç«¶åã®çºè¡šã§ããããšã確èªããŸãã ãã®ãããªãã®ïŒ
If Not (purchaseType Like "*cancel*" Or purchaseType Like "*protocol*" Or documentType Like "*cancel*") Then
223é£éŠæ³ã«ãã£ãŠçæãããxmlã§ã¯ãããã¥ã¡ã³ãã¿ã€ãã®ååã¯ãé衚瀺ãã§ããããã以äžãè¿œå ã§ããŸãã
If (purchaseType Like "*notification*" Or documentType Like "*notice*") Then
次ã¯ãxmlããã·ãŒãã»ã«ãžã®å®éã®ããŒã¿ã®æžã蟌ã¿ã§ãã
Range("A" & i) = xml.DocumentElement.SelectSingleNode(XPath).Text
ç
XPathãããã€ãã®ãªãã·ã§ã³ïŒããšãã°ããããã®ååã瀺ãïŒãæäŸã§ããããããã¹ãŠãä¿æãããå Žåããã®æ§æã圹ç«ã¡ãŸãã
For Each it In lot.SelectNodes(XPath) Range("E" & i) = Range("E" & i) & it.Text & "; " Next
ææžå ã®äžéšã®ãã£ãŒã«ããæ¬ èœããŠããå¯èœæ§ããããããæ¡ä»¶ã«ãã£ãŠããããçç¥ããŸãã
If Not xml.DocumentElement.SelectSingleNode(XPath) Is Nothing Then
ãããã«
ftpã䜿çšãããã¡ã€ã«ã®ããŠã³ããŒãã¯ãããŸããŸãªæ¹æ³ã§å®è£ ã§ããŸãã åäœããéåžžã«ç°¡åã«å®è£ ã§ããshell.namespaceã䜿çšããŠèª¬æããŸããã
ããŠã³ããŒãããã³ã³ãã¹ãã®ãªã¹ããèªåçã«ã©ã³ã¯ä»ãïŒéžæïŒãããã©ãŒããããããšãæ¯æ¥ã®ã³ã³ãã¹ãã®éžæïŒãã¹ãŠã®é£éŠæ³ïŒã¯æ¬¡ã®ããã«ãªããŸãã
äžèšã®ã¢ãããŒãã«ãããå ¥æãå¥çŽã調éèšç»ãªã©ã«é¢ããããŒã¿ãããŠã³ããŒãã§ããŸãã OOSã§ã¯ããããã®æ å ±ã¯ãã¹ãŠãªãŒãã³ftpã§å ¬éãããããã§ãã ããã°ã©ã ã®ãã¹ãŠã®ã³ãŒããæäŸããããã§ã¯ãªãããç¥ç財ç£ãã§ããããããããæäŸããããšã¯ã§ããŸããã ãã ãã vbaã®åºæ¬ãç¥ã£ãŠããŠãããã«éèŠãªããšã«ãå¿èåããããšãã³ãŒãã®æå®ãããéèŠãªã»ã¯ã·ã§ã³ããããã°ã©ã ã埩å ã§ããŸãã
第äžã«ãftpã§ãã¡ã€ã«ãšãµããã£ã¬ã¯ããªã解æãããšããå¿èãå¿ èŠã§ãïŒããŠã³ããŒãããããŠã¯ãªãããæ£ãããã®ãèŠéããªãã§ãã ããã 次ã«ãxmlã解æãããšãã ãã ããã©ã®ãã£ãŒã«ããã©ã®é åºãã©ã®ããã«ãã©ãŒããããããŠãããã顧客ãèŠãããšãã課é¡ã«ã€ããŠã¯ãã§ã«çåããããŸãã
çãããžã®å¹žéãšåå©ïŒ-競æäŒã§-ãããŠå人çãªãã®ïŒ