def __init__(self,excel): self.excel=excel self.t = Tool() self.mt = MethodsTxt() self.code= "renbao" self.name= "中国人保" self.me = MethodExcel()
def __init__(self, excel): self.excel = excel self.t = Tool() self.mt = MethodsTxt() self.code = "pingan" self.name = "平安保险" self.me = MethodExcel()
def __init__(self, excel): self.excel = excel self.t = Tool() self.mt = MethodsTxt() self.code = "dadi" self.name = "大地保险公司" self.me = MethodExcel()
def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "zongceng" self.name = "众诚" self.me = MethodExcel()
def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "yingda" self.name = "英大" self.me = MethodExcel()
def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "taipingyang" self.name = "太平洋" self.me = MethodExcel()
def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "guoren" self.name = "国任" self.me = MethodExcel()
def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "rensou" self.name = "中国人寿" self.me = MethodExcel()
class Yongan: def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "yingda" self.name = "英大" self.me = MethodExcel() def bao_dan_hao(self, ws): cell = self.me.find_key_cell(ws, "保险单号") pat = r'保险单号(.*?)投保确认码' res = re.findall(pat, cell, flags=re.DOTALL) if len(res) > 0: res1 = self.t.date_format(res[0]) return res1 return "" def begin_end_date(self, ws): return "", "" def ce_pai_hao(self, ws): k = '号牌号码' res = self.me.find_key_cell_right(ws, k) return res def fa_dong_ji(self, ws): k = '发动机号码' res = self.me.find_key_cell_right(ws, k) return res def ce_jia_hao(self, ws): k = '车辆识别代码' res = self.me.find_key_cell_right(ws, k) return res def jin_e(self, ws): return "" def bei_bao_xian_ren(self, ws): return "" def ce_zu(self, ws): k = '行驶证车主:' res = self.me.find_key_cell(ws, k) if res == None: return "" return res.replace(k, "") def tou_bao_ren(self, ws): k = '本保单投保人:' res = self.me.find_key_cell(ws, k) if res == None: return "" return res.replace(k, "") def te_bie_tiao_kuan(self, ws): return ""
class Zongceng: def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "zongceng" self.name = "众诚" self.me = MethodExcel() def bao_dan_hao(self, ws): cell = self.me.find_key_cell(ws, "保险单号") pat = r'保险单号码(.*?)鉴于投保人' res = re.findall(pat, cell, flags=re.DOTALL) if len(res) > 0: res1 = self.t.date_format(res[0]) return res1 return "" def begin_end_date(self, ws): k = "0时0分" cell = self.me.find_key_row(ws, k) pat = r'自(.*?)0时0分起至(.*?)0时0' res = re.findall(pat, cell, flags=re.DOTALL) if res and len(res[0]) == 2: begin = res[0][0] end = res[0][1] return self.t.date_format(begin), self.t.date_format(end) return "", "" def ce_pai_hao(self, ws): k = '号牌号码' res = self.me.find_key_cell_right(ws, k) return res.replace("联系电话", "") def fa_dong_ji(self, ws): k = '发动机号' res = self.me.find_key_cell_right(ws, k) if len(res) > 10: return res[:-10] def ce_jia_hao(self, ws): k = '车架号' pat = r'车架号(.*?)$' cell = self.me.find_key_cell(ws, k) res = re.findall(pat, cell, flags=re.DOTALL) if len(res) > 0: return res[0][1:] def jin_e(self, ws): k = '保险费合计' cell = self.me.find_key_row(ws, k) pat = r'¥(.*?)元' res = re.findall(pat, cell, flags=re.DOTALL) if res == None: return "" if len(res) > 0: return self.t.clean(res[0]) def bei_bao_xian_ren(self, ws): k = '投保人被保险人' res = self.me.find_key_cell_right_origin(ws, k) if res == None: return "" l = res.split(" ") if len(l) >= 1: return l[1] def ce_zu(self, ws): k = '行驶证车主' res = self.me.find_key_cell_right_origin(ws, k) if res == None: return "" l = res.split("\n") if len(l) >= 2: return l[1] def tou_bao_ren(self, ws): k = '投保人被保险人' res = self.me.find_key_cell_right_origin(ws, k) if res == None: return "" l = res.split(" ") if len(l) >= 1: return l[0] def te_bie_tiao_kuan(self, ws): res = self.me.find_max_cell(ws) return res
class RenBao: def __init__(self,excel): self.excel=excel self.t = Tool() self.mt = MethodsTxt() self.code= "renbao" self.name= "中国人保" self.me = MethodExcel() def bao_dan_hao(self, ws): cell = self.me.find_key_cell(ws, "保险单号") pat = r'保险单号(.*?)鉴于投保人' res = re.findall(pat, cell, flags=re.DOTALL) if len(res) > 0: return self.t.date_format(res[0]) return "" def begin_end_date(self,ws): k="保险期间" cell = self.me.find_key_cell(ws, k) pat = r'自(.*?)0时起至(.*?)24时止' res = re.findall(pat, cell, flags=re.DOTALL) if res and len(res[0]) == 2: begin = res[0][0] end = res[0][1] return self.t.date_format(begin), self.t.date_format(end) return "","" def ce_pai_hao(self,ws): k='号牌号码' res=self.me.find_key_cell_right(ws,k) return res def fa_dong_ji(self, ws): k = '发动机号' res = self.me.find_key_cell_right(ws, k) return res def ce_jia_hao(self, ws): k = '车架号' res = self.me.find_key_cell_right(ws, k) return res def jin_e(self,ws): k = '保险费合计' cell=self.me.find_key_cell(ws,k) pat = r'¥:(.*?)元' res = re.findall(pat, cell, flags=re.DOTALL) if res == None : return "" return self.t.clean(res[0]) def bei_bao_xian_ren(self, ws): k = '被保险人' res = self.me.find_key_cell_right(ws,k) if res == None: return "" return self.t.clean(res) def ce_zu(self, ws): k = '车主' res = self.me.find_key_cell_right(ws, k) if res == None: return "" return self.t.clean(res) def tou_bao_ren(self, ws): pat = r'本保单投保人为:(.*?)$' k = '本保单投保人为' cell = self.me.find_key_cell(ws, k) res = re.findall(pat, cell, flags=re.DOTALL) if res == None: return "" return self.t.clean(res[0]) def te_bie_tiao_kuan(self, ws): return self.me.find_max_cell(ws)
class PinAn: def __init__(self, excel): self.excel = excel self.t = Tool() self.mt = MethodsTxt() self.code = "pingan" self.name = "平安保险" self.me = MethodExcel() def bao_dan_hao(self, ws): cell = self.me.find_key_cell(ws, "保险单号") pat = r'保险单号:(.*?)$' res = re.findall(pat, cell, flags=re.DOTALL) if len(res) > 0: res1 = self.t.clean(res[0]) return res1 return "" def begin_end_date(self, ws): k = ["00:00时", "24:00时止"] cell = self.me.find_keys_cell(ws, k) pat = r'自(.*?)00:00时起至(.*?)24:00时止' res = re.findall(pat, cell, flags=re.DOTALL) if res and len(res[0]) == 2: begin = res[0][0] end = res[0][1] return self.t.date_format(begin), self.t.date_format(end) return "", "" def ce_pai_hao(self, ws): k = '发动机号码' res = self.me.find_key_cell_left(ws, k) return res def fa_dong_ji(self, ws): k = '发动机号码' res = self.me.find_key_cell_right(ws, k) return res def ce_jia_hao(self, ws): k = '车架号' res = self.me.find_key_cell_right(ws, k) return res def jin_e(self, ws): k = '保险费合计' cell = self.me.find_key_cell_right(ws, k) pat = r'RMB(.*?)元' res = re.findall(pat, cell, flags=re.DOTALL) if res == None: return "" return self.t.clean(res[0]) def bei_bao_xian_ren(self, ws): k = '统一社会信用代码' pat = r'^名称:(.*?)证件' cell = self.me.find_key_cell(ws, k) res = re.findall(pat, cell, flags=re.DOTALL) if res == None: return "" s = res[0].replace("有限公", "有限公司") return self.t.clean(s) def ce_zu(self, ws): k = '行驶证车主' cell = self.me.find_key_cell_right(ws, k) return cell def tou_bao_ren(self, ws): return "" def te_bie_tiao_kuan(self, ws): k = '无其它特别约定' res = self.me.find_key_cell(ws, k) return res
class TaiPingYang: def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "taipingyang" self.name = "太平洋" self.me = MethodExcel() def bao_dan_hao(self, ws): cell = self.me.find_key_cell(ws, "保险单号") pat = r'保险单号(.*?)$' res = re.findall(pat, cell, flags=re.DOTALL) if len(res) > 0: res1 = self.t.date_format(res[0]) return res1 return "" def begin_end_date(self, ws): pdf = self.pdf k = "保险期间" pat = r'保险期间(.*?)00时起至(.*?)24时止' res = self.mt.find_key_pat_in_tab(pdf, k, pat) if res and len(res[0]) == 2: begin = res[0][0] end = res[0][1] return self.t.date_format(begin), self.t.date_format(end) return "", "" def ce_pai_hao(self, ws): pdf = self.pdf k = '号牌号码' pat = r'号牌号码(.*?)厂牌' res = self.mt.find_key_pat_in_tab(pdf, k, pat) if res == None or len(res) == 0: return "" s = self.t.clean(res[0]).replace(":", "").replace(":", "") return s def fa_dong_ji(self, ws): pdf = self.pdf k = '发动机号' pat = r'发动机号(.*?)初次' res = self.mt.find_key_pat_in_tab(pdf, k, pat) if res == None or len(res) == 0: return "" s = res[0] return s.replace(":", "") def ce_jia_hao(self, ws): pdf = self.pdf k = '车架号' res = self.mt.find_key_line_in_tab(pdf, k) l = res.split(k) s = l[-1].replace(":", "") return s def jin_e(self, ws): pdf = self.pdf k = '保险费合计' pat = r'¥:(.*?)元' res = self.mt.find_key_pat_in_tab(pdf, k, pat) if res == None: return "" return self.t.clean(res[0]) def bei_bao_xian_ren(self, ws): pdf = self.pdf k = '被保险人' pat = r'被保险人(.*?)手机号' res = self.mt.find_key_pat_in_tab(pdf, k, pat) if res == None: return "" return self.t.clean(res[0]) def ce_zu(self, ws): pdf = self.pdf pat = r'车主(.*?)投保人' k = '车主' res = self.mt.find_key_pat_in_tab(pdf, k, pat) if res == None: return "" return self.t.clean(res[0]) def tou_bao_ren(self, ws): pdf = self.pdf pat = r'投保人:(.*?)$' k = '投保人:' res = self.mt.find_key_pat_in_tab(pdf, k, pat) if res == None: return "" return self.t.clean(res[0]) def te_bie_tiao_kuan(self, ws): pdf = self.pdf pat = r'24时止(.*?)保险合同争议解决方式' res = self.mt.find_patter_in_txt(pdf, pat) return res
class GuoRen: def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "guoren" self.name = "国任" self.me = MethodExcel() def bao_dan_hao(self, ws): cell = self.me.find_key_cell(ws, "保险单号") pat = r'保险单号(.*?)$' res = re.findall(pat, cell, flags=re.DOTALL) if len(res) > 0: res1 = self.t.date_format(res[0]) return res1 return "" def begin_end_date(self, ws): k = "保险期间" cell = self.me.find_key_row(ws, k) pat = r'保险期间:(.*?)00分起至(.*?)00' res = re.findall(pat, cell, flags=re.DOTALL) if res and len(res[0]) == 2: begin = res[0][0] end = res[0][1] return self.t.date_format(begin), self.t.date_format(end) return "", "" def ce_pai_hao(self, ws): k = '号牌号码' res = self.me.find_key_cell(ws, k) res = res.replace(k, "") return self.t.date_format(res) def fa_dong_ji(self, ws): k = '发动机号' res = self.me.find_key_cell(ws, k) res = res.replace(k, "") return self.t.date_format(res) def ce_jia_hao(self, ws): k = 'VIN码/车架号' res = self.me.find_key_cell(ws, k) res = res.replace(k, "") return self.t.date_format(res) def jin_e(self, ws): k = '保险费合计' cell = self.me.find_key_cell(ws, k) pat = r'¥:(.*?)元' res = re.findall(pat, cell, flags=re.DOTALL) if res == None: return "" return self.t.clean(res[0]) def bei_bao_xian_ren(self, ws): k = '被保险人' res = self.me.find_key_cell(ws, k) res = res.replace(k, "") return self.t.date_format(res) def ce_zu(self, ws): k = '行驶证车主' res = self.me.find_key_cell(ws, k) res = res.replace(k, "") return self.t.date_format(res) def tou_bao_ren(self, ws): return "" def te_bie_tiao_kuan(self, ws): k = '特别约定' res = self.me.find_key_cell(ws, k) return res
class RenSou: def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "rensou" self.name = "中国人寿" self.me = MethodExcel() def bao_dan_hao(self, ws): pat = r'保险单号(.*?)鉴于投保人' res = self.mt.find_patter_in_txt(self.pdf, pat) return res.replace(":", "").replace(":", "") def begin_end_date(self, ws): k = "保险期间" cell = self.me.find_key_cell_right(ws, k) pat = r'自(.*?)00时00分起至(.*?)24时00分止' res = re.findall(pat, cell, flags=re.DOTALL) if res and len(res[0]) == 2: begin = res[0][0] end = res[0][1] return self.t.date_format(begin), self.t.date_format(end) return "", "" def ce_pai_hao(self, ws): k = '号牌号码' res = self.me.find_key_cell_right(ws, k) return res def fa_dong_ji(self, ws): k = '发动机号' res = self.me.find_key_cell_right(ws, k) return res def ce_jia_hao(self, ws): k = '车架号' res = self.me.find_key_cell_right(ws, k) return res def jin_e(self, ws): k = '保险费合计' cell = self.me.find_key_cell(ws, k) pat = r'¥:(.*?)元' res = re.findall(pat, cell, flags=re.DOTALL) if res == None: return "" return self.t.clean(res[0]) def bei_bao_xian_ren(self, ws): k = '姓名/名称' res = self.me.find_key_cell_right(ws, k) if res == None: return "" return self.t.clean(res) def ce_zu(self, ws): k = '行驶证车主' res = self.me.find_key_cell_right(ws, k) if res == None: return "" return self.t.clean(res) def tou_bao_ren(self, ws): pat = r'本保单投保人为:(.*?)$' k = '本保单投保人为' cell = self.me.find_key_cell(ws, k) res = re.findall(pat, cell, flags=re.DOTALL) if res == None: return "" return self.t.clean(res[0]) def te_bie_tiao_kuan(self, ws): pdf = self.t.excel2pdf(self.excel) pat = r'时00分止(.*?)保险合同争议解决方式' res = self.mt.find_patter_in_txt(pdf, pat) return res
class Zonghua: def __init__(self, excel): self.excel = excel self.t = Tool() self.pdf = self.t.excel2pdf(excel) self.mt = MethodsTxt() self.code = "zonghua" self.name = "中华" self.me = MethodExcel() def bao_dan_hao(self, ws): cell = self.me.find_key_cell_right(ws, "保险单号") return cell def begin_end_date(self, ws): k = "保险期间" cell = self.me.find_key_cell(ws, k) pat = r'自(.*?)0时0分起至(.*?)0时' res = re.findall(pat, cell, flags=re.DOTALL) if res and len(res[0]) == 2: begin = res[0][0] end = res[0][1] return self.t.date_format(begin), self.t.date_format(end) return "", "" def ce_pai_hao(self, ws): k = '号牌号码' res = self.me.find_key_cell_right(ws, k) return res def fa_dong_ji(self, ws): k = '发动机号' res = self.me.find_key_cell_right(ws, k) return res def ce_jia_hao(self, ws): k = '车架号' res = self.me.find_key_cell_right(ws, k) return res def jin_e(self, ws): k = '保险费合计' cell = self.me.find_key_row(ws, k) pat = r'¥:(.*?)元' res = re.findall(pat, cell, flags=re.DOTALL) if res == None: return "" return self.t.clean(res[0]) def bei_bao_xian_ren(self, ws): k = '被保险人' res = self.me.find_key_cell_right(ws, k) return res def ce_zu(self, ws): k = '行驶证车主' res = self.me.find_key_cell_right(ws, k) return res def tou_bao_ren(self, ws): return "" def te_bie_tiao_kuan(self, ws): k = '特别约定' res = self.me.find_key_cell_right(ws, k) return res