Exemplo n.º 1
0
    def name(self, data):
        information = {}
        for i, singledata in enumerate(data):
            uuid = singledata["annlFwarnntId"]
            creditor = singledata["more"]
            debtor = singledata["mortgagor"]
            cates = singledata["priClaSecKindInterpreted"]

            amount = singledata["priClaSecAm"]
            if 'pefPerForm' in singledata.keys():
                pefPerForm = singledata["pefPerForm"]
                pefPerForm = change_chinese_date(pefPerForm)
            else:
                pefPerForm = ''
            if "pefPerTo" in singledata.keys():
                pefPerTo = singledata["pefPerTo"]
                pefPerTo = change_chinese_date(pefPerTo)
            else:
                pefPerTo = ''

            deadline = str(pefPerForm) + '至' + str(pefPerTo)
            period = singledata["guaranPeriodInterpreted"]
            ways = singledata["gaTypeInterpreted"]
            if_fwarnnt = int(singledata["fwarnntSign"])
            information[i] = [
                uuid, creditor, debtor, cates, amount, deadline, period, ways,
                if_fwarnnt
            ]
        return information
Exemplo n.º 2
0
 def name(self, data):
     information = {}
     if len(data) > 0:
         for i, singledata in enumerate(data):
             number = singledata["penDecNo"]
             if "illegActType" in data.keys():
                 types = singledata["illegActType"]
             elif "illegAct" in data.keys():
                 types = singledata["illegAct"]
             if "penPunishCon" in singledata.keys():
                 content = singledata["penPunishCon"]
             else:
                 content = ''
             if 'penDecissDate' in singledata.keys():
                 date = singledata["penDecissDate"]
                 date = deal_html_code.change_chinese_date(date)
             else:
                 date = '0000-00-00'
             if "noticeDate" in singledata.keys():
                 updateDate = singledata["noticeDate"]
                 pub_date = deal_html_code.change_chinese_date(updateDate)
             else:
                 pub_date = '0000-00-00'
             if "penOrgan" in singledata.keys():
                 gov_dept = singledata["penOrgan"]
             else:
                 gov_dept = ''
             name = ''
             information[i] = [
                 number, types, content, date, name, gov_dept, pub_date
             ]
     return information
Exemplo n.º 3
0
    def name(self, data):
        information = {}
        for i, singledata in enumerate(data):
            types = '黑名单'
            if "bulletinListed" in singledata.keys():
                in_reason = singledata["bulletinListed"]
                in_reason = deal_html_code.remove_symbol(in_reason)
            else:
                in_reason = ''
            if "abnTime" in singledata.keys():
                in_date = singledata["abnTime"]
                in_date = change_chinese_date(in_date)
            else:
                in_date = '0000-00-00'
            if "bulletinRemoved" in singledata.keys():
                out_reason = singledata["bulletinRemoved"]
                out_reason = deal_html_code.remove_symbol(out_reason)
            else:
                out_reason = ''

            if "remTime" in singledata.keys():
                out_date = singledata["remTime"]
                out_date = change_chinese_date(out_date)
            else:
                out_date = '0000-00-00'
            if "remOrganInterpreted" in singledata.keys():
                gov_dept = singledata["remOrganInterpreted"]
            else:
                gov_dept = ''
            information[i] = [
                types, in_reason, in_date, out_reason, out_date, gov_dept
            ]
        return information
Exemplo n.º 4
0
    def name(self,data):
        information = {}
        for i in xrange(len(data)):
            singledata = data[i]
            types = '经营异常'
            if "speCauseInterpreted" in singledata.keys():
                in_reason = singledata["speCauseInterpreted"]
            else:
                in_reason = ''
            if 'abnTime' in singledata.keys():
                in_date = singledata["abnTime"]
                in_date = deal_html_code.change_chinese_date(in_date)
            else:
                in_date = '0000-00-00'

            if "remExcpResInterpreted" in singledata.keys():
                out_reason = singledata["remExcpResInterpreted"]
                out_reason = deal_html_code.remove_symbol(out_reason)
            else:
                out_reason = ''
            if 'remDate' in singledata.keys():
                out_date = singledata["remDate"]
                out_date = deal_html_code.change_chinese_date(out_date)
            else:
                out_date = '0000-00-00'
            if "decOrgInterpreted" in singledata.keys():
                gov_dept = singledata["decOrgInterpreted"]
            else:
                gov_dept = ''
            information[i] = [types, in_reason, in_date, out_reason, out_date, gov_dept]
        return information
Exemplo n.º 5
0
    def name(self,data,province):
        informaiton = {}
        for i ,singledata  in enumerate(data):
            code = singledata["morRegCno"]
            if "regDate" in singledata.keys():
                dates = singledata["regDate"]
                dates = deal_html_code.change_chinese_date(dates)
            else:
                dates = '0000-00-00'
            if "regOrgInterpreted" in singledata.keys():
                dept = singledata["regOrgInterpreted"]
            else:
                dept = ''
            if "priclasecAm" in singledata.keys():
                amount = singledata["priclasecAm"]
            else:
                amount = ''
            if "typeInterpreted" in singledata.keys():
                status = singledata["typeInterpreted"]
            else:
                status = ''
            uuid = singledata["uuid"]
            if "priclasecKind" in singledata.keys():
                cates = singledata["priclasecKind"]
            else:
                cates = ''
            if "pefperForm" in singledata.keys():
                begin = deal_html_code.change_chinese_date(singledata["pefperForm"])
                end = deal_html_code.change_chinese_date(singledata["pefperTo"])
                if begin == '' and end == '':
                    period = ''
                else:
                    period = begin+'至'+end
            else:
                period = ''
            if "warCov" in singledata.keys():
                ranges = singledata["warCov"]
            else:
                ranges = ''
            if "remark" in singledata.keys():
                remark = singledata["remark"]
            else:
                remark = ''
            url = mort_url[province].format(uuid)

            info = requests.get(url).content
            info = json.loads(info)
            if "entMortgageMorSet" in info.keys():
                person_info = self.get_single_person(info["entMortgageMorSet"])
            else:
                person_info = {}
            if "entMortgageGuaSet" in info.keys():
                goods_info = self.get_single_goods(info["entMortgageGuaSet"])
            else:
                goods_info = {}
            # print person_info
            informaiton[i] = [code, dates, dept, amount, status, cates, period, ranges, remark, goods_info, person_info]
        return informaiton
Exemplo n.º 6
0
    def name(self,data):
        information = {}
        for i in xrange(len(data)):
            singledata = data[i]
            if "pledgeNo" in singledata.keys():
                equityNo = singledata["pledgeNo"]
            else:
                equityNo = ''
            if "impAm" in singledata.keys():
                impAm = singledata["impAm"]
            else:
                impAm = ''
            if "impOrgName" in singledata.keys():
                impOrg = singledata["impOrgName"]
            else:
                impOrg = ''
            
            if "impBlicNo" in singledata.keys():
                impOrgBLicNo = singledata["impBlicNo"]
            else:
                impOrgBLicNo = ''
            # impOrgBLicType_CN = singledata["impOrgBLicType_CN"]
            # impOrgId = singledata["impOrgId"]
            # pledAmUnit = singledata["pledAmUnit"]
            if 'intBlicNo' in singledata.keys():
                pledBLicNo = singledata["intBlicNo"]
            else:
                pledBLicNo = ''
            # pledBLicType_CN = singledata["pledBLicType_CN"]
            if "intName" in singledata.keys():
                pledgor = singledata["intName"]
            else:
                pledgor = ''
            if "impTypeInterpreted" in singledata.keys():
                type = singledata["impTypeInterpreted"]
            else:
                type = ''
            if "equPleDate" in singledata.keys():
                equPleDate = singledata["equPleDate"]
                equPleDate = deal_html_code.change_chinese_date(equPleDate)
            else:
                equPleDate = '0000-00-00'

            if "publicDate" in singledata.keys():
                publicDate = singledata["publicDate"]
            else:
                publicDate = '0000-00-00'
            publicDate = deal_html_code.change_chinese_date(publicDate)
            information[i] = [equityNo, pledgor, pledBLicNo, impAm, impOrg, impOrgBLicNo, equPleDate, publicDate, type]
        return information
Exemplo n.º 7
0
    def deal_detail_content(self, detail_url):
        result = requests.get(detail_url)
        status_code = result.status_code
        result = result.content
        if status_code == 200:
            if len(result) != 0:
                data = json.loads(result)["entBlackList"][0]
                if "executeItemInterpreted" in data.keys():
                    items = data["executeItemInterpreted"]
                else:
                    items = ''
                if "froDocNo" not in data.keys():
                    rule_no = data["executeNo"]
                elif "executeNo" in data.keys():
                    rule_no = data["froDocNo"]
                else:
                    rule_no = ''
                if "executeNo" in data.keys():
                    enforce_no = data["executeNo"]
                else:
                    enforce_no = ''
                if "cerType" in data.keys():
                    cert_cate = data["cetfTypeInterpreted"]
                    cert_code = data["cerNo"]
                elif "blicType" in data.keys():
                    cert_cate = data["blicTypeInterpreted"]
                    cert_code = data["blicNo"]
                if "froFrom" in data.keys():
                    start_date = data["froFrom"]
                    start_date = deal_html_code.change_chinese_date(start_date)
                else:
                    start_date = None
                if "froTo" in data.keys():
                    end_date = data["froTo"]
                    end_date = deal_html_code.change_chinese_date(end_date)
                else:
                    end_date = None
                if "frozDeadline" in data.keys():
                    period = data["frozDeadline"]
                else:
                    period = None
                if "publicDate" in data.keys():
                    pub_date = data["publicDate"]
                    pub_date = deal_html_code.change_chinese_date(pub_date)
                else:
                    pub_date = None

        return items, rule_no, enforce_no, cert_cate, cert_code, start_date, end_date, period, pub_date
Exemplo n.º 8
0
    def name(self, data):
        information = {}
        for i in xrange(len(data)):
            singledata = data[i]
            name = ''
            if 'licNo' in singledata.keys():
                code = singledata["licNo"]
            else:
                code = ''
            if "licName" in singledata.keys():
                filename = singledata["licName"]
            else:
                filename = ''
            if "valFrom" in singledata.keys():
                start_date = singledata["valFrom"]
                start_date = deal_html_code.change_chinese_date(start_date)
            else:
                start_date = '0000-00-00'
            if "valTo" in singledata.keys():
                end_date = singledata["valTo"]
                end_date = deal_html_code.change_chinese_date(end_date)
            else:
                end_date = '0000-00-00'

            if "licItem" in singledata.keys():
                content = singledata["licItem"]
            else:
                content = ''
            if 'licAuth' in singledata.keys():
                gov_dept = singledata["licAuth"]
            else:
                gov_dept = ''
            if "typeInterpreted" in singledata.keys():
                status = singledata["typeInterpreted"]
            else:
                status = ''
            entShrpmtAltItemSet = singledata["entShrpmtAltItemSet"]
            if len(entShrpmtAltItemSet) == 0:
                logging.info('暂无行政许可变更信息!!!')
                alter_info = {}
            else:
                alter_info = singledata["entShrpmtAltItemSet"]

            information[i] = [
                name, code, filename, start_date, end_date, content, gov_dept,
                status, alter_info
            ]
        return information
Exemplo n.º 9
0
 def name(self, data):
     information = {}
     if len(data) > 0:
         for i, singledata in enumerate(data):
             number = singledata["penDecNo"]
             if "illegActType" in singledata.keys():
                 types = singledata["illegActType"]
             elif "illegAct" in singledata.keys():
                 types = singledata["illegAct"]
             content = singledata["penPunishCon"]
             date = singledata["penDecissDate"]
             date = deal_html_code.change_chinese_date(date)
             # updateDate = singledata["updateDate"]
             pub_date = '0000-00-00'
             pdfurl = singledata["penFilePath"]
             name = singledata["illegPt"]
             gov_dept = singledata["penOrgan"]
             regNo = singledata["regNo"]
             if "uniScid" in singledata.keys():
                 uniScid = singledata["uniScid"]
                 provin = deal_html_code.judge_province(uniScid)
             else:
                 provin = deal_html_code.judge_province(regNo)
             pdfurl = pdf_path[provin] % pdfurl
             information[i] = [
                 number, types, content, date, name, gov_dept, pdfurl,
                 pub_date
             ]
     return information
Exemplo n.º 10
0
 def name(self,data):
     information = {}
     for i,singledata in enumerate(data):
         # nodeNum = singledata["nodeNum"]
         ia_zch = singledata["regNum"]
         if "intCls" in singledata.keys():
             ia_flh = singledata["intCls"]
         else:
             ia_flh = ''
         if "regAnncIssue" in singledata.keys():
             ia_zcgg = singledata["regAnncIssue"]
         else:
             ia_zcgg = ''
         if "goodsCnName" in singledata.keys():
             ia_servicelist = deal_html_code.remove_symbol(singledata["goodsCnName"])
         else:
             ia_servicelist = ''
         if "propertyBgnDate" in singledata.keys():
             begin = singledata["propertyBgnDate"]
             begin = deal_html_code.change_chinese_date(begin)
         else:
             begin = ''
         if "propertyEndDate" in singledata.keys():
             end = singledata["propertyEndDate"]
             end = deal_html_code.change_chinese_date(end)
         else:
             end = ''
         if "uniScid" in singledata.keys():
             regNo = singledata["uniScid"]
         else:
             regNo = singledata["regNo"]
         province = judge_province(regNo)
         if begin== '' and end =='':
             ia_zyqqx = ''
         else:
             ia_zyqqx = begin + '至' + end
         if "regAnncDate" in singledata.keys():
             ia_zcdate = singledata["regAnncDate"]
             ia_zcdate = deal_html_code.change_chinese_date(ia_zcdate)
         else:
             ia_zcdate = ''
         if "tmImage" in singledata.keys():
             tmImage = singledata["tmImage"]
         else:
             tmImage = ''
         information[i] = [ia_zch, ia_flh, ia_zcgg, ia_servicelist, ia_zyqqx, ia_zcdate,province,tmImage]
     return information
Exemplo n.º 11
0
 def get_alter_permit(self, info):
     information = {}
     for i, singledata in enumerate(info):
         alt_name = singledata["altName"]
         alt_date = singledata["altDate"]
         alt_date = deal_html_code.change_chinese_date(alt_date)
         if "altAf" in singledata.keys():
             alt_af = singledata["altAf"]
         else:
             alt_af = ''
         if "altBe" in singledata.keys():
             alt_be = singledata["altBe"]
         else:
             alt_be = ''
         information[i] = [alt_name, alt_date, alt_af, alt_be]
     return information
Exemplo n.º 12
0
    def name(self, data):
        information = {}
        for i, singledata in enumerate(data):

            uuid = singledata["annlPermitId"]
            if "licNameInterpreted" in singledata.keys():
                types = singledata["licNameInterpreted"]
            else:
                types = ''
            if "valTo" in singledata.keys():
                valto = singledata["valTo"]
                valto = change_chinese_date(valto)
            else:
                valto = '0000-00-00'

            information[i] = [uuid, types, valto]
        return information
Exemplo n.º 13
0
    def deal_info(self, item):
        info = {}
        href = item.xpath("./@href")[0]
        url = url_first + href
        company = item.xpath('./h1[@class="f20"]')[0].xpath('string(.)')
        company = remove_symbol(company)
        status = item.xpath('./div[@class="wrap-corpStatus"]')[0].xpath(
            'string(.)')
        status = remove_symbol(status)
        code = item.xpath('.//div[@class="div-map2"]')[0].xpath('string(.)')
        code = remove_symbol(code)
        # print code
        if len(code.split(':')) == 2:
            code = code.split(':')[1]
        else:
            code = code.split(':')[1]

        daibiao = item.find('.//div[@class="div-user2"]').xpath('string(.)')
        daibiao = remove_symbol(daibiao)
        dates = item.find('.//div[@class="div-info-circle2"]').xpath(
            'string(.)')
        dates = remove_symbol(dates)
        dates = dates.split(':')[1]
        dates = change_chinese_date(dates)
        history_name = item.xpath('.//div[@class="div-info-circle3"]')

        if len(history_name) != 0:
            history = item.xpath(
                './/div[@class="div-info-circle3"]/span[@class="g3"]'
            )[0].xpath('string(.)')
        else:
            history = None
        history = remove_symbol(history)
        if history != None:
            list = re.split(';', str(history))
            templist = []
            for k, temp in enumerate(list):
                if temp != u'':
                    templist.append(temp)
            history = ';'.join(templist)

        info[code] = [url, company, status, code, daibiao, dates, history]
        return info
Exemplo n.º 14
0
 def get_index(self, string, province):
     first_url = config.url_list[province].format(string)
     result = requests.get(first_url)
     status_code = result.status_code
     result = result.content
     second_url_list = {}
     if status_code == 200:
         info = json.loads(result)["info"]
         if len(info) != 0:
             info = json.loads(result)["info"]
             for i, single in enumerate(info):
                 uuid = single["uuid"]
                 url = config.detail_list[province].format(uuid)
                 legal_person = single["lerep"]
                 status = single["opState"]
                 if "uniScid" in single.keys():
                     ccode = single["uniScid"]
                     if ccode == None:
                         ccode = ''
                 else:
                     ccode = ''
                 dates = single["estDate"]
                 dates = deal_html_code.change_chinese_date(dates)
                 if "regNo" in single.keys():
                     code = single["regNo"]
                     if code == None:
                         code = ''
                 else:
                     code = ''
                 company = single["entName"]
                 second_url_list[i] = [
                     url, company, legal_person, status, ccode, dates, code,
                     province
                 ]
             flag = 1
         else:
             flag = 100000003
     else:
         flag = 100000001
     return second_url_list, flag
Exemplo n.º 15
0
 def name(self, data):
     information = {}
     for i, singledata in enumerate(data):
         if "insTypeInterpreted" in singledata.keys():
             types = singledata["insTypeInterpreted"]
         else:
             types = ''
         if 'insResInterpreted' in singledata.keys():
             result = singledata["insResInterpreted"]
         else:
             result = ''
         if "insDate" in singledata.keys():
             check_date = singledata["insDate"]
             check_date = deal_html_code.change_chinese_date(check_date)
         else:
             check_date = '0000-00-00'
         if "insAuthInterpreted" in singledata.keys():
             gov_dept = singledata["insAuthInterpreted"]
         else:
             gov_dept = ''
         information[i] = [types, result, check_date, gov_dept]
     return information
Exemplo n.º 16
0
 def name(self, data):
     info = {}
     if len(data) > 0:
         for i, single in enumerate(data):
             if "altBe" in single.keys():
                 content_before = single["altBe"]
             else:
                 content_before = ''
             if "altAf" in single.keys():
                 content_after = single["altAf"]
             else:
                 content_after = ''
             if "altDate" in single.keys():
                 change_date = single["altDate"]
                 change_date = deal_html_code.change_chinese_date(
                     change_date)
             else:
                 change_date = '0000-00-00'
             if "altItem" in single.keys():
                 item = single["altItem"]
             else:
                 item = ""
             info[i] = [content_before, content_after, change_date, item]
     return info
Exemplo n.º 17
0
    def name(self, data):
        information = {}
        for i, singledata in enumerate(data):
            uuid = singledata["annlStocktransId"]
            if "invBe" in singledata.keys():
                name = singledata["invBe"]
            else:
                name = ''
            if "transamProBe" in singledata.keys():
                percent_pre = singledata["transamProBe"]
            else:
                percent_pre = ''
            if "transamProAf" in singledata.keys():
                percent_after = singledata["transamProAf"]
            else:
                percent_after = ''
            if "altDate" in singledata.keys():
                dates = singledata["altDate"]
                dates = change_chinese_date(dates)
            else:
                dates = '0000-00-00'

            information[i] = [name, percent_pre, percent_after, dates, uuid]
        return information
Exemplo n.º 18
0
    def name(self, data):
        information = {}

        for i, singledata in enumerate(data):

            uuid = singledata["annlInvestorId"]
            name = singledata["inv"]
            if len(singledata["entAnnlInvtSet"]) != 0:
                entAnnlInvtSet = singledata["entAnnlInvtSet"][0]
                if "subConAm" in entAnnlInvtSet.keys():
                    reg_amount = entAnnlInvtSet["subConAm"]
                else:
                    reg_amount = ''
                if 'conDate' in entAnnlInvtSet.keys():
                    reg_date = entAnnlInvtSet["conDate"]
                    reg_date = change_chinese_date(reg_date)
                else:
                    reg_date = ''
                if "conFormInterpreted" in entAnnlInvtSet.keys():
                    reg_way = entAnnlInvtSet["conFormInterpreted"]
                else:
                    reg_way = ''
                if "currency" in entAnnlInvtSet.keys():
                    unit = entAnnlInvtSet["currency"]
                else:
                    unit = ''
            else:
                reg_amount = ''
                reg_date = '0000-00-00'
                reg_way = ''

            if len(singledata["entAnnlInvtactlSet"]) != 0:
                entAnnlInvtactlSet = singledata["entAnnlInvtactlSet"][0]
                if "acConAm" in entAnnlInvtactlSet.keys():
                    ac_amount = entAnnlInvtactlSet["acConAm"]
                else:
                    ac_amount = ''
                if "conDate" in entAnnlInvtactlSet.keys():
                    ac_date = entAnnlInvtactlSet["conDate"]
                    ac_date = change_chinese_date(ac_date)
                else:
                    ac_date = ''
                if "conFormInterpreted" in entAnnlInvtactlSet.keys():
                    ac_way = entAnnlInvtactlSet["conFormInterpreted"]
                else:
                    ac_way = ''
                if "currency" in entAnnlInvtactlSet.keys():
                    unit = entAnnlInvtactlSet["currency"]
                else:
                    unit = ''

            else:
                ac_amount = ''
                ac_date = ''
                ac_way = ''

            information[i] = [
                name, uuid, reg_amount, reg_date, reg_way, ac_amount, ac_date,
                ac_way, unit
            ]
        return information
Exemplo n.º 19
0
    def get_all_info(self, url):
        information = {}
        result = requests.get(url).content

        data = json.loads(result)

        if "regNo" in data.keys():
            code = data["regNo"]

        else:
            code = ''
        if "uniScid" in data.keys():
            ccode = data["uniScid"]

        else:
            ccode = ''
        uuid = data["annlId"]
        name = data["entName"]
        if len(data["entAnnlEtpsSet"]) != 0:
            entAnnlEtps = data["entAnnlEtpsSet"][0]
            if 'tel' in entAnnlEtps.keys():
                tel = entAnnlEtps["tel"]
            else:
                tel = ''

            if 'email' in entAnnlEtps.keys():
                email = entAnnlEtps["email"]
            else:
                email = ''
            if 'postalCode' in entAnnlEtps.keys():
                postcode = entAnnlEtps["postalCode"]
            else:
                postcode = ''
            if 'ifInvest' in entAnnlEtps.keys():
                if_invest = int(entAnnlEtps["ifInvest"])
            else:
                if_invest = 0
            if 'ifStocktrans' in entAnnlEtps.keys():
                if_sharetrans = int(entAnnlEtps["ifStocktrans"])
            else:
                if_sharetrans = 0
        else:
            tel = ''
            email = ''
            postcode = ''
            if_invest = 0
            if_sharetrans = 0
        if "hasFwarnnt" in data.keys():
            if_fwarnnt = data["hasFwarnnt"]
        else:
            if_fwarnnt = 0
        if "addr" in data.keys():
            address = data["addr"]
        else:
            address = ''
        status = data["opStateInterpreted"]
        if len(data["entAnnlEmployeeSet"]) != 0:
            employees = data["entAnnlEmployeeSet"][0]
            employee = employees["empNum"]
            if_empnum = int(employees["empNumSign"])
        else:
            employee = ''
            if_empnum = 0
        if "womEmpNum" in data.keys():
            womennum = data["womEmpNum"]
            if_womennum = int(data["womEmpNumSign"])
        else:
            womennum = ''
            if_womennum = 0
        if "holdingsMsg" in data.keys():
            holding = data["holdingsMsg"]
            holding = config.holding[holding]
            if_holding = int(data["holdingsMsgSign"])
        else:
            holding = ''
            if_holding = 0
        if "mainBusiact" in data.keys():
            mainbus = data["mainBusiact"]
            mainbus = deal_html_code.remove_symbol(mainbus)
        else:
            mainbus = ''
        if "priPid" in data.keys():
            pripid = data["priPid"]
        else:
            pripid = ''
        refuuid = data["refUuid"]
        if "hasWebsite" in data.keys():
            if_website = int(data["hasWebsite"])
        else:
            if_website = 0
        if "ifNet" in data.keys():
            if_net = int(data["ifNet"])
        else:
            if_net = 0
        if "reportMode" in data.keys():
            report_mode = data["reportMode"]
        else:
            report_mode = ''
        if "reportType" in data.keys():
            types = config.company_type[data["reportType"]]
        else:
            types = ''
        if len(data["entAnnlPeSet"]) != 0:
            entAnnlPeSet = data["entAnnlPeSet"][0]
            if "psnName" in entAnnlPeSet.keys():
                runner = entAnnlPeSet["psnName"]
            else:
                runner = ''
            if "fundAm" in entAnnlPeSet.keys():
                amount = entAnnlPeSet["fundAm"]
            if "tel" in entAnnlPeSet.keys():
                tel = entAnnlPeSet["tel"]
            else:
                tel = ''
        else:
            runner = ''
            amount = ''
        fill_date = data["anCheDate"]
        fill_date = deal_html_code.change_chinese_date(fill_date)
        information[0] = [
            name, uuid, tel, address, email, postcode, status, employee,
            if_empnum, womennum, if_womennum, holding, if_holding, mainbus,
            code, ccode, pripid, refuuid, if_invest, if_sharetrans, if_fwarnnt,
            if_website, if_net, report_mode, types, runner, amount, province,
            fill_date
        ]
        runinfo = data["entAnnlRunSet"]
        assureinfo = data["entAnnlFwarnntSet"]
        investinfo = data["entAnnlOutinvSet"]
        labinfo = data["entAnnlSocSet"]
        permitinfo = data["entAnnlPermitSet"]
        partyinfo = data["entAnnlPartySet"]
        schangeinfo = data["entAnnlStocktransSet"]
        shareinfo = data["entAnnlInvestorSet"]
        webinfo = data["entAnnlWebsiteSet"]
        return information, runinfo, assureinfo, investinfo, labinfo, permitinfo, partyinfo, schangeinfo, shareinfo, webinfo
Exemplo n.º 20
0
 def name(self,data):
     info = {}
     if len(data)!=0:
         for i,single in enumerate(data):
             if "invName" in single.keys():
                 name = single["invName"]
             else:
                 name = ''
             if "invTypeInterpreted" in single.keys():
                 types = single["invTypeInterpreted"]
             else:
                 types = ''
             if single["blicTypeInterpreted"]=='':
                 license_code = ''
                 license_type = ''
             elif single["cetfTypeInterpreted"] =='':
                 license_type = ''
                 license_code = ''
             elif single["blicTypeInterpreted"]!='':
                 license_type = single["blicTypeInterpreted"]
                 license_code = single["bLicNo"]
                 license_code = deal_html_code.remove_symbol(license_code)
             elif single["cetfTypeInterpreted"]:
                 license_type = single["cetfTypeInterpreted"]
                 license_code = single["cetfId"]
             encrypted = single["encrypted"]
             if "cetfType" in single.keys():
                 cetfType = single["cetfType"]
             elif "bLicType" in single.keys():
                 cetfType = single["bLicType"]
             else:
                 cetfType = ''
             if "subconAm" in single.keys():
                 reg_amount = single["subconAm"]
             else:
                 reg_amount = ''
             if "acconAm" in single.keys():
                 true_amount = single["acconAm"]
             else:
                 true_amount = ''
             if "conDate" in single.keys():
                 ta_date = single["conDate"]
                 ta_date = deal_html_code.change_chinese_date(ta_date)
             else:
                 ta_date = '0000-00-00'
             if "conForm" in single.keys():
                 ta_ways = single["conForm"]
             else:
                 ta_ways = ''
             if ta_ways == '1':
                 ta_ways = '货币'
             if "countryInterpreted" in single.keys():
                 country = single["countryInterpreted"]
             else:
                 country = ''
             if "dom" in single.keys():
                 address = single["dom"]
             else:
                 address = ''
             info[i] = [name,types,license_code,license_type,reg_amount,true_amount,ta_date,ta_ways,country,address,encrypted,cetfType]
     return info
Exemplo n.º 21
0
    def name(self,data):
        info = []
        name = data["entName"]
        if "uniScid" in data.keys():
            ccode = data["uniScid"]
        else:
            ccode = ''
        if "opStateInterpreted" in data.keys():
            status = data["opStateInterpreted"]
        else:
            status = ''
        if "entTypeInterpreted" in data.keys():
            types = data["entTypeInterpreted"]
        else:
            types = ''
        if "lerep" in data.keys():
            legal_person = data["lerep"]
        else:
            legal_person = ''
        if "estDate" in data.keys():
            reg_date = data["estDate"]
            reg_date = deal_html_code.change_chinese_date(reg_date)
        else:
            reg_date = None
        if "issBlicDate"  in data.keys():
            appr_date = data["issBlicDate"]
            appr_date = deal_html_code.change_chinese_date(appr_date)
        else:
            appr_date = None
        if "regCapInterpreted" in data.keys():

            reg_amount = data["regCapInterpreted"]
        else:
            reg_amount = ''
        if "opFrom" in data.keys():
            start_date = data["opFrom"]
            start_date = deal_html_code.change_chinese_date(start_date)
        else:
            start_date = None

        if "opTo" in data.keys():
            end_date = data["opTo"]
            end_date = deal_html_code.change_chinese_date(end_date)
        else:
            end_date = None
        if "regOrganInterpreted" in data.keys():
            reg_zone = data["regOrganInterpreted"]
        else:
            reg_zone = ''
        if "dom" in data.keys():
            reg_address = data["dom"]
        else:
            reg_address = ''
        if "opScope" in data.keys():
            scope = data["opScope"]
            scope = deal_html_code.remove_symbol(scope)
        else:
            scope = ''
        if "canDate" in data.keys():
            del_date = data["canDate"]
            del_date = deal_html_code.change_chinese_date(del_date)
        else:
            del_date = None
        info = [name,ccode,status,types,legal_person,reg_date,appr_date,reg_amount,start_date,end_date,reg_zone,reg_address,scope,del_date]
        return info
Exemplo n.º 22
0
def update_basic(information, connect, cursor, gs_basic_id):
    if '企业名称' in information.keys():
        name = information[u"企业名称"]
    elif '名称' in information.keys():
        name = information[u"名称"]
    if '统一社会信用代码' in information.keys():
        code = information[u"统一社会信用代码"]
        ccode = information[u"统一社会信用代码"]
        ccode = str(ccode).replace('\t', '').replace('\n', '').replace(' ', '')
    elif '注册号' in information.keys():
        code = information[u"注册号"]
        ccode = ''
    elif '统一社会信用代码/注册号' in information.keys():
        code = information[u"统一社会信用代码/注册号"]
        pattern = re.compile('^91.*|92.*|93.*')
        ccode = re.findall(pattern, code)
        if len(ccode) == 0:
            ccode = ''
        elif len(ccode) == 1:
            ccode = ccode[0]
    if '登记状态' in information.keys():
        status = information[u"登记状态"]
    if '类型' in information.keys():
        types = information[u'类型']
    if '组成形式' in information.keys():
        jj_type = information[u'组成形式']
    else:
        jj_type = None
    if '法定代表人' in information.keys():
        legal_person = information[u"法定代表人"]
        responser = None
        investor = None
        runner = None
    elif '经营者' in information.keys():
        runner = information[u"经营者"]
        legal_person = None
        responser = None
        investor = None
    elif '负责人' in information.keys():
        responser = information[u'负责人']
        runner = None
        legal_person = None
        investor = None
    elif '投资人' in information.keys():
        investor = information[u"投资人"]
        responser = None
        runner = None
        legal_person = None
    elif '执行事务合伙人' in information.keys():
        legal_person = information[u"执行事务合伙人"]
        investor = None
        runner = None
        responser = None

    if '成立日期' in information.keys():
        sign_date = information[u"成立日期"]
        sign_date = change_chinese_date(sign_date)
    elif '注册日期' in information.keys():
        sign_date = information[u"注册日期"]
        sign_date = change_chinese_date(sign_date)
    else:
        sign_date = None

    if '注册资本' in information.keys():
        reg_amount = information[u"注册资本"]
    elif '成员出资额' in information.keys():
        reg_amount = information[u"成员出资额"]
    else:
        reg_amount = None
    if '核准日期' in information.keys():
        appr_date = information[u"核准日期"]
        appr_date = change_chinese_date(appr_date)
    else:
        appr_date = None
    if '营业期限自' in information.keys():
        start_date = information[u"营业期限自"]
        start_date = change_chinese_date(start_date)
    elif '合伙期限自' in information.keys():
        start_date = information[u"合伙期限至"]
        start_date = change_chinese_date(start_date)
    else:
        start_date = None
    if '营业期限至' in information.keys():
        end_date = information[u"营业期限至"]
        end_date = change_chinese_date(end_date)
    elif '合伙期限至' in information.keys():
        end_date = information[u"合伙期限至"]
        end_date = change_chinese_date(end_date)
    else:
        end_date = None
    if '登记机关' in information.keys():
        reg_zone = information[u"登记机关"]
    if '住所' in information.keys():
        reg_address = information[u"住所"]
    elif '经营场所' in information.keys():
        reg_address = information[u"经营场所"]
    elif '主要经营场所' in information.keys():
        reg_address = information[u"主要经营场所"]
    elif '营业场所' in information.keys():
        reg_address = information[u"营业场所"]
    if '业务范围' in information.keys():
        scope = information[u"业务范围"]
    elif '经营范围' in information.keys():
        scope = information[u"经营范围"]
    # updated_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time()))
    row_count = 0
    flag = 0
    ccode = remove_symbol(ccode)

    try:
        row_count = cursor.execute(
            update_string,
            (gs_basic_id, name, ccode, status, types, jj_type, legal_person,
             responser, investor, runner, sign_date, appr_date, reg_amount,
             start_date, end_date, reg_zone, reg_address, scope, gs_basic_id))
        logging.info('update basic :%s' % row_count)
        connect.commit()
    except Exception, e:
        flag = 100000004
        logging.error("basic error:" % e)