{"id":398056,"date":"2024-06-29T13:50:34","date_gmt":"2024-06-29T13:50:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=398056"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=398056","title":{"rendered":"<span>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439 \u043a \u043e\u0431\u043c\u0435\u043d\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432 \u042d\u0414\u041e \u0414\u0438\u0430\u0434\u043e\u043a \u043f\u043e API<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u0435\u0434\u043f\u043e\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>\u0424\u041d\u0421 \u0432 2020 \u0433\u043e\u0434\u0443 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043e\u0431\u043e\u0440\u043e\u0442\u0430 \u0441 \u043a\u043e\u043d\u0442\u0440\u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438 \u0432 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0439 \u0432\u0438\u0434. \u0412 \u0438\u044e\u043b\u0435 2021 \u0433\u043e\u0434\u0430 \u043e\u0431\u043c\u0435\u043d \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u043c\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0441\u0447\u0435\u0442\u0430\u043c\u0438-\u0444\u0430\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u043f\u043e \u0437\u0430\u043a\u0443\u043f\u043a\u0435 \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0443\u0436\u0435 \u0441\u0442\u0430\u043b \u0431\u0435\u0437\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u043c. <\/p>\n<p>\u0412 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u0445 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0435\u0439, \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432, \u0444\u0438\u043b\u0438\u0430\u043b\u043e\u0432, \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u042d\u0414\u041e: \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c, \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432, \u043a\u043e\u043d\u0442\u0440\u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (\u043e\u043d\u0438 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f) \u0438 \u0441\u0430\u043c \u043f\u043e\u0442\u043e\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0438\u0445 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0410 \u0442\u0430\u043a\u0436\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u042d\u0414\u041e: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0438 \u0441\u0432\u0435\u0440\u0438\u0442\u044c \u0441 \u043e\u043f\u043b\u0430\u0442\u0430\u043c\u0438, \u0437\u0430\u044f\u0432\u043a\u0430\u043c\u0438, \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430\u043c\u0438; \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a; \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043b\u043d\u043e\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u042d\u0414\u041e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 1\u0421, SAP \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 ERP. \u041a\u043e\u0440\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u0438\u0445 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0443. \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 &#8212; \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u043e API, \u0437\u0430 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0434\u0435\u043d\u044c\u0433\u0438.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API<\/h2>\n<p>\u0414\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043d\u0442\u0440\u0430\u0433\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f\u043c\u0438. \u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u043c\u0443 \u044e\u0440.\u043b\u0438\u0446\u0443 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0418\u041d\u041d-\u041a\u041f\u041f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043e\u0442 \u043b\u044e\u0431\u044b\u0445 \u044e\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u0438\u0446. \u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043e\u043f.\u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430 \u043e\u0431 \u042d\u0414\u041e \u043c\u0435\u0436\u0434\u0443 \u043b\u0438\u0446\u0430\u043c\u0438, \u043d\u0435 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u043e\u0432\u044b\u0445 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u0443 \u0441\u0442\u043e\u0440\u043e\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c. \u041d\u043e \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u043c\u0438, \u0441 \u043a\u0435\u043c \u0435\u0441\u0442\u044c \u043d\u0435\u0440\u0430\u0441\u0442\u043e\u0440\u0433\u043d\u0443\u0442\u044b\u0439 \u0434\u043e\u0433\u043e\u0432\u043e\u0440 \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0432\u0435\u0434\u0443\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u043a\u0438, \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u043d\u0435 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0445.<\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0438\u0436\u0435 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0443 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430, \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b. \u041a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#8212; \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043b\u0438\u0446\u0430\u043c, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f (\u0431\u0438\u0437\u043d\u0435\u0441\u0443, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443), \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0422\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0441\u0442\u0430\u0434\u0438\u0438 &#171;\u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442&#187; (MVP).<\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b: Python, PyCharm Community Edition, SQL Server Express Edition, SSMS, \u043a\u043b\u044e\u0447 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 API (\u043a\u0443\u043f\u0438\u0442\u044c\/\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u042d\u0414\u041e), \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 API \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u042d\u0414\u041e. \u0412\u0441\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0435, \u043a\u0440\u043e\u043c\u0435 \u043a\u043b\u044e\u0447\u0430 API.<\/p>\n<p>\u041e\u0431\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c: <\/p>\n<ol>\n<li>\n<p>Python: \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u0430\u0431\u0438\u043d\u0435\u0442 \u0432\u0430\u0448\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 (\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432 \u0446\u0438\u043a\u043b\u0435), \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f, \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/p>\n<\/li>\n<li>\n<p>SQL server: \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u043e\u0431\u043e\u0440\u043e\u0442\u043e\u0432 (\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c  \u0434\u043e\u043f.\u0444\u0438\u043b\u044c\u0442\u0440\u044b &#8212; \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u044b, \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0445) \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0418\u041d\u041d, \u0441\u0442\u0440\u043e\u0438\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0418\u041d\u041d \u0441 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u043e\u0431\u043e\u0440\u043e\u0442\u0430\u043c\u0438 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0435\u0440\u0438\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>Python: \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0418\u041d\u041d, \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u0430\u0431\u0438\u043d\u0435\u0442 \u042d\u0414\u041e, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f, \u0437\u0430\u043d\u043e\u0441\u0438\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f\u0445. \u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e (\u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435) &#8212; \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043a\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u0434\u0430\u0447 Windows: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0443\u044e \u0442\u0440\u0438 \u043f\u0443\u043d\u043a\u0442\u0430 \u0432\u044b\u0448\u0435, \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/d1b\/a69\/834\/d1ba6983435ea919d5cebdfecbefac9b.jpg\" width=\"306\" height=\"245\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d1b\/a69\/834\/d1ba6983435ea919d5cebdfecbefac9b.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<pre><code class=\"sql\">CREATE TABLE [dbo].[tbl_organizations]( [OrgGUID] [char](36) NULL, [OrgID] [char](36) NULL, [Inn] [char](12) NULL, [Kpp] [char](9) NULL, [Full_name] [nvarchar](max) NULL, [Short_name] [nvarchar](max) NULL, [BoxID] [varchar](100) NULL, [BoxGUID] [char](36) NULL, [Box_title] [nvarchar](max) NULL, [Invoice_format_ver] [char](20) NULL, [Ogrn] [char](15) NULL, [FNS_participant] [char](50) NULL ) ON [PRIMARY] GO  CREATE TABLE [dbo].[tbl_departments]( [DepartmentID] [char](36) NULL, [Parent_dept_ID] [char](36) NULL, [Dept_name] [nvarchar](max) NULL, [Dept_abbr] [nvarchar](50) NULL, [OrgID] [char](36) NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO  CREATE TABLE [dbo].[tbl_invitations]( [Short_name] [nvarchar](255) NULL, [OrgID_our] [char](36) NULL, [Inn] [char](12) NULL, [OrgID] [char](36) NULL ) ON [PRIMARY] GO  CREATE TABLE [dbo].[tbl_invitations_accepted]( [OrgId] [char](36) NULL, [Record_date] [date] NULL, [Inn] [char](12) NULL, [OrgId_our] [char](36) NULL ) ON [PRIMARY] GO<\/code><\/pre>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 tbl_departments \u0432 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (view) \u0441 \u043e\u0431\u043e\u0440\u043e\u0442\u0430\u043c\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0418\u041d\u041d \u0438\u043b\u0438 \u0418\u041d\u041d-\u041a\u041f\u041f, \u0438\u043b\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b &#8212; \u0432\u044b\u0432\u043e\u0434 \u0432 \u044d\u043a\u0441\u0435\u043b\u044c \u0438\u0437 1\u0421 \u0438\u043b\u0438 SAP \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 bcp, \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u043c \u0432 SSMS \u0438\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. <\/p>\n<p>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0431\u0435\u0437 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041c\u0435\u0442\u043e\u0434\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u042d\u0414\u041e.<\/p>\n<pre><code class=\"python\">import pprint import requests import json import pyodbc import datetime import sys  #\u0437\u0430\u0432\u043e\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u0444\u0430\u0439\u043b f_name = r'C:\\Temp\\log_' + datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S') + '.txt' stdoutOrigin = sys.stdout sys.stdout = open(f_name, \"w\")  try:     conn = pyodbc.connect(r'Driver={SQL Server};                           SERVER=\u2026\u2026;Database=diadoc_test;                           Trusted_Connection=yes')     cursor = conn.cursor() except:     ctypes.windll.user32.MessageBoxW(0,                                       \"\u041d\u0435\u0442 \u043f\u0440\u0430\u0432 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0411\u0414\"                                      , \"\u041e\u0448\u0438\u0431\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430\", 1)     print(datetime.datetime.now()           .strftime('%Y-%m-%d_%H-%M-%S') + ' - \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0441 \u0411\u0414')     sys.stdout.close()     sys.stdout = stdoutOrigin     exit()  log_pass = {'login': '\u2026\u2026', 'password': '\u2026'} pass_json = json.dumps(log_pass) # \u043d\u0438\u0436\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0447\u0435\u043a \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043a\u043b\u044e\u0447 auth_header_key = \"DiadocAuth ddauth_api_client_id=...\"  # \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 r = requests.request(method='POST'                      , url='https:\/\/diadoc-api.kontur.ru\/V3\/Authenticate',                      headers={\"Authorization\": auth_header,                               \"Content-Length\": \"1252\",                               \"Connection\": \"Keep-Alive\",                               \"Content-Type\": \"application\/json\"},                      params={\"type\": \"password\"},                      data=pass_json) # \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 auth_header = auth_header_key + \",ddauth_token=\" + r.text print(datetime.datetime.now().__str__() + ' - \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f'  # \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u0435\u0441\u0442\u0440 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 r1 = requests.request(method='GET'                       , url='https:\/\/diadoc-api.kontur.ru\/GetMyOrganizations'                       ,headers={\"Authorization\": auth_header,                               \"Content-Length\": \"1252\",                               \"Connection\": \"Keep-Alive\",                               \"Content-Type\": \"application\/json\",                               \"Accept\": \"application\/json\"},                      params={\"type\": \"password\"},                      data=pass_json) r1 = r1.json() print(datetime.datetime.now().__str__() + ' - \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0439')  conn.cursor().execute('truncate table diadoc_test.dbo.tbl_organizations')       .commit() print(datetime.datetime.now().__str__() + ' - \u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0439')  conn.cursor().execute('truncate table diadoc_test.dbo.tbl_departments').commit() print(datetime.datetime.now().__str__() + ' - \u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0439')  for i in range(len(r1['Organizations'])):     if not r1['Organizations'][i]['IsTest']:         q_str = 'INSERT INTO diadoc_test.dbo.tbl_organizations VALUES(' + \\             \"'\" + r1['Organizations'][i]['OrgIdGuid'] + \\             \"', '\" + r1['Organizations'][i]['OrgId'] + \"', '\" + \\             r1['Organizations'][i]['Inn'] + \"', '\" + \\             r1['Organizations'][i]['Kpp'] + \"', '\" + \\             r1['Organizations'][i]['FullName'] + \"', '\" + \\             r1['Organizations'][i]['ShortName'] + \"', '\" + \\             r1['Organizations'][i]['Boxes'][0]['BoxId'] + \"', '\" + \\             r1['Organizations'][i]['Boxes'][0]['BoxIdGuid'] + \"', '\" + \\             r1['Organizations'][i]['Boxes'][0]['Title'] + \"', '\" + \\             r1['Organizations'][i]['Boxes'][0]['InvoiceFormatVersion'] + \\             \"', '\" + r1['Organizations'][i]['Ogrn'] + \"', '\" + \\             r1['Organizations'][i]['FnsParticipantId'] + \"')\"         conn.cursor().execute(q_str).commit()         print(datetime.datetime.now().__str__() + ' - ' + q_str)     for j in range(len(r1['Organizations'][i]['Departments'])):         if not r1['Organizations'][i]['Departments'][j]['IsDisabled']:             buff = r1['Organizations'][i]['Departments'][j]             q_str = 'INSERT INTO diadoc_test.dbo.tbl_departments VALUES(' + \\                 \"'\" + buff['DepartmentId'] + \"', '\" + \\                 buff['ParentDepartmentId'] + \"', '\" + \\                 buff['Name'] + \"', '\" + buff['Abbreviation'] + \"', '\" + \\                 r1['Organizations'][i]['OrgId'] + \"')\"             conn.cursor().execute(q_str).commit()             print(datetime.datetime.now().__str__() + ' - ' + q_str)  # \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u0435\u0441\u0442\u0440 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439 conn.cursor().execute('truncate table diadoc_test.dbo.tbl_invitations').commit() print(datetime.datetime.now().__str__() + ' - \u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439')  orgs = conn.cursor().execute('select distinct OrgId from dbo.tbl_organizations').fetchall() orgs_list = list(orgs[x][0] for x in range(len(orgs))) print(datetime.datetime.now().__str__()        + ' - \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u042e\u041b, \u0437\u0430\u043f\u0438\u0441\u0435\u0439 - ' + str(len(orgs_list)))  for org in orgs_list:     after_index = -1     counter = 0     eol = False     while not eol:         print(org)         r1 = requests.request(method='GET'                         , url='https:\/\/diadoc-api.kontur.ru\/V2\/GetCounteragents',                         headers={\"Authorization\": auth_header,                                  \"Content-Length\": \"1252\",                                  \"Connection\": \"Keep-Alive\",                                  \"Content-Type\": \"application\/json\",                                  \"Accept\": \"application\/json\"},                         params={\"myOrgId\": org,                                 \"afterIndexKey\": after_index,                                 \"counteragentStatus\": \"InvitesMe\"},                         data=pass_json)         if r1.text[:8] != '\u0414\u043e\u0441\u0442\u0443\u043f \u0437':             r1 = r1.json()             for i in range(len(r1['Counteragents'])):                 buff = r1['Counteragents'][i]['Organization']                 q_str = 'INSERT INTO diadoc_test.dbo.tbl_invitations ' + \\                         'VALUES(' + \"'\" + buff['ShortName'] + \"', '\" + \\                         org + \"', '\" + buff['Inn'] + \"', '\" + \\                         buff['OrgId'] + \"')\"                 conn.cursor().execute(q_str).commit()                 print(datetime.datetime.now().__str__() + ' - ' + q_str)             if len(r1['Counteragents']) &lt; 99:                 eol = True             else:                 # \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 100 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441, \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u0441\u043b. \u0437\u0430\u043f\u0440\u043e\u0441                 after_index =                      r1['Counteragents'][len(r1['Counteragents'])-1]['IndexKey']         else:             print(datetime.datetime.now().__str__() + ' - ' +                   org + ' - ' + r1.text)             eol = True  # \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0418\u041d\u041d, OrgID, \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043b\u0438\u0446, # \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f  a = conn.cursor().execute(   'select distinct OrId_our, OrgID, \u0418\u041d\u041d from dbo.view_\u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f_\u043e\u0442_\u043c\u043e\u0438\u0445_\u041a\u0410'    ).fetchall() ka_list = list([a[x][0], a[x][1], a[x][2]] for x in range(len(a)))  print(datetime.datetime.now().__str__() +        ' - \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u043f\u043e \u042e\u041b, \u0437\u0430\u043f\u0438\u0441\u0435\u0439 - ' + str(len(ka_list)))  for i in range(len(ka_list)):     r1 = requests.request(method='POST'                           , url='https:\/\/diadoc-api.kontur.ru\/V2\/AcquireCounteragent'                           , headers={\"Authorization\": auth_header,                                    \"Content-Length\": \"1252\",                                    \"Connection\": \"Keep-Alive\",                                    \"Content-Type\": \"application\/json\",                                    \"Accept\": \"application\/json\"},                           params={\"myOrgId\": ka_list[i][0]},                           data=json.dumps({\"OrgId\": ka_list[i][1]}))     #\u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 - \u043e\u043d\u043e \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u0442\u0441\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043d\u043e\u0441\u0438\u043c \u0432 \u043b\u043e\u0433     if r1.text[0:6] == 'Cannot':         print(r1.text)     else:     #\u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \"\u043f\u0440\u043e\u0441\u0442\u043e\u0435\" - \u043e\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e, \u0432\u043d\u043e\u0441\u0438\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435         conn.cursor().execute('INSERT INTO dbo.tbl_invitations_accepted' +                               'VALUES (' + \"'\" + ka_list[i][1] + \"', '\" +                               datetime.datetime.now().strftime('%Y-%m-%d') +                               \"', '\" + ka_list[i][2] + \"', '\" +                                ka_list[i][1] + \"')\").commit()         print(datetime.datetime.now().__str__() +                ' - \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043e\u0442 ' + ka_list[i][2]) print(datetime.datetime.now().__str__() + ' - \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430')  #\u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043b\u043e\u0433\u0430 sys.stdout.close() sys.stdout = stdoutOrigin <\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b pyinstaller \u043a\u043e\u0434 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b .exe, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0435 \u0437\u0430\u0434\u0430\u0447 Windows, \u0432 &#171;\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445&#187; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c .exe-\u0444\u0430\u0439\u043b, \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 &#171;\u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b&#187; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u044b \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/79b\/f07\/331\/79bf07331aa3eb920e967a63f6b57a73.jpg\" width=\"597\" height=\"303\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/79b\/f07\/331\/79bf07331aa3eb920e967a63f6b57a73.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u043f\u0438\u0441\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0437\u0430 \u0441\u0434\u0435\u043b\u043a\u0438 \u0441 \u043a\u043e\u043d\u0442\u0440\u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u043f\u0440\u0438\u0435\u043c\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439 \u0438 \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u044f.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/588957\/\"> https:\/\/habr.com\/ru\/articles\/588957\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u0435\u0434\u043f\u043e\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>\u0424\u041d\u0421 \u0432 2020 \u0433\u043e\u0434\u0443 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043e\u0431\u043e\u0440\u043e\u0442\u0430 \u0441 \u043a\u043e\u043d\u0442\u0440\u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438 \u0432 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0439 \u0432\u0438\u0434. \u0412 \u0438\u044e\u043b\u0435 2021 \u0433\u043e\u0434\u0430 \u043e\u0431\u043c\u0435\u043d \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u043c\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u0441\u0447\u0435\u0442\u0430\u043c\u0438-\u0444\u0430\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u043f\u043e \u0437\u0430\u043a\u0443\u043f\u043a\u0435 \u0438 \u043f\u0440\u043e\u0434\u0430\u0436\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0443\u0436\u0435 \u0441\u0442\u0430\u043b \u0431\u0435\u0437\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u043c. <\/p>\n<p>\u0412 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u0445 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0435\u0439, \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432, \u0444\u0438\u043b\u0438\u0430\u043b\u043e\u0432, \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u042d\u0414\u041e: \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c, \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0430\u043c\u0438 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432, \u043a\u043e\u043d\u0442\u0440\u0430\u0433\u0435\u043d\u0442\u0430\u043c\u0438. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (\u043e\u043d\u0438 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f) \u0438 \u0441\u0430\u043c \u043f\u043e\u0442\u043e\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0438\u0445 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0410 \u0442\u0430\u043a\u0436\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u042d\u0414\u041e: \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0438 \u0441\u0432\u0435\u0440\u0438\u0442\u044c \u0441 \u043e\u043f\u043b\u0430\u0442\u0430\u043c\u0438, \u0437\u0430\u044f\u0432\u043a\u0430\u043c\u0438, \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430\u043c\u0438; \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b \u0431\u0443\u0445\u0433\u0430\u043b\u0442\u0435\u0440\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043a; \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043b\u043d\u043e\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u042d\u0414\u041e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 1\u0421, SAP \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 ERP. \u041a\u043e\u0440\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0437 \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u0438\u0445 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0443. \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 &#8212; \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u043e API, \u0437\u0430 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0434\u0435\u043d\u044c\u0433\u0438.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API<\/h2>\n<p>\u0414\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043d\u0442\u0440\u0430\u0433\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f\u043c\u0438. \u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u043c\u0443 \u044e\u0440.\u043b\u0438\u0446\u0443 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0418\u041d\u041d-\u041a\u041f\u041f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u043e\u0442 \u043b\u044e\u0431\u044b\u0445 \u044e\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u0438\u0446. \u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043e\u043f.\u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430 \u043e\u0431 \u042d\u0414\u041e \u043c\u0435\u0436\u0434\u0443 \u043b\u0438\u0446\u0430\u043c\u0438, \u043d\u0435 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u043e\u0432\u044b\u0445 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432 \u0443 \u0441\u0442\u043e\u0440\u043e\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c. \u041d\u043e \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u043c\u0438, \u0441 \u043a\u0435\u043c \u0435\u0441\u0442\u044c \u043d\u0435\u0440\u0430\u0441\u0442\u043e\u0440\u0433\u043d\u0443\u0442\u044b\u0439 \u0434\u043e\u0433\u043e\u0432\u043e\u0440 \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0432\u0435\u0434\u0443\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u043a\u0438, \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a \u043d\u0435 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0445.<\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0438\u0436\u0435 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0443 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430, \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b. \u041a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 &#8212; \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043b\u0438\u0446\u0430\u043c, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f (\u0431\u0438\u0437\u043d\u0435\u0441\u0443, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443), \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0422\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0441\u0442\u0430\u0434\u0438\u0438 &#171;\u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442&#187; (MVP).<\/p>\n<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b: Python, PyCharm Community Edition, SQL Server Express Edition, SSMS, \u043a\u043b\u044e\u0447 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 API (\u043a\u0443\u043f\u0438\u0442\u044c\/\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u042d\u0414\u041e), \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 API \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u042d\u0414\u041e. \u0412\u0441\u0435 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0435, \u043a\u0440\u043e\u043c\u0435 \u043a\u043b\u044e\u0447\u0430 API.<\/p>\n<p>\u041e\u0431\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c: <\/p>\n<ol>\n<li>\n<p>Python: \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u0430\u0431\u0438\u043d\u0435\u0442 \u0432\u0430\u0448\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 (\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432 \u0446\u0438\u043a\u043b\u0435), \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f, \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/p>\n<\/li>\n<li>\n<p>SQL server: \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u043e\u0431\u043e\u0440\u043e\u0442\u043e\u0432 (\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c  \u0434\u043e\u043f.\u0444\u0438\u043b\u044c\u0442\u0440\u044b &#8212; \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u044b, \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0445) \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0418\u041d\u041d, \u0441\u0442\u0440\u043e\u0438\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0418\u041d\u041d \u0441 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u043e\u0431\u043e\u0440\u043e\u0442\u0430\u043c\u0438 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0435\u0440\u0438\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>Python: \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0418\u041d\u041d, \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u0430\u0431\u0438\u043d\u0435\u0442 \u042d\u0414\u041e, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f, \u0437\u0430\u043d\u043e\u0441\u0438\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f\u0445. \u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e (\u043d\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435) &#8212; \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043a\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0445 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u0434\u0430\u0447 Windows: \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0443\u044e \u0442\u0440\u0438 \u043f\u0443\u043d\u043a\u0442\u0430 \u0432\u044b\u0448\u0435, \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<pre><code class=\"sql\">CREATE TABLE [dbo].[tbl_organizations]( [OrgGUID] [char](36) NULL, [OrgID] [char](36) NULL, [Inn] [char](12) NULL, [Kpp] [char](9) NULL, [Full_name] [nvarchar](max) NULL, [Short_name] [nvarchar](max) NULL, [BoxID] [varchar](100) NULL, [BoxGUID] [char](36) NULL, [Box_title] [nvarchar](max) NULL, [Invoice_format_ver] [char](20) NULL, [Ogrn] [char](15) NULL, [FNS_participant] [char](50) NULL ) ON [PRIMARY] GO  CREATE TABLE [dbo].[tbl_departments]( [DepartmentID] [char](36) NULL, [Parent_dept_ID] [char](36) NULL, [Dept_name] [nvarchar](max) NULL, [Dept_abbr] [nvarchar](50) NULL, [OrgID] [char](36) NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO  CREATE TABLE [dbo].[tbl_invitations]( [Short_name] [nvarchar](255) NULL, [OrgID_our] [char](36) NULL, [Inn] [char](12) NULL, [OrgID] [char](36) NULL ) ON [PRIMARY] GO  CREATE TABLE [dbo].[tbl_invitations_accepted]( [OrgId] [char](36) NULL, [Record_date] [date] NULL, [Inn] [char](12) NULL, [OrgId_our] [char](36) NULL ) ON [PRIMARY] GO<\/code><\/pre>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 tbl_departments \u0432 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (view) \u0441 \u043e\u0431\u043e\u0440\u043e\u0442\u0430\u043c\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0418\u041d\u041d \u0438\u043b\u0438 \u0418\u041d\u041d-\u041a\u041f\u041f, \u0438\u043b\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b &#8212; \u0432\u044b\u0432\u043e\u0434 \u0432 \u044d\u043a\u0441\u0435\u043b\u044c \u0438\u0437 1\u0421 \u0438\u043b\u0438 SAP \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 bcp, \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u043c \u0432 SSMS \u0438\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. <\/p>\n<p>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0431\u0435\u0437 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041c\u0435\u0442\u043e\u0434\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u042d\u0414\u041e.<\/p>\n<pre><code class=\"python\">import pprint import requests import json import pyodbc import datetime import sys  #\u0437\u0430\u0432\u043e\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u0444\u0430\u0439\u043b f_name = r'C:\\Temp\\log_' + datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S') + '.txt' stdoutOrigin = sys.stdout sys.stdout = open(f_name, \"w\")  try:     conn = pyodbc.connect(r'Driver={SQL Server};                           SERVER=\u2026\u2026;Database=diadoc_test;                           Trusted_Connection=yes')     cursor = conn.cursor() except:     ctypes.windll.user32.MessageBoxW(0,                                       \"\u041d\u0435\u0442 \u043f\u0440\u0430\u0432 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0411\u0414\"                                      , \"\u041e\u0448\u0438\u0431\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430\", 1)     print(datetime.datetime.now()           .strftime('%Y-%m-%d_%H-%M-%S') + ' - \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0441 \u0411\u0414')     sys.stdout.close()     sys.stdout = stdoutOrigin     exit()  log_pass = {'login': '\u2026\u2026', 'password': '\u2026'} pass_json = json.dumps(log_pass) # \u043d\u0438\u0436\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0447\u0435\u043a \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043a\u043b\u044e\u0447 auth_header_key = \"DiadocAuth ddauth_api_client_id=...\"  # \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 r = requests.request(method='POST'                      , url='https:\/\/diadoc-api.kontur.ru\/V3\/Authenticate',                      headers={\"Authorization\": auth_header,                               \"Content-Length\": \"1252\",                               \"Connection\": \"Keep-Alive\",                               \"Content-Type\": \"application\/json\"},                      params={\"type\": \"password\"},                      data=pass_json) # \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 auth_header = auth_header_key + \",ddauth_token=\" + r.text print(datetime.datetime.now().__str__() + ' - \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f'  # \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u0435\u0441\u0442\u0440 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0439 \u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 r1 = requests.request(method='GET'                       , url='https:\/\/diadoc-api.kontur.ru\/GetMyOrganizations'                       ,headers={\"Authorization\": auth_header,                               \"Content-Length\": \"1252\",                               \"Connection\": \"Keep-Alive\",                               \"Content-Type\": \"application\/json\",                               \"Accept\": \"application\/json\"},                      params={\"type\": \"password\"},                      data=pass_json) r1 = r1.json() print(datetime.datetime.now().__str__() + ' - \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0439')  conn.cursor().execute('truncate table diadoc_test.dbo.tbl_organizations')       .commit() print(datetime.datetime.now().__str__() + ' - \u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0439')  conn.cursor().execute('truncate table diadoc_test.dbo.tbl_departments').commit() print(datetime.datetime.now().__str__() + ' - \u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u043e\u0434\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0439')  for i in range(len(r1['Organizations'])):     if not r1['Organizations'][i]['IsTest']:         q_str = 'INSERT INTO diadoc_test.dbo.tbl_organizations VALUES(' + \\             \"'\" + r1['Organizations'][i]['OrgIdGuid'] + \\             \"', '\" + r1['Organizations'][i]['OrgId'] + \"', '\" + \\             r1['Organizations'][i]['Inn'] + \"', '\" + \\             r1['Organizations'][i]['Kpp'] + \"', '\" + \\             r1['Organizations'][i]['FullName'] + \"', '\" + \\             r1['Organizations'][i]['ShortName'] + \"', '\" + \\             r1['Organizations'][i]['Boxes'][0]['BoxId'] + \"', '\" + \\             r1['Organizations'][i]['Boxes'][0]['BoxIdGuid'] + \"', '\" + \\             r1['Organizations'][i]['Boxes'][0]['Title'] + \"', '\" + \\             r1['Organizations'][i]['Boxes'][0]['InvoiceFormatVersion'] + \\             \"', '\" + r1['Organizations'][i]['Ogrn'] + \"', '\" + \\             r1['Organizations'][i]['FnsParticipantId'] + \"')\"         conn.cursor().execute(q_str).commit()         print(datetime.datetime.now().__str__() + ' - ' + q_str)     for j in range(len(r1['Organizations'][i]['Departments'])):         if not r1['Organizations'][i]['Departments'][j]['IsDisabled']:             buff = r1['Organizations'][i]['Departments'][j]             q_str = 'INSERT INTO diadoc_test.dbo.tbl_departments VALUES(' + \\                 \"'\" + buff['DepartmentId'] + \"', '\" + \\                 buff['ParentDepartmentId'] + \"', '\" + \\                 buff['Name'] + \"', '\" + buff['Abbreviation'] + \"', '\" + \\                 r1['Organizations'][i]['OrgId'] + \"')\"             conn.cursor().execute(q_str).commit()             print(datetime.datetime.now().__str__() + ' - ' + q_str)  # \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u0435\u0441\u0442\u0440 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439 conn.cursor().execute('truncate table diadoc_test.dbo.tbl_invitations').commit() print(datetime.datetime.now().__str__() + ' - \u043e\u0447\u0438\u0441\u0442\u0438\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0439')  orgs = conn.cursor().execute('select distinct OrgId from dbo.tbl_organizations').fetchall() orgs_list = list(orgs[x][0] for x in range(len(orgs))) print(datetime.datetime.now().__str__()        + ' - \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u042e\u041b, \u0437\u0430\u043f\u0438\u0441\u0435\u0439 - ' + str(len(orgs_list)))  for org in orgs_list:     after_index = -1     counter = 0     eol = False     while not eol:         print(org)         r1 = requests.request(method='GET'                         ,<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-398056","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=398056"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398056\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}