From 31c4d0ae90407c1477cc0280eeca99449c5eb890 Mon Sep 17 00:00:00 2001 From: liguangyu06 <1666071293@qq.com> Date: Thu, 9 Nov 2023 09:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E4=BE=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...55\347\211\251\350\275\246\345\210\227\350\241\250.py" | 6 +++++- ...7_\347\211\271\344\273\267\345\215\225\345\223\201.py" | 8 ++++---- ...56\347\211\271\344\273\267\346\237\245\350\257\242.py" | 4 +++- data/cmdc_special_fresenius_group/data | 1 + 4 files changed, 13 insertions(+), 6 deletions(-) diff --git "a/air_case/cmdc_buyercar_list/\346\226\260\345\242\236\345\267\262\345\244\261\346\225\210\345\225\206\345\223\201\350\207\263\350\264\255\347\211\251\350\275\246\345\210\227\350\241\250.air/\346\226\260\345\242\236\345\267\262\345\244\261\346\225\210\345\225\206\345\223\201\350\207\263\350\264\255\347\211\251\350\275\246\345\210\227\350\241\250.py" "b/air_case/cmdc_buyercar_list/\346\226\260\345\242\236\345\267\262\345\244\261\346\225\210\345\225\206\345\223\201\350\207\263\350\264\255\347\211\251\350\275\246\345\210\227\350\241\250.air/\346\226\260\345\242\236\345\267\262\345\244\261\346\225\210\345\225\206\345\223\201\350\207\263\350\264\255\347\211\251\350\275\246\345\210\227\350\241\250.py" index ccfe661f..3f483ae4 100644 --- "a/air_case/cmdc_buyercar_list/\346\226\260\345\242\236\345\267\262\345\244\261\346\225\210\345\225\206\345\223\201\350\207\263\350\264\255\347\211\251\350\275\246\345\210\227\350\241\250.air/\346\226\260\345\242\236\345\267\262\345\244\261\346\225\210\345\225\206\345\223\201\350\207\263\350\264\255\347\211\251\350\275\246\345\210\227\350\241\250.py" +++ "b/air_case/cmdc_buyercar_list/\346\226\260\345\242\236\345\267\262\345\244\261\346\225\210\345\225\206\345\223\201\350\207\263\350\264\255\347\211\251\350\275\246\345\210\227\350\241\250.air/\346\226\260\345\242\236\345\267\262\345\244\261\346\225\210\345\225\206\345\223\201\350\207\263\350\264\255\347\211\251\350\275\246\345\210\227\350\241\250.py" @@ -12,7 +12,6 @@ from air_case.cmdc_login.鍚庡彴绠$悊绯荤粺鐧诲綍.鍚庡彴绠$悊绯荤粺鐧诲綍 impor import requests import json - module = "cmdc_buyercar_list" # 姝ラ涓€鐧诲綍鍚庡彴绠$悊绯荤粺鏌ヨ宸插け鏁堝晢鍝佸垪琛ㄨ幏鍙栧凡涓嬫灦鍟嗗搧淇℃伅 @@ -22,14 +21,17 @@ password = commonFuc().get_business_data(module, "password2") # 鑾峰彇鐧诲綍鍚嶤mdc_access_token cmdc_access_token = CmdcDoLogin(username, password).get_token() headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token) +# 鑾峰彇宸插け鏁堝晢鍝� url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url50") request_body = commonFuc().get_business_data(module, "payload50") # 鍙戦€佽姹� result = requests.post(url, json=request_body, headers=headers) result = json.loads(result.content) +# 鑾峰彇鍟嗗搧淇℃伅 product_id = result["data"]["list"][0]["productId"] price = result["data"]["list"][0]["referencePrice"] filiale_code = result["data"]["list"][0]["filialeCode"] + # 绗簩姝ョ櫥褰曞閲囧晢鍩庢坊鍔犲晢鍝佽嚦璐墿杞﹀垪琛� # 鑾峰彇鐧诲綍澶氶噰鍟嗗煄鎵€闇€璐﹀彿瀵嗙爜 username = commonFuc().get_business_data(module, "username") @@ -37,8 +39,10 @@ password = commonFuc().get_business_data(module, "password") # 鑾峰彇鐧诲綍鍚嶤mdc_access_token cmdc_access_token = CmdcMaiiLogin(username, password).get_token() headers = commonFuc().get_business_data(module, "json_headers5", cmdc_access_token) +# 娣诲姞鍟嗗搧鑷宠喘鐗╄溅 url1 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2") request_body = commonFuc().get_business_data(module, "payload5", product_id, price, filiale_code) + """ 鍦烘櫙:鏂板宸插け鏁堢殑鍟嗗搧鑷宠喘鐗╄溅鍒楄〃 鐢ㄤ緥鍚嶇О锛氭柊澧炲凡澶辨晥鐨勫晢鍝佽嚦璐墿杞﹀垪琛� diff --git "a/air_case/cmdc_special_fresenius_group/\345\220\257\347\224\250_\346\211\271\351\207\217_\347\211\271\344\273\267\345\215\225\345\223\201.air/\345\220\257\347\224\250_\346\211\271\351\207\217_\347\211\271\344\273\267\345\215\225\345\223\201.py" "b/air_case/cmdc_special_fresenius_group/\345\220\257\347\224\250_\346\211\271\351\207\217_\347\211\271\344\273\267\345\215\225\345\223\201.air/\345\220\257\347\224\250_\346\211\271\351\207\217_\347\211\271\344\273\267\345\215\225\345\223\201.py" index 6c40566b..e27a8e69 100644 --- "a/air_case/cmdc_special_fresenius_group/\345\220\257\347\224\250_\346\211\271\351\207\217_\347\211\271\344\273\267\345\215\225\345\223\201.air/\345\220\257\347\224\250_\346\211\271\351\207\217_\347\211\271\344\273\267\345\215\225\345\223\201.py" +++ "b/air_case/cmdc_special_fresenius_group/\345\220\257\347\224\250_\346\211\271\351\207\217_\347\211\271\344\273\267\345\215\225\345\223\201.air/\345\220\257\347\224\250_\346\211\271\351\207\217_\347\211\271\344\273\267\345\215\225\345\223\201.py" @@ -50,7 +50,6 @@ excel.write_data(row=2, column=4, value=customer_name) # 绗簩姝ユ枃浠跺鍏� url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url18") - request_body = commonFuc().get_business_data(module, "payload18") # 鑾峰彇鏂囦欢 @@ -67,7 +66,7 @@ fresenius_price_id = result["data"]["freseniusAgreementPrices"][0]["freseniusPri # 绗笁姝ヨ繘琛岀壒浠峰崟鍝佸垹闄ゆ搷浣� url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url_open") request_body = {"freseniusPriceIds": [fresenius_price_id], "groupPriceStatus": 1, "remarks": "鐗逛环鍗曞搧鍚敤"} -print(request_body) + """ 鍦烘櫙:鍚敤_鎵归噺_鐗逛环鍗曞搧 鐢ㄤ緥鍚嶇О锛氬惎鐢╛鎵归噺_鐗逛环鍗曞搧 @@ -86,7 +85,8 @@ if result["success"]: host, port, user, pwd = mysql_handle.getConf(db="cmdc_db") # 鏁版嵁搴撴煡璇㈢壒浠峰崟鍝佹暟閲� - sql = "SELECT t.groupPriceStatus FROM `cmdc-order`.tc_fresenius_agreement_price t WHERE groupId = {};".format(group_id) + sql = "SELECT t.groupPriceStatus FROM `cmdc-order`.tc_fresenius_agreement_price t WHERE groupId = {};".format( + group_id) print(sql) result = {"groupPriceStatus": mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]} print(result) @@ -99,4 +99,4 @@ else: # 鑾峰彇棰勬湡缁撴灉 check_dict = commonFuc().get_business_data(module, "checkDict180") # 鏂█瀹為檯缁撴灉涓槸鍚﹀寘鍚鏈熺粨鏋滅殑鍐呭 - commonFuc().check_result(check_dict, result) \ No newline at end of file + commonFuc().check_result(check_dict, result) diff --git "a/air_case/cmdc_special_fresenius_group/\345\245\227\345\214\205\345\215\217\350\256\256\347\211\271\344\273\267\346\237\245\350\257\242.air/\345\245\227\345\214\205\345\215\217\350\256\256\347\211\271\344\273\267\346\237\245\350\257\242.py" "b/air_case/cmdc_special_fresenius_group/\345\245\227\345\214\205\345\215\217\350\256\256\347\211\271\344\273\267\346\237\245\350\257\242.air/\345\245\227\345\214\205\345\215\217\350\256\256\347\211\271\344\273\267\346\237\245\350\257\242.py" index 90dd7a58..1f7acf9c 100644 --- "a/air_case/cmdc_special_fresenius_group/\345\245\227\345\214\205\345\215\217\350\256\256\347\211\271\344\273\267\346\237\245\350\257\242.air/\345\245\227\345\214\205\345\215\217\350\256\256\347\211\271\344\273\267\346\237\245\350\257\242.py" +++ "b/air_case/cmdc_special_fresenius_group/\345\245\227\345\214\205\345\215\217\350\256\256\347\211\271\344\273\267\346\237\245\350\257\242.air/\345\245\227\345\214\205\345\215\217\350\256\256\347\211\271\344\273\267\346\237\245\350\257\242.py" @@ -24,7 +24,7 @@ headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_toke # 绗簩姝ュ鍖呭崗璁壒浠锋煡璇� url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url3") -request_body = commonFuc().get_business_data(module, "payload3") +request_body = commonFuc().get_business_data(module, "payload03") """ 鍦烘櫙:楠岃瘉濂楀寘鍗忚鐗逛环鎺ュ彛杩斿洖鏁版嵁涓庢暟鎹簱鏁版嵁鏄惁涓€鑷� 鐢ㄤ緥鍚嶇О锛氬鍖呭崗璁环鏌ヨ @@ -48,7 +48,9 @@ sql = "SELECT t.* FROM `cmdc-order`.tc_fresenius_agreement_price t " \ "WHERE companyCode = 00111 and isRegularPrice = 0 and " \ "groupId in (SELECT t.groupId FROM `cmdc-order`.tc_fresenius_group t " \ "WHERE status = 1 and groupType = 0);" +print(sql) total = len(mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)) +print(total) # 鑾峰彇棰勬湡缁撴灉 check_dict = commonFuc().get_business_data(module, "checkDict3", total) diff --git a/data/cmdc_special_fresenius_group/data b/data/cmdc_special_fresenius_group/data index 6e70bb1c..99463cb7 100644 --- a/data/cmdc_special_fresenius_group/data +++ b/data/cmdc_special_fresenius_group/data @@ -40,6 +40,7 @@ checkDict2: {"total":"%s"} #娴嬭瘯鍦烘櫙涓夛細濂楀寘鍗忚鐗逛环鏌ヨ "url3": "/order/public/queryFreseniusAgreementPricePageInfo" "payload3": {"groupCode":"","groupName":"","productCode":"","productInfo":"","materialCode":"","manufacturerList":[],"productLineName":"","description":"","manufacturerProductDesc":"","manufacturerProductNo":"","customerCode":"","customerName":"","manufacturerUserNo":"","manufacturerUserDesc":"","documentNo":"","companyCode":"","groupType":0,"status":null,"pageStart":null,"pageSize":null} +"payload03": {"groupCode":"","groupName":"","productCode":"","productInfo":"","materialCode":"","manufacturerList":[],"productLineName":"","description":"","manufacturerProductDesc":"","manufacturerProductNo":"","customerCode":"","customerName":"","manufacturerUserNo":"","manufacturerUserDesc":"","documentNo":"","companyCode":"","groupType":0,"status":"1","pageStart":1,"pageSize":10} #棰勬湡缁撴灉 checkDict3: {"total":"%s"} -- GitLab