665acbf4 by 冯轩

init:4944

1 parent a0d6443d
......@@ -97,9 +97,13 @@ class ECM(GenericView):
"docbase": self.doc_base_map.get(business_type),
"documentType": doc_type,
"objectId": object_id,
"b_input_date": time.strftime("%m/%d/%Y %X"),
"b_credit_signing_date": time.strftime("%m/%d/%Y %X"),
"b_id_number": '',
}
header_info = self.get_headers()
self.running_log.info("{0} download header_info:{1}".format(self.log_base, header_info))
self.running_log.info("{0} download args_info:{1}".format(self.log_base, download_json))
response = requests.post(self.download_url, headers=header_info, json=download_json, verify=False)
if response.status_code != 200:
raise ECMException('ECM download failed with code: {0}'.format(response.status_code))
......@@ -137,6 +141,8 @@ class ECM(GenericView):
"b_region": "0",
"b_region_name": self.b_region_name_map.get(business_type),
"b_input_date": time.strftime("%m/%d/%Y %X"),
"b_credit_signing_date": time.strftime("%m/%d/%Y %X"),
"b_id_number": '',
# "file_base64_content": "",
}
for key in self.upload_fields:
......@@ -148,9 +154,10 @@ class ECM(GenericView):
args['file_base64_content'] = file_data
header_info = self.get_headers()
self.running_log.info("{0} upload header_info:{1}".format(self.log_base, header_info))
self.running_log.info("{0} upload args_info:{1}".format(self.log_base, args))
response = requests.post(self.upload_url, headers=header_info, json=args, verify=False)
if response.status_code != 200:
raise ECMException('ECM upload failed with code: {0} , with headers: {1} , with content: {2}'.format(
response.status_code, response.headers, response.text))
if 'ns6:createResponse' not in response.json().get('S:Envelope', {}).get('S:Body', {}):
if 'ns12:createResponse' not in response.json().get('S:Envelope', {}).get('S:Body', {}):
raise ECMException('ECM upload failed: {0} , with headers: {1}'.format(response.json(), response.headers))
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!