def add_home_provider_serials(self): # 批量添加房源信息,空间信息 payload = hmpv.add_house_provider() home_provider_name = hmpv.add_house_provider()["providerName"] req_url = pu.house_manage_urls()["add_home_source_provider_url"] r = requests.post(req_url, json=payload) rsp = json.loads(r.text) # 添加房源信息 if r.status_code == 200: provider_id = db.house_source_sql("get_provider_name_and_id", home_provider_name) payload = hmpv.add_house_source() payload["providerId"] = provider_id req_url = pu.house_manage_urls()["add_home_source_url"] r = requests.post(req_url, json=payload) home_source_name = payload["homeSourceName"] if r.status_code: # 添加空间信息 payload = hmpv.add_space() payload["homeSourceId"] = db.house_source_sql( "get_home_source_id", home_source_name) req_url = pu.house_manage_urls()["add_space_url"] r = requests.post(req_url, json=payload) else: pass else: pass
def add_house_provider(): customer_id = db.house_source_sql("get_customer_id", HouseManageParamsValue.customer_name) add_house_provider_payload = { "enterpriseAccountId": str(customer_id), "providerName": HouseManageParamsValue.house_provider_name } return add_house_provider_payload
def update_space(self): payload = hmpv.update_space() payload["homeSourceId"] = CustomerManage.home_source_id payload["id"] = db.house_source_sql("get_space_id", CustomerManage.home_no) req_url = pu.house_manage_urls()["update_space_url"] r = requests.post(req_url, json=payload, cookies=self.ck) CustomerManage.home_source_id = payload["homeSourceId"] operate_time = datetime.datetime.now().strftime("%H:%M:%S.%f") self.result_check(r, operate_time, payload, CustomerManage.space_id, query_type="get_space_info")
def update_house_source(self): payload = hmpv.update_house_source() payload["id"] = db.house_source_sql("get_home_source_id", CustomerManage.home_source_name) payload["providerId"] = str(CustomerManage.provider_id) req_url = pu.house_manage_urls()["update_home_source_url"] r = requests.post(req_url, json=payload, cookies=self.ck) # 检查 homeSourceName, providerId,id,types,删除状态 operate_time = datetime.datetime.now().strftime("%H:%M:%S.%f") CustomerManage.home_source_name = payload["homeSourceName"] self.result_check(r, operate_time, payload, payload["homeSourceName"], query_type="get_home_source_info")
def add_house_source(self): payload = hmpv.add_house_source() payload["providerId"] = db.house_source_sql( "get_provider_name_and_id", CustomerManage.home_provider_name) req_url = pu.house_manage_urls()["add_home_source_url"] r = requests.post(req_url, json=payload, cookies=self.ck) CustomerManage.home_source_name = payload["homeSourceName"] CustomerManage.addrCode = payload["addrCode"] CustomerManage.provider_id = payload["providerId"] operate_time = datetime.datetime.now().strftime("%H:%M:%S.%f") self.result_check(r, operate_time, payload, payload["homeSourceName"], query_type="get_home_source_info")
def add_space(self): payload = hmpv.add_space() payload["homeSourceId"] = db.house_source_sql( "get_home_source_id", CustomerManage.home_source_name) req_url = pu.house_manage_urls()["add_space_url"] r = requests.post(req_url, json=payload, cookies=self.ck) CustomerManage.home_source_id = payload["homeSourceId"] CustomerManage.home_no = payload["homeNo"] # homelist 检查id,homeSourceId,homeNo,floorNum,del # 通过homeSourceId,homeNo确定space 的id CustomerManage.space_id = db_wc.house_manage_web_check( "get_space_id", payload["homeSourceId"], payload["homeNo"]) operate_time = datetime.datetime.now().strftime("%H:%M:%S.%f") self.result_check(r, operate_time, payload, CustomerManage.space_id, query_type="get_space_info")
def delete_space(): space_id = db.house_source_sql("get_space_id", HouseManageParamsValue.update_home_num) return space_id
def delete_house_source(): house_source_id = db.house_source_sql( "get_home_source_id", HouseManageParamsValue.update_home_source_name) return house_source_id
def delete_house_provider(): house_provider_id = db.house_source_sql( "get_provider_name_and_id", HouseManageParamsValue.house_provider_name) return house_provider_id