Merge branch 'feature/CHINARPA-5131-5234' into feature/uat-tmp
Showing
2 changed files
with
20 additions
and
15 deletions
... | @@ -184,5 +184,5 @@ class ECM(GenericView): | ... | @@ -184,5 +184,5 @@ class ECM(GenericView): |
184 | response = requests.post(self.search_url, headers=header_info, json=args, verify=False) | 184 | response = requests.post(self.search_url, headers=header_info, json=args, verify=False) |
185 | if response.status_code != 200: | 185 | if response.status_code != 200: |
186 | raise ECMException('ECM search failed with code: {0}'.format(response.status_code)) | 186 | raise ECMException('ECM search failed with code: {0}'.format(response.status_code)) |
187 | self.running_log.info("{0} search response.json():{1}".format(self.log_base, response.json())) | 187 | #self.running_log.info("{0} search response.json():{1}".format(self.log_base, response.json())) |
188 | return response.json() | 188 | return response.json() |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -2096,6 +2096,7 @@ class SearchGBHistoryFileView(GenericView): | ... | @@ -2096,6 +2096,7 @@ class SearchGBHistoryFileView(GenericView): |
2096 | ecm = ECM() | 2096 | ecm = ECM() |
2097 | response_json = ecm.search_doc_info_list(file_path, business_type) | 2097 | response_json = ecm.search_doc_info_list(file_path, business_type) |
2098 | data_objects = response_json['Envelope']['Body']['executeResponse']['return']['dataPackage']['DataObjects'] | 2098 | data_objects = response_json['Envelope']['Body']['executeResponse']['return']['dataPackage']['DataObjects'] |
2099 | self.running_log.info('[SearchGBHistoryFileView] [data_objects size={0}] '.format(len(data_objects))) | ||
2099 | for data_object in data_objects: | 2100 | for data_object in data_objects: |
2100 | object_id = data_object['Identity']['ObjectId']['@id'] | 2101 | object_id = data_object['Identity']['ObjectId']['@id'] |
2101 | properties_dict = {} | 2102 | properties_dict = {} |
... | @@ -2105,20 +2106,24 @@ class SearchGBHistoryFileView(GenericView): | ... | @@ -2105,20 +2106,24 @@ class SearchGBHistoryFileView(GenericView): |
2105 | value = prop.get('Value', 'null') # 如果Value为空,则输出null | 2106 | value = prop.get('Value', 'null') # 如果Value为空,则输出null |
2106 | properties_dict[name] = value | 2107 | properties_dict[name] = value |
2107 | self.running_log.info('[SearchGBHistoryFileView] [properties_dict={0}] '.format(properties_dict)) | 2108 | self.running_log.info('[SearchGBHistoryFileView] [properties_dict={0}] '.format(properties_dict)) |
2108 | gb_history_file_class.objects.create( | 2109 | |
2109 | object_id=object_id, | 2110 | try: |
2110 | object_name=properties_dict.get('object_name', ''), | 2111 | gb_history_file_class.objects.create( |
2111 | application_no=properties_dict.get('b_application_no', ''), | 2112 | object_id=object_id, |
2112 | object_type=properties_dict.get('r_object_type', ''), | 2113 | object_name=properties_dict.get('object_name', ''), |
2113 | customer_name=properties_dict.get('b_customer_name', ''), | 2114 | application_no=properties_dict.get('b_application_no', ''), |
2114 | content_size=properties_dict.get('r_content_size', ''), | 2115 | object_type='green_book', |
2115 | owner_name=properties_dict.get('owner_name', ''), | 2116 | customer_name=properties_dict.get('b_customer_name', ''), |
2116 | #input_date=properties_dict.get('b_input_date', ''), | 2117 | content_size=properties_dict.get('r_content_size', ''), |
2117 | #modify_date=properties_dict.get('r_modify_date', ''), | 2118 | owner_name=properties_dict.get('owner_name', ''), |
2118 | location=properties_dict.get('b_location', ''), | 2119 | #input_date=properties_dict.get('b_input_date', ''), |
2119 | download_finish=False | 2120 | #modify_date=properties_dict.get('r_modify_date', ''), |
2120 | ) | 2121 | location=properties_dict.get('b_location', ''), |
2121 | return response.ok(data=False) | 2122 | download_finish=False |
2123 | ) | ||
2124 | except Exception as e: | ||
2125 | self.exception_log.exception('[SearchGBHistoryFileView] [db save failed] [error={0}]'.format(traceback.format_exc())) | ||
2126 | return response.ok(data=True) | ||
2122 | 2127 | ||
2123 | class DownloadGBHistoryFileView(GenericView): | 2128 | class DownloadGBHistoryFileView(GenericView): |
2124 | permission_classes = [IsAuthenticated] | 2129 | permission_classes = [IsAuthenticated] | ... | ... |
-
Please register or sign in to post a comment