Exemple #1
0
 def name(self, data):
     information = {}
     for i in xrange(len(data)):
         singledata = data[i]
         number = singledata["penDecNo"]
         types = singledata["illegActType"]
         content = singledata["penContent"]
         date = singledata["penDecIssDate"]
         date = change_date_style(date)
         pub_date = singledata["publicDate"]
         pub_date = change_date_style(pub_date)
         gov_dept = singledata["penAuth_CN"]
         nodeNum = singledata["nodeNum"]
         name = singledata["unitName"]
         vPunishmentDecision = singledata["vPunishmentDecision"]
         if len(vPunishmentDecision) == 0:
             pdfurl = ''
         else:
             fileName = vPunishmentDecision["fileName"]
             pdfurl = config.host + '/doc/%s/casefiles/' % nodeNum + fileName
             # print pdfurl
         information[i] = [
             number, types, content, date, pub_date, gov_dept, name, pdfurl
         ]
     return information
Exemple #2
0
 def name(self, data):
     information = {}
     for i in xrange(len(data)):
         singledata = data[i]
         equityNo = singledata["equityNo"]
         impAm = singledata["impAm"]
         impOrg = singledata["impOrg"]
         impOrgBLicNo = singledata["impOrgBLicNo"]
         # impOrgBLicType_CN = singledata["impOrgBLicType_CN"]
         # impOrgId = singledata["impOrgId"]
         # pledAmUnit = singledata["pledAmUnit"]
         pledBLicNo = singledata["pledBLicNo"]
         # pledBLicType_CN = singledata["pledBLicType_CN"]
         pledgor = singledata["pledgor"]
         type = singledata["type"]
         equPleDate = singledata["equPleDate"]
         equPleDate = change_date_style(equPleDate)
         publicDate = singledata["publicDate"]
         publicDate = change_date_style(publicDate)
         if type == '2':
             type = '无效'
         elif type == '1':
             type = '有效'
         elif type == 'K':
             type = ''
         information[i] = [
             equityNo, pledgor, pledBLicNo, impAm, impOrg, impOrgBLicNo,
             equPleDate, publicDate, type
         ]
     return information
    def name(self, data):
        info = {}
        for i in xrange(len(data)):
            singledata = data[i]
            uuid = singledata["moreId"]
            creditor = singledata["more"]
            debtor = singledata["mortgagor"]
            cates = singledata["priClaSecKind"]
            if cates == '1':
                cates = '合同'
            elif cates == '2':
                cates = '其他'

            amount = singledata["priClaSecAm"]
            pefPerForm = singledata["pefPerForm"]
            pefPerForm = change_date_style(pefPerForm)
            pefPerTo = singledata["pefPerTo"]
            pefPerTo = change_date_style(pefPerTo)
            deadline = str(pefPerForm) + '至' + str(pefPerTo)
            period = singledata["guaranperiod"]
            ways = singledata["gaType"]
            if_fwarnnt = singledata["moreDis"]
            if if_fwarnnt == "2":
                if_fwarnnt = 0
            info[i] = [
                uuid, creditor, debtor, cates, amount, deadline, period, ways,
                if_fwarnnt
            ]
        return info
Exemple #4
0
 def name(self, data):
     information = {}
     for i in xrange(len(data)):
         singledata = data[i]
         nodeNum = singledata["nodeNum"]
         ia_zch = singledata["regNum"]
         ia_flh = singledata["intCls"]
         ia_zcgg = singledata["regAnncIssue"]
         ia_servicelist = singledata["goodsCnName"]
         ia_servicelist = remove_symbol(ia_servicelist)
         begin = singledata["propertyBgnDate"]
         begin = change_date_style(begin)
         end = singledata["propertyEndDate"]
         end = change_date_style(end)
         if begin == '0000-0000-00' and end == '0000-00-00':
             ia_zyqqx = ''
         else:
             ia_zyqqx = begin + '至' + end
         ia_zcdate = singledata["regAnncDate"]
         ia_zcdate = change_date_style(ia_zcdate)
         tmImage = singledata["tmImage"]
         information[i] = [
             ia_zch, ia_flh, ia_zcgg, ia_servicelist, ia_zyqqx, ia_zcdate,
             nodeNum, tmImage
         ]
     return information
Exemple #5
0
    def deal_single_info(self, data, info):

        for i, singledata in enumerate(data):
            org = singledata["ORG"]
            id = singledata["ID"]
            seqid = singledata["SEQ_ID"]
            code = singledata["GUARANTY_REG_NO"]
            dates = singledata["START_DATE"]
            dates = deal_html_code.change_chinese_date(dates)
            dept = singledata["CREATE_ORG"]
            amount = singledata["ASSURE_CAPI"]
            amount = deal_html_code.match_float(amount)
            status = singledata["STATUS"]
            cates = singledata["ASSURE_KIND"]
            start_date = singledata["ASSURE_START_DATE"]

            start_date = deal_html_code.change_date_style(start_date)
            end_date = singledata["ASSURE_END_DATE"]
            end_date = deal_html_code.change_date_style(end_date)
            period = "自" + start_date + "至" + end_date
            ranges = singledata["ASSURE_SCOPE"]
            remark = singledata["REMARK"]
            cancel_cause = singledata["WRITEOFF_REASON"]
            RN = singledata["RN"]
            types = 'mort_person'
            person_href = person_url + params.format(org, id, seqid)
            person_info = self.get_detail_info(person_href, types)
            types = 'mort_goods'
            goods_href = goods_url + params.format(org, id, seqid)
            # print goods_href
            goods_info = self.get_detail_info(goods_href, types)
            info[RN] = [
                code, dates, dept, amount, status, cates, period, ranges,
                remark, cancel_cause, person_info, goods_info
            ]
Exemple #6
0
def name(data):
    information = {}
    for i in xrange(len(data)):
        singledata = data[i]
        name = singledata["inv"]

        subDetails = singledata["subDetails"]

        if len(subDetails) != 0:
            subDetails = singledata["subDetails"][0]
        else:
            subDetails = None
        if subDetails != None:
            reg_amount = subDetails["subConAmStr"]
            ra_date = subDetails["currency"]
            ra_date = change_date_style(ra_date)
            ra_ways = subDetails["subConForm_CN"]
        else:
            reg_amount, ra_date, ra_ways = None, None, None
        aubDetails = singledata["aubDetails"]
        if len(aubDetails) != 0:
            aubDetails = singledata["aubDetails"][0]
        else:
            aubDetails = None
        if subDetails != None:
            true_amount = aubDetails["acConAmStr"]
            ta_date = aubDetails["conDate"]
            ta_date = change_date_style(ta_date)
            ta_ways = aubDetails["acConFormName"]
        else:
            true_amount, ta_date, ta_ways = None, None, None
        information[i] = [
            name, reg_amount, ra_date, ra_ways, true_amount, ta_date, ta_ways
        ]
    return information
Exemple #7
0
 def name(self, data):
     information = {}
     for i in xrange(len(data)):
         singledata = data[i]
         name = singledata["entName"]
         code = singledata["licNo"]
         filename = singledata["licName_CN"]
         start_date = singledata["valFrom"]
         start_date = change_date_style(start_date)
         end_date = singledata["valTo"]
         end_date = change_date_style(end_date)
         content = singledata["licItem"]
         gov_dept = singledata["licAnth"]
         status = singledata["status"]
         licId = singledata["licId"]
         if status == '1':
             status = '有效'
         else:
             status = '无效'
         detail_url = "http://www.gsxt.gov.cn/corp-query-entprise-info-insLicenceDetailInfo-%s.html" % licId
         information[i] = [
             name, code, filename, start_date, end_date, content, gov_dept,
             detail_url, status
         ]
     return information
Exemple #8
0
 def name(self,data):
     information = {}
     for i,singledata in enumerate(data):
         types = '黑名单'
         in_reason = singledata["serILLRea_CN"]
         in_date = singledata["abntime"]
         in_date = change_date_style(in_date)
         out_reason = singledata["remExcpRes_CN"]
         out_date = singledata["remDate"]
         out_date = change_date_style(out_date)
         gov_dept = singledata["decOrg_CN"]
         information[i] = [types, in_reason, in_date, out_reason, out_date, gov_dept]
     return information
Exemple #9
0
 def name(self, data):
     information = {}
     for i in xrange(len(data)):
         singledata = data[i]
         number = singledata["penDecNo"]
         types = singledata["illegActType"]
         content = singledata["penContent"]
         date = singledata["penDecIssDate"]
         date = change_date_style(date)
         pub_date = singledata["publicDate"]
         pub_date = change_date_style(pub_date)
         gov_dept = singledata["penAuth_CN"]
         information[i] = [number, types, content, date, pub_date, gov_dept]
     return information
Exemple #10
0
 def name(self,data):
     information = {}
     for i in xrange(len(data)):
         singledata = data[i]
         types = '经营异常'
         in_reason = singledata["speCause_CN"]
         in_date = singledata["abntime"]
         in_date = change_date_style(in_date)
         out_reason = singledata["remExcpRes_CN"]
         out_date = singledata["remDate"]
         out_date = change_date_style(out_date)
         gov_dept = singledata["decOrg_CN"]
         information[i] = [types, in_reason, in_date, out_reason, out_date, gov_dept]
     return information
Exemple #11
0
def name(data):
    information = {}
    for i in xrange(len(data)):
        singledata = data[i]
        name = singledata["entName"]
        code = singledata["licNo"]
        filename = singledata["licName_CN"]
        start_date = singledata["valFrom"]
        start_date = change_date_style(start_date)
        end_date = singledata["valTo"]
        end_date = change_date_style(end_date)
        content = singledata["licItem"]
        gov_dept = singledata["licAnth"]
        information[i] = [name, code, filename, start_date, end_date, content, gov_dept]
    return information
def deal_detail_content(detail_url):
    # print detail_url
    detail_code, status_code = Send_Request().send_requests(detail_url)
    if status_code == 200:
        detail_code = json.loads(detail_code)["data"]
        if len(detail_code[1]) != 0:
            content1 = detail_code[1][0]
        elif len(detail_code[0]) != 0:
            content1 = detail_code[0][0]
        if len(content1) != 0:
            if "conDate" in content1.keys():
                ra_date = content1["conDate"]
                ra_date = change_date_style(ra_date)
                ta_date = ra_date
            else:
                ta_date = None
                ra_date = None
            if "conForm_CN" in content1.keys():
                ra_ways = content1["conForm_CN"]
                ta_ways = ra_ways
            else:
                ta_ways = None
                ra_ways = None
            if "subConAm" in content1.keys():
                reg_amount = content1["subConAm"]
            else:
                reg_amount = None
            if "acConAm" in content1.keys():
                true_amount = content1["acConAm"]
            else:
                true_amount = None

    return ra_date, ra_ways, true_amount, reg_amount, ta_ways, ta_date
Exemple #13
0
 def name(self,data):
     informaiton = {}
     for i in xrange(len(data)):
         singledata = data[i]
         code = singledata["morRegCNo"]
         dates = singledata["regiDate"]
         dates = change_date_style(dates)
         dept = singledata["regOrg_CN"]
         amount = singledata["priClaSecAm"]
         status = singledata["type"]
         if status == '1':
             status = '有效'
         elif status == '2':
             status = '无效'
         morReg_Id = singledata["morReg_Id"]
         url = 'http://www.gsxt.gov.cn/corp-query-entprise-info-mortCreditorRightInfo-%s.html' % morReg_Id
         info = self.get_info(url, 'mortCreditorRightInfo')
         info = self.get_mort_credit(info)
         if info == None or len(info) == 0:
             cates, period, ranges, remark = '', '', '', ''
         else:
             cates, period, ranges, remark = info[0][0], info[0][1], info[0][2], info[0][3]
         goods_info = self.get_mort_branch(morReg_Id, goods_url, 'mort_goods')
         person_info = self.get_mort_branch(morReg_Id, person_url, 'mort_person')
         # print person_info
         informaiton[i] = [code, dates, dept, amount, status, cates, period, ranges, remark, goods_info, person_info]
     return informaiton
Exemple #14
0
    def get_info(self, data):
        info = {}
        tr_list = data.xpath(".//table[@id='table_dcdy']//tr[@name = 'dcdy']")
        for i, singledata in enumerate(tr_list):
            temp = {}
            td_list = singledata.xpath("./td")
            if len(td_list) == 0:
                continue

            temp["code"] = deal_html_code.remove_symbol(
                td_list[1].xpath("string(.)"))

            dates = deal_html_code.remove_symbol(td_list[2].xpath("string(.)"))
            temp["dates"] = deal_html_code.change_date_style(dates)
            temp["dept"] = deal_html_code.remove_symbol(
                td_list[3].xpath("string(.)"))
            temp["amount"] = deal_html_code.remove_symbol(
                td_list[4].xpath("string(.)"))
            temp["status"] = deal_html_code.remove_symbol(
                td_list[5].xpath("string(.)"))

            onclick = td_list[6].xpath("./a/@onclick")[0]
            tuple = deal_html_code.match_key_content(str(onclick))
            xh = tuple[0]
            detail_url = self._url.format(self._pripid, xh)
            person_info, goods_info = self.get_detail_info(detail_url, temp)
            temp["person_info"] = person_info
            temp["goods_info"] = goods_info
            info[i] = temp
        return info
Exemple #15
0
    def name(self,data):
        information = {}
        for i in xrange(len(data)):
            singledata = data[i]
            uuid = singledata["invId"]
            name = singledata["invName"]
            reg_amount = singledata["liSubConAm"]
            reg_date = singledata["subConDate"]
            reg_date = change_date_style(reg_date)
            reg_way = singledata["subConFormName"]
            ac_amount = singledata["liAcConAm"]
            ac_date = singledata["acConDate"]
            ac_date = change_date_style(ac_date)
            ac_way = singledata["acConForm_CN"]

            information[i] = [name, uuid, reg_amount, reg_date, reg_way, ac_amount, ac_date, ac_way]
        return information
Exemple #16
0
 def get_mort_credit(self,data):
     information = {}
     # print data
     if data != None:
         data = data[0]
         cates = data["priClaSecKind_CN"]
         start_date = data["pefPerForm"]
         start_date = change_date_style(start_date)
         end_date = data["pefPerTo"]
         end_date = change_date_style(end_date)
         period = start_date + '至' + end_date
         ranges = data["warCov"]
         remark = data["remark"]
         information[0] = [cates, period, ranges, remark]
         return information
     elif data == None:
         return information
         logging('暂无被担保主债权信息!')
 def name(self, data):
     information = {}
     for i, singledata in enumerate(data):
         uuid = singledata["licId"]
         types = singledata["licName_CN"]
         valto = singledata["valTo"]
         valto = change_date_style(valto)
         information[i] = [uuid, types, valto]
     return information
Exemple #18
0
def deal_detail_content(detail_url):
    result, status_code = Send_Request().send_requests(detail_url)
    # print detail_url
    if status_code == 200:
        recordsTotal = json.loads(result)["data"]
        if recordsTotal != 0:
            data = json.loads(result)["data"][0]
            items = data["executeItem_CN"]
            rule_no = data["froDocNo"]
            enforce_no = data["executeNo"]
            cert_cate = data["bLicType_CN"]
            cert_code = data["bLicNo"]
            start_date = data["froFrom"]
            start_date = change_date_style(start_date)
            end_date = data["froTo"]
            end_date = change_date_style(end_date)
            period = data["frozDeadline"]
            pub_date = data["publicDate"]
            pub_date = change_date_style(pub_date)

    return items, rule_no, enforce_no, cert_cate, cert_code, start_date, end_date, period, pub_date
Exemple #19
0
 def name(self, data):
     information = {}
     for i in xrange(len(data)):
         single_data = data[i]
         content_before = single_data["altBe"]
         content_after = single_data["altAf"]
         change_date = single_data["altDate"]
         change_date = deal_html_code.change_date_style(change_date)
         item = single_data["altItem_CN"]
         item = deal_lable(item)
         information[i] = [content_before, content_after, change_date, item]
     return information
Exemple #20
0
 def name(self, data):
     information = {}
     for i in xrange(len(data)):
         singledata = data[i]
         uuid = singledata["sExtSequence"]
         name = singledata["inv"]
         percent_pre = str(singledata["transAmPr"]) + '%'
         percent_after = str(singledata["transAmAft"]) + '%'
         dates = singledata["altDate"]
         dates = change_date_style(dates)
         information[i] = [name, percent_pre, percent_after, dates, uuid]
     return information
Exemple #21
0
 def name(self,data):
     information = {}
     for i in xrange(len(data)):
         singledata = data[i]
         types = singledata["insType"]
         if types == '1':
             types = '抽查'
         else:
             types = '检查'
         result = singledata["insRes_CN"]
         check_date = singledata["insDate"]
         check_date = change_date_style(check_date)
         gov_dept = singledata["insAuth_CN"]
         information[i] = [types, result, check_date, gov_dept]
     return information
Exemple #22
0
 def get_detail_info(self, url):
     result, status_code = Send_Request().send_requests(url)
     info = {}
     if status_code == 200:
         data = json.loads(result)["list"]
         if len(data) == 0:
             logging.info("暂无permit详情信息")
         else:
             for i, singledata in enumerate(data):
                 alt_name = singledata["alt"]
                 alt_date = singledata["altDate"]
                 alt_date = change_date_style(alt_date)
                 alt_af = singledata["altAf"]
                 alt_be = singledata["altBe"]
                 info[i] = [alt_name, alt_date, alt_af, alt_be]
     return info
Exemple #23
0
	def get_detail_info(self, url):
		result, status_code = Send_Request().send_requests(url)
		info = {}
		if status_code == 200:
			data = etree.xpath(result, parser=etree.HTMLParser(encoding='utf-8'))
			if len(data) == 0:
				logging.info("暂无permit详情信息")
			else:
				tr_list = data.xpath("//tr[@name='xzxkbg']")
				for i, singledata in enumerate(tr_list):
					td_list = singledata.xpath("./td")
					alt_name = deal_html_code.remove_symbol(td_list[1].xpath("string(.)"))
					alt_date = deal_html_code.remove_symbol(td_list[2].xpath("string(.)"))
					alt_date = deal_html_code.change_date_style(alt_date)
					alt_af = deal_html_code.remove_symbol(td_list[4].xpath("string(.)"))
					alt_be = deal_html_code.remove_symbol(td_list[3].xpath("string(.)"))
					info[i] = [alt_name, alt_date, alt_af, alt_be]
		return info
Exemple #24
0
    def get_baseinfo(self, baseinfourl):
        url = baseinfourl

        information, runinfo = {}, {}
        result, status_code = Send_Request().send_requests(url)
        if status_code == 200:
            data = json.loads(result)["data"][0]
            code = data["regNo"]
            ccode = data["uniscId"]
            uuid = data["anCheId"]

            name = data["entName"]
            tel = data["tel"]
            address = data["addr"]
            email = data["email"]

            postcode = data["postalCode"]
            status = data["busSt_CN"]
            employee = data["empNum"]
            if_empnum = data["empNumDis"]
            if if_empnum != u'' and if_empnum != '':
                if_empnum = int(if_empnum)
                if if_empnum == 2:
                    if_empnum = 0
            else:
                if_empnum = 0
            womennum = data["womemPNum"]
            if_womennum = data["womemPNumDis"]
            if womennum != '' and str(womennum) != '':
                if_womennum = int(if_womennum)
                if if_empnum == 2:
                    if_empnum = 0
            else:
                if_womennum = 0
            holding = data["holdingSmsg"]
            if_holding = data["holdingSmsgDis"]
            if holding != '' and str(holding) != '':
                if_holding = int(if_holding)
                if if_holding == 2:
                    if_holding = 0
            else:
                if_holding = 0
            mainbus = data["mainBusiAct"]
            pripid = data["pripId"]
            runner, amount = '', ''
            fill_date = data["anCheDate"]
            fill_date = deal_html_code.change_date_style(fill_date)
            information[0] = [
                name, uuid, tel, address, email, postcode, status, employee,
                if_empnum, womennum, if_womennum, holding, if_holding, mainbus,
                code, ccode, pripid, runner, amount, fill_date
            ]
            asset = data["assGro"]
            if_asset = data["assGroDis"]
            if asset != '' and str(if_asset) != '':
                if_asset = int(data["assGroDis"])
                if if_asset == 2:
                    if_asset = 0
            else:
                if_asset = 0
            benifit = data["totEqu"]
            if_benifit = data["totEquDis"]
            if if_benifit != '' and str(if_benifit) != '':
                if_benifit = int(data["totEquDis"])
                if if_benifit == 2:
                    if_benifit = 0
            else:
                if_benifit = 0
            income = data["vendInc"]
            if_income = data["vendIncDis"]
            if if_income != '' and str(if_income) != '':
                if_income = int(data["vendIncDis"])
                if if_income == 2:
                    if_income = 0
            else:
                if_income = 0
            profit = data["proGro"]
            if_profit = data["proGroDis"]
            if if_profit != '' and str(if_profit) != '':
                if_profit = int(data["proGroDis"])
                if if_profit == 2:
                    if_profit = 0
            else:
                if_profit = 0
            main_income = data["maiBusInc"]
            if_main = data["maiBusIncDis"]
            if if_main != '' and str(if_main) != '':
                if_main = int(data["maiBusIncDis"])
                if if_main == 2:
                    if_main = 0
            else:
                if_main = 0
            net_income = data["netInc"]
            if_net = data["netIncDis"]
            if if_net != '' and str(if_net) != '':
                if_net = int(data["netIncDis"])
                if if_net == 2:
                    if_net = 0
            else:
                if_net = 0
            tax = data["ratGro"]
            if_tax = data["ratGroDis"]
            if if_tax != '' and str(if_tax) != "":
                if_tax = int(data["ratGroDis"])
                if if_tax == 2:
                    if_tax = 0
            else:
                if_tax = 0
            debt = data["liaGro"]
            if debt != '' and str(debt) != '':
                if_debt = int(data["liaGroDis"])
                if if_debt == 2:
                    if_debt = 0
            else:
                if_debt = 0
            runinfo[0] = [
                asset, if_asset, benifit, if_benifit, income, if_income,
                profit, if_profit, main_income, if_main, net_income, if_net,
                tax, if_tax, debt, if_debt, uuid
            ]
        return information, runinfo
Exemple #25
0
    def get_pbaseinfo(self, baseinfourl):
        url = baseinfourl
        # print url
        information, fruninfo = {}, {}
        result, status_code = Send_Request().send_requests(url)

        if status_code == 200:
            data = json.loads(result)["data"][0]
            uuid = data["anCheId"]
            name = data["traName"]
            tel = data["tel"]

            address = ''
            email = ''
            postcode = ''
            status = ''
            employee = data["empNum"]
            if_empnum = data["empNumDis"]
            pripid = data["pripId"]
            fill_date = data["anCheDate"]
            fill_date = deal_html_code.change_date_style(fill_date)
            if if_empnum != u"" and if_empnum != '':
                if_empnum = int(if_empnum)
                if if_empnum == 2:
                    if_empnum = 0
            else:
                if_empnum = 0

            womennum = ''
            if_womennum = 0

            holding = ''
            if_holding = 0
            mainbus = ''
            code = data["regNo"]
            ccode = data["uniscId"]
            if "name" in data.keys():
                runner = data["name"]
            else:
                runner = ''
            if "fundAm" in data.keys():
                amount = data["fundAm"]
            else:
                amount = ''
            information[0] = [
                name, uuid, tel, address, email, postcode, status, employee,
                if_empnum, womennum, if_womennum, holding, if_holding, mainbus,
                code, ccode, pripid, runner, amount, fill_date
            ]
            loan = ''
            if_loan = 0

            subsidy = ''
            if_subsidy = 0
            income = data["vendInc"]
            if_income = data["vendIncDis"]
            if if_income != u"" and if_income != '':
                if_income = int(if_income)
                if if_income == 2:
                    if_income = 0
            else:
                if_income = 0
            tax = data["ratGro"]
            if_tax = data["ratGroDis"]
            if if_tax != u"" and if_tax != '':
                if_tax = int(if_tax)
                if if_tax == 2:
                    if_tax = 0
            else:
                if_tax = 0
            profit = ''
            if_profit = 0

            fruninfo[0] = [
                uuid, loan, if_loan, subsidy, if_subsidy, income, if_income,
                tax, if_tax, profit, if_profit
            ]
        return information, fruninfo