ea1e7a1e by 冯轩

Merge branch 'feature/CHINARPA-5131-5234' into feature/uat-tmp

2 parents e960a89a 30dda232
......@@ -184,5 +184,5 @@ class ECM(GenericView):
response = requests.post(self.search_url, headers=header_info, json=args, verify=False)
if response.status_code != 200:
raise ECMException('ECM search failed with code: {0}'.format(response.status_code))
self.running_log.info("{0} search response.json():{1}".format(self.log_base, response.json()))
#self.running_log.info("{0} search response.json():{1}".format(self.log_base, response.json()))
return response.json()
\ No newline at end of file
......
......@@ -2096,6 +2096,7 @@ class SearchGBHistoryFileView(GenericView):
ecm = ECM()
response_json = ecm.search_doc_info_list(file_path, business_type)
data_objects = response_json['Envelope']['Body']['executeResponse']['return']['dataPackage']['DataObjects']
self.running_log.info('[SearchGBHistoryFileView] [data_objects size={0}] '.format(len(data_objects)))
for data_object in data_objects:
object_id = data_object['Identity']['ObjectId']['@id']
properties_dict = {}
......@@ -2105,20 +2106,24 @@ class SearchGBHistoryFileView(GenericView):
value = prop.get('Value', 'null') # 如果Value为空,则输出null
properties_dict[name] = value
self.running_log.info('[SearchGBHistoryFileView] [properties_dict={0}] '.format(properties_dict))
gb_history_file_class.objects.create(
object_id=object_id,
object_name=properties_dict.get('object_name', ''),
application_no=properties_dict.get('b_application_no', ''),
object_type=properties_dict.get('r_object_type', ''),
customer_name=properties_dict.get('b_customer_name', ''),
content_size=properties_dict.get('r_content_size', ''),
owner_name=properties_dict.get('owner_name', ''),
#input_date=properties_dict.get('b_input_date', ''),
#modify_date=properties_dict.get('r_modify_date', ''),
location=properties_dict.get('b_location', ''),
download_finish=False
)
return response.ok(data=False)
try:
gb_history_file_class.objects.create(
object_id=object_id,
object_name=properties_dict.get('object_name', ''),
application_no=properties_dict.get('b_application_no', ''),
object_type='green_book',
customer_name=properties_dict.get('b_customer_name', ''),
content_size=properties_dict.get('r_content_size', ''),
owner_name=properties_dict.get('owner_name', ''),
#input_date=properties_dict.get('b_input_date', ''),
#modify_date=properties_dict.get('r_modify_date', ''),
location=properties_dict.get('b_location', ''),
download_finish=False
)
except Exception as e:
self.exception_log.exception('[SearchGBHistoryFileView] [db save failed] [error={0}]'.format(traceback.format_exc()))
return response.ok(data=True)
class DownloadGBHistoryFileView(GenericView):
permission_classes = [IsAuthenticated]
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!