ba444224 by 冯轩

merge

2 parents 5998c15e af9a979b
...@@ -1601,7 +1601,7 @@ SE_HIL_CON_1_MAP = { ...@@ -1601,7 +1601,7 @@ SE_HIL_CON_1_MAP = {
1601 '合同编号-正文': (5, 4, 7, '合同编号(正文)', None), 1601 '合同编号-正文': (5, 4, 7, '合同编号(正文)', None),
1602 '车辆识别代码': (5, 4, 7, '车辆识别代码', None), 1602 '车辆识别代码': (5, 4, 7, '车辆识别代码', None),
1603 '车辆卖方': (5, 4, 7, '车辆卖方(经销商)', None), 1603 '车辆卖方': (5, 4, 7, '车辆卖方(经销商)', None),
1604 '车辆原始销售价格': (5, 4, 7, '车辆原始销售价格(《机动车销售统一发票》所列金额)', None), 1604 '车辆原始销售价格': (5, 4, 7, '车辆原始销售价格', None),
1605 '融资成本总额': (5, 4, 7, '融资成本总额', None), 1605 '融资成本总额': (5, 4, 7, '融资成本总额', None),
1606 '租期': (5, 4, 7, '租期', None), 1606 '租期': (5, 4, 7, '租期', None),
1607 '还款计划表': (5, 5, 7, '付款计划表', None), 1607 '还款计划表': (5, 5, 7, '付款计划表', None),
......
...@@ -108,11 +108,11 @@ class Command(BaseCommand, LoggerMixin): ...@@ -108,11 +108,11 @@ class Command(BaseCommand, LoggerMixin):
108 if zip_doc is None: 108 if zip_doc is None:
109 self.online_log.warn('{0} [zip_2_pdfs] [doc not exist] [task_str={1}]'.format( 109 self.online_log.warn('{0} [zip_2_pdfs] [doc not exist] [task_str={1}]'.format(
110 self.log_base, task_str)) 110 self.log_base, task_str))
111 return None, business_type 111 return None, business_type, None
112 elif zip_doc.status != DocStatus.INIT.value: 112 elif zip_doc.status != DocStatus.INIT.value:
113 self.online_log.warn('{0} [zip_2_pdfs] [doc status error] [task_str={1}] [doc_status={2}]'.format( 113 self.online_log.warn('{0} [zip_2_pdfs] [doc status error] [task_str={1}] [doc_status={2}]'.format(
114 self.log_base, task_str, zip_doc.status)) 114 self.log_base, task_str, zip_doc.status))
115 return None, business_type 115 return None, business_type, None
116 116
117 zip_doc.status = DocStatus.PROCESSING.value 117 zip_doc.status = DocStatus.PROCESSING.value
118 zip_doc.start_time = timezone.now() 118 zip_doc.start_time = timezone.now()
...@@ -120,7 +120,7 @@ class Command(BaseCommand, LoggerMixin): ...@@ -120,7 +120,7 @@ class Command(BaseCommand, LoggerMixin):
120 except Exception as e: 120 except Exception as e:
121 self.online_log.error('{0} [process error (zip_2_pdfs)] [error={1}]'.format( 121 self.online_log.error('{0} [process error (zip_2_pdfs)] [error={1}]'.format(
122 self.log_base, traceback.format_exc())) 122 self.log_base, traceback.format_exc()))
123 return None, None 123 return None, None, None
124 else: 124 else:
125 self.online_log.info('{0} [zip_2_pdfs] [db save end] [task_str={1}]'.format( 125 self.online_log.info('{0} [zip_2_pdfs] [db save end] [task_str={1}]'.format(
126 self.log_base, task_str)) 126 self.log_base, task_str))
...@@ -134,6 +134,7 @@ class Command(BaseCommand, LoggerMixin): ...@@ -134,6 +134,7 @@ class Command(BaseCommand, LoggerMixin):
134 business_type, doc_id_str = info_tuple 134 business_type, doc_id_str = info_tuple
135 classify_1_str = '0' 135 classify_1_str = '0'
136 rebuild_task_str = task_str 136 rebuild_task_str = task_str
137 re_ocr_flag = 'N'
137 else: 138 else:
138 business_type, doc_id_str, classify_1_str, re_ocr_flag = info_tuple 139 business_type, doc_id_str, classify_1_str, re_ocr_flag = info_tuple
139 rebuild_task_str = '{0}{1}{2}'.format(business_type, consts.SPLIT_STR, doc_id_str) 140 rebuild_task_str = '{0}{1}{2}'.format(business_type, consts.SPLIT_STR, doc_id_str)
...@@ -1813,7 +1814,7 @@ class Command(BaseCommand, LoggerMixin): ...@@ -1813,7 +1814,7 @@ class Command(BaseCommand, LoggerMixin):
1813 json_data_1['text_list'] = text_list 1814 json_data_1['text_list'] = text_list
1814 1815
1815 start_time = time.time() 1816 start_time = time.time()
1816 #self.online_log.info('{0} [ocr_1 api] [img={1}] [json_data_1={2}]'.format(self.log_base, img_path, json_data_1)) 1817 # self.online_log.info('{0} [ocr_1 api] [img={1}] [json_data_1={2}]'.format(self.log_base, img_path, json_data_1))
1817 ocr_1_response = requests.post(url, json=json_data_1) 1818 ocr_1_response = requests.post(url, json=json_data_1)
1818 if ocr_1_response.status_code != 200: 1819 if ocr_1_response.status_code != 200:
1819 raise OCR1Exception('ocr_1 status code: {0}'.format(ocr_1_response.status_code)) 1820 raise OCR1Exception('ocr_1 status code: {0}'.format(ocr_1_response.status_code))
...@@ -1824,7 +1825,7 @@ class Command(BaseCommand, LoggerMixin): ...@@ -1824,7 +1825,7 @@ class Command(BaseCommand, LoggerMixin):
1824 else: 1825 else:
1825 self.online_log.info('{0} [ocr_1 start] [img={1}] [url={2}]'.format(self.log_base, img_path, url)) 1826 self.online_log.info('{0} [ocr_1 start] [img={1}] [url={2}]'.format(self.log_base, img_path, url))
1826 ocr_1_res = ocr_1_response.json() 1827 ocr_1_res = ocr_1_response.json()
1827 #self.online_log.info('{0} [ocr_1 api res] [img={1}] [ocr_1_res={2}]'.format(self.log_base, img_path, ocr_1_res)) 1828 # self.online_log.info('{0} [ocr_1 api res] [img={1}] [ocr_1_res={2}]'.format(self.log_base, img_path, ocr_1_res))
1828 end_time = time.time() 1829 end_time = time.time()
1829 speed_time = int(end_time - start_time) 1830 speed_time = int(end_time - start_time)
1830 self.online_log.info('{0} [ocr_1 success] [img={1}] [url={2}] [speed_time={3}]'.format( 1831 self.online_log.info('{0} [ocr_1 success] [img={1}] [url={2}] [speed_time={3}]'.format(
......
...@@ -61,7 +61,7 @@ class Finder: ...@@ -61,7 +61,7 @@ class Finder:
61 "合同编号(正文)": self.item, 61 "合同编号(正文)": self.item,
62 "车辆识别代码": self.item, 62 "车辆识别代码": self.item,
63 "车辆卖方(经销商)": self.item, 63 "车辆卖方(经销商)": self.item,
64 "车辆原始销售价格(《机动车销售统一发票》所列金额)": self.item, 64 "车辆原始销售价格": self.item,
65 "车辆附加产品明细表": self.item, 65 "车辆附加产品明细表": self.item,
66 "融资成本总额": self.item, 66 "融资成本总额": self.item,
67 "租期": self.item, 67 "租期": self.item,
...@@ -1264,8 +1264,8 @@ class Finder: ...@@ -1264,8 +1264,8 @@ class Finder:
1264 self.init_result['车辆卖方(经销商)'] = seller 1264 self.init_result['车辆卖方(经销商)'] = seller
1265 # 找到 —— 车辆原始销售价格 1265 # 找到 —— 车辆原始销售价格
1266 vehicle_price = self.get_key_value( 1266 vehicle_price = self.get_key_value(
1267 key='车辆原始销售价格(《机动车销售统一发票》所列金额):') 1267 key='车辆原始销售价格:')
1268 self.init_result['车辆原始销售价格(《机动车销售统一发票》所列金额)'] = vehicle_price 1268 self.init_result['车辆原始销售价格'] = vehicle_price
1269 # 找车辆附加产品明细(表) 1269 # 找车辆附加产品明细(表)
1270 table_add_product = self.get_table_add_product() 1270 table_add_product = self.get_table_add_product()
1271 self.init_result['车辆附加产品明细表'] = table_add_product 1271 self.init_result['车辆附加产品明细表'] = table_add_product
......
...@@ -52,7 +52,7 @@ class Finder: ...@@ -52,7 +52,7 @@ class Finder:
52 "车辆识别代码": self.item, 52 "车辆识别代码": self.item,
53 "车辆卖方(经销商)": self.item, 53 "车辆卖方(经销商)": self.item,
54 "车辆代理商": self.item, 54 "车辆代理商": self.item,
55 "车辆原始销售价格(《机动车销售统一发票》所列金额)": self.item, 55 "车辆原始销售价格": self.item,
56 "车辆附加产品明细表": self.item, 56 "车辆附加产品明细表": self.item,
57 "融资成本总额": self.item, 57 "融资成本总额": self.item,
58 "租期": self.item, 58 "租期": self.item,
...@@ -1330,8 +1330,8 @@ class Finder: ...@@ -1330,8 +1330,8 @@ class Finder:
1330 cldls = self.get_key_value(key='车辆代理商', page_num='4') 1330 cldls = self.get_key_value(key='车辆代理商', page_num='4')
1331 self.init_result['车辆代理商'] = cldls 1331 self.init_result['车辆代理商'] = cldls
1332 # 找到 —— 车辆原始销售价格 1332 # 找到 —— 车辆原始销售价格
1333 vehicle_price = self.get_key_value(key='车辆原始销售价格(《机动车销售统一发票》所列金额):') 1333 vehicle_price = self.get_key_value(key='车辆原始销售价格:')
1334 self.init_result['车辆原始销售价格(《机动车销售统一发票》所列金额)'] = vehicle_price 1334 self.init_result['车辆原始销售价格'] = vehicle_price
1335 # 找车辆附加产品明细(表) 1335 # 找车辆附加产品明细(表)
1336 table_add_product = self.get_table_add_product() 1336 table_add_product = self.get_table_add_product()
1337 self.init_result['车辆附加产品明细表'] = table_add_product 1337 self.init_result['车辆附加产品明细表'] = table_add_product
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!