{"id":2030,"date":"2023-11-15T23:04:09","date_gmt":"2023-11-15T15:04:09","guid":{"rendered":"https:\/\/qishiya.com\/?p=2030"},"modified":"2023-11-15T23:04:10","modified_gmt":"2023-11-15T15:04:10","slug":"%e9%80%9f%e5%8d%96%e9%80%9a%e5%88%a9%e6%b6%a6%e8%ae%a1%e7%ae%97%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/qishiya.com\/?p=2030","title":{"rendered":"\u901f\u5356\u901a\u5229\u6da6\u8ba1\u7b97\u5de5\u5177"},"content":{"rendered":"\n<p>\u6bcf\u4e00\u4e2a\u6708\u521d\uff0c\u6211\u4eec\u90fd\u8981\u6838\u5bf9\u4e0a\u4e00\u4e2a\u6708\u6323\u4e86\u591a\u5c11\u94b1\uff0c\u54ea\u4e9b\u8ba2\u5355\u662f\u4e8f\u635f\u4e86\uff0c\u54ea\u4e9b\u8ba2\u5355\u7684\u5229\u6da6\u8fc7\u9ad8\uff08\u4e3b\u52a8\u964d\u4ef7\uff0c\u6bd4\u88ab\u52a8\u964d\u4ef7\u597d\uff09\uff0c\u54ea\u4e9b\u7269\u6d41\u6210\u672c\u8fc7\u9ad8\uff0c\u600e\u4e48\u6837\u53bb\u4f18\u5316\u8fd9\u4e9b\u8ba2\u5355\uff0c\u5927\u6982\u8981\u82b1\u597d\u51e0\u4e2a\u5c0f\u65f6\u53bb\u6838\u5bf9\u8fd9\u4e9b\u6570\u636e\uff0c\u8fd9\u4e2a\u4e8b\u60c5\u5f88\u91cd\u8981\uff0c\u4f46\u662f\u4e0d\u80fd\u82b1\u592a\u591a\u7684\u65f6\u95f4\u53bb\u624b\u5de5\u505a\u8fd9\u4e2a\u4e8b\u60c5\uff0c\u4eca\u5929\u5199\u4e86\u4e00\u4e2a\u811a\u672c\uff0c\u4ee5\u524d\u8981\u51e0\u4e2a\u5c0f\u65f6\u7684\u6d3b\uff0c\u5927\u6982\u51e0\u5206\u949f\u5c31\u6709\u4e86\u4e00\u4e2a\u57fa\u672c\u7684\u6570\u636e\u8868\uff0c\u7136\u540e\u5c31\u662f\u81ea\u52a8\u5316\u5206\u6790\uff0c\u5148\u628a\u8fd9\u4e2a\u5c0f\u811a\u672c\u8d21\u732e\u51fa\u6765\uff0c\u63a5\u4e0b\u6765\u6211\u4f1a\u628a\u5b83\u505a\u6210\u4e00\u4e2a\u5c0f\u5de5\u5177\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_61 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ff6200;color:#ff6200\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ff6200;color:#ff6200\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/qishiya.com\/?p=2030\/#%E9%80%9F%E5%8D%96%E9%80%9A%E6%80%8E%E4%B9%88%E6%A0%B7%E8%AE%A1%E7%AE%97%E5%88%A9%E6%B6%A6\" title=\"\u901f\u5356\u901a\u600e\u4e48\u6837\u8ba1\u7b97\u5229\u6da6\">\u901f\u5356\u901a\u600e\u4e48\u6837\u8ba1\u7b97\u5229\u6da6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/qishiya.com\/?p=2030\/#%E9%80%9F%E5%8D%96%E9%80%9A%E5%88%A9%E6%B6%A6%E8%AE%A1%E7%AE%97%E8%84%9A%E6%9C%AC\" title=\"\u901f\u5356\u901a\u5229\u6da6\u8ba1\u7b97\u811a\u672c\">\u901f\u5356\u901a\u5229\u6da6\u8ba1\u7b97\u811a\u672c<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%9F%E5%8D%96%E9%80%9A%E6%80%8E%E4%B9%88%E6%A0%B7%E8%AE%A1%E7%AE%97%E5%88%A9%E6%B6%A6\"><\/span>\u901f\u5356\u901a\u600e\u4e48\u6837\u8ba1\u7b97\u5229\u6da6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u901f\u5356\u901a\uff08AliExpress\uff09\u5e73\u53f0\u4e0a\u8ba1\u7b97\u5229\u6da6\u7684\u516c\u5f0f\u662f\uff1a<\/p>\n\n\n\n<p><strong>\u5229\u6da6 = \u9500\u552e\u6536\u5165 &#8211; \u6210\u672c\u603b\u989d<\/strong><\/p>\n\n\n\n<p>\u5176\u4e2d\uff0c<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u9500\u552e\u6536\u5165 (S)<\/strong>\uff1a\u4ea7\u54c1\u7684\u9500\u552e\u4ef7\u683c\uff08\u5305\u542b\u7269\u6d41\u8d39\u7528\uff0c\u5982\u679c\u6709\u7684\u8bdd\uff09\u4e58\u4ee5\u9500\u552e\u6570\u91cf\u3002<\/li>\n\n\n\n<li><strong>\u6210\u672c\u603b\u989d (C)<\/strong>\uff1a\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u4e3b\u8981\u6210\u672c\uff1a\n<ul class=\"wp-block-list\">\n<li>\u4ea7\u54c1\u6210\u672c (P)\uff1a\u5355\u4e2a\u4ea7\u54c1\u7684\u91c7\u8d2d\u4ef7\u4e58\u4ee5\u9500\u552e\u6570\u91cf\u3002<\/li>\n\n\n\n<li>\u7269\u6d41\u6210\u672c (L)\uff1a\u8fd0\u8f93\u6bcf\u4e2a\u5546\u54c1\u6240\u9700\u7684\u8d39\u7528\u4e58\u4ee5\u9500\u552e\u6570\u91cf\u3002<\/li>\n\n\n\n<li>\u901f\u5356\u901a\u4f63\u91d1 (C_AE)\uff1a\u901f\u5356\u901a\u5e73\u53f0\u6839\u636e\u9500\u552e\u6536\u5165\u6240\u6536\u53d6\u7684\u4f63\u91d1\u3002<\/li>\n\n\n\n<li>\u5176\u4ed6\u8d39\u7528 (O)\uff1a\u5982\u5e7f\u544a\u8d39\u3001\u5305\u88c5\u8d39\u7b49\u5176\u4ed6\u76f8\u5173\u8d39\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u5c06\u4ee5\u4e0a\u56e0\u7d20\u6574\u5408\u5728\u4e00\u8d77\uff0c\u8ba1\u7b97\u5229\u6da6\u7684\u516c\u5f0f\u4e3a\uff1a<\/p>\n\n\n\n<p><strong>\u5229\u6da6 = S &#8211; (P + L + C_AE + O)<\/strong><\/p>\n\n\n\n<p>\u8981\u8ba1\u7b97\u5229\u6da6\uff0c\u8bf7\u786e\u4fdd\u4e86\u89e3\u6240\u6709\u76f8\u5173\u8d39\u7528\u5e76\u8003\u8651\u5230\u5b83\u4eec\u3002\u6bcf\u4e2a\u8d39\u7528\u53ef\u80fd\u56e0\u4ea7\u54c1\u3001\u4f9b\u5e94\u5546\u6216\u5730\u533a\u800c\u5f02\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e00\u671f\u6ca1\u6709\u7b97\u5e7f\u544a\u8d39\u7528\uff0c\u53ea\u7b97\u4e86 P+L+C_AE<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%9F%E5%8D%96%E9%80%9A%E5%88%A9%E6%B6%A6%E8%AE%A1%E7%AE%97%E8%84%9A%E6%9C%AC\"><\/span>\u901f\u5356\u901a\u5229\u6da6\u8ba1\u7b97\u811a\u672c<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u7b2c\u4e00\u5f20\u8868\uff0c\u8ba2\u5355\u6210\u672c\u8868\uff0c\u4e24\u5217\uff0c\u7b2c\u4e00\u5217\u8ba2\u5355id\uff0c\u7b2c\u4e8c\u5217\uff0c\u8ba2\u5355\u6210\u672c\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u5f20\u8868\uff0c\u7269\u6d41\u6210\u672c\u8868\uff0c\u5728\u7269\u6d41\u4e2d\u5fc3\u53ef\u4ee5\u76f4\u63a5\u4e0b\u8f7d<\/p>\n\n\n\n<p>\u7b2c\u4e09\u5f20\u8868\uff0c\u8ba2\u5355\u4ea4\u6613\u91d1\u989d\u660e\u7ec6\u8868\uff0c\u53ef\u4ee5\u76f4\u63a5\u4e0b\u8f7d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import csv\nfrom collections import defaultdict\n\n# \u8bfb\u53d6\u7b2c\u4e00\u5f20\u8868\u683c\uff1a\u6210\u672c\u8868\ncost_dict = {}\nwith open('\u6210\u672c\u8868.csv', 'r', encoding='utf-8') as f:\n    reader = csv.reader(f)\n    next(reader)  # \u8df3\u8fc7\u8868\u5934\n    for row in reader:\n        ae_order, order_cost = row\n        cost_dict&#91;ae_order] = round(float(order_cost), 2)\n\n# \u8bfb\u53d6\u7b2c\u4e8c\u5f20\u8868\u683c\uff1a\u7269\u6d41\u6210\u672c\u8868\nlogistics_dict = defaultdict(float)\nwith open('\u7269\u6d41\u6210\u672c\u8868.csv', 'r', encoding='utf-8') as f:\n    reader = csv.reader(f)\n    next(reader)  # \u8df3\u8fc7\u8868\u5934\n    for row in reader:\n        logistics_order, ae_order = row&#91;0], row&#91;1]\n        payment_amount = round(float(row&#91;-4]), 2)\n        logistics_dict&#91;ae_order] += payment_amount\n\n# \u8bfb\u53d6\u7b2c\u4e09\u5f20\u8868\u683c\uff1a\u8ba2\u5355\u4ea4\u6613\u91d1\u989d\u8868\norder_info_dict = {}\nwith open('\u8ba2\u5355\u4ea4\u6613\u91d1\u989d\u8868.csv', 'r', encoding='utf-8') as f:\n    reader = csv.reader(f)\n    next(reader)  # \u8df3\u8fc7\u8868\u5934\n    for row in reader:\n        ae_order, _, _, trade_amount, _, _, trade_commission, union_commission, *_ = row\n        order_info_dict&#91;ae_order] = {\n            'trade_amount': round(float(trade_amount), 2),\n            'trade_commission': round(float(trade_commission), 2),\n            'union_commission': round(float(union_commission), 2),\n        }\n\n# \u8f93\u51fa\u7ed3\u679c\u8868\u683c\nwith open('\u8f93\u51fa\u8868\u683c.csv', 'w', encoding='utf-8', newline='') as f:\n    writer = csv.writer(f)\n    # \u5199\u5165\u8868\u5934\n    writer.writerow(&#91;'AE\u4ea4\u6613\u8ba2\u5355\u53f7', '\u8ba2\u5355\u91c7\u8d2d\u6210\u672c', '\u6210\u4ea4\u91d1\u989d(CNY)', '\u4ea4\u6613\u4f63\u91d1(CNY)', '\u8054\u76df\u4f63\u91d1(CNY)', '\u7269\u6d41\u652f\u4ed8\u91d1\u989d'])\n\n    for ae_order, cost in cost_dict.items():\n        if ae_order in order_info_dict:\n            trade_amount = order_info_dict&#91;ae_order]&#91;'trade_amount']\n            trade_commission = order_info_dict&#91;ae_order]&#91;'trade_commission']\n            union_commission = order_info_dict&#91;ae_order]&#91;'union_commission']\n            logistics_payment = round(logistics_dict&#91;ae_order], 2)\n\n            writer.writerow(&#91;ae_order, cost, trade_amount, trade_commission, union_commission, logistics_payment])<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u811a\u672c\u53ea\u662f\u628a\u6210\u672c\uff0c\u4ea4\u6613\u91d1\u989d\uff0c\u653e\u5728\u4e86\u4e00\u8d77\uff0c\u975e\u5e38\u65b9\u4fbf\u540e\u7eed\u52a0\u5de5\u6838\u7b97\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6bcf\u4e00\u4e2a\u6708\u521d\uff0c\u6211\u4eec\u90fd\u8981\u6838\u5bf9\u4e0a\u4e00\u4e2a\u6708\u6323\u4e86\u591a\u5c11\u94b1\uff0c\u54ea\u4e9b\u8ba2\u5355\u662f\u4e8f\u635f\u4e86\uff0c\u54ea\u4e9b\u8ba2\u5355\u7684\u5229\u6da6\u8fc7\u9ad8\uff08\u4e3b\u52a8\u964d\u4ef7\uff0c\u6bd4\u88ab\u52a8\u964d\u4ef7\u597d\uff09\uff0c\u54ea\u4e9b\u7269\u6d41\u6210\u672c\u8fc7\u9ad8\uff0c\u600e\u4e48\u6837\u53bb\u4f18\u5316\u8fd9\u4e9b\u8ba2\u5355\uff0c\u5927\u6982\u8981\u82b1\u597d\u51e0\u4e2a\u5c0f\u65f6\u53bb\u6838\u5bf9\u8fd9\u4e9b\u6570\u636e\uff0c\u8fd9\u4e2a\u4e8b\u60c5\u5f88\u91cd\u8981\uff0c\u4f46\u662f\u4e0d\u80fd\u82b1\u592a\u591a\u7684\u65f6\u95f4\u53bb\u624b\u5de5\u505a\u8fd9\u4e2a\u4e8b\u60c5\uff0c\u4eca\u5929 &#8230; <a title=\"\u901f\u5356\u901a\u5229\u6da6\u8ba1\u7b97\u5de5\u5177\" class=\"read-more\" href=\"https:\/\/qishiya.com\/?p=2030\" aria-label=\"\u66f4\u591a \u901f\u5356\u901a\u5229\u6da6\u8ba1\u7b97\u5de5\u5177\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":2032,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[11],"class_list":["post-2030","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aliexpress","tag-aliexpress","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts\/2030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2030"}],"version-history":[{"count":1,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts\/2030\/revisions"}],"predecessor-version":[{"id":2031,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/posts\/2030\/revisions\/2031"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=\/wp\/v2\/media\/2032"}],"wp:attachment":[{"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qishiya.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}