Beispiel #1
0
 def get_detail_info(self, url, type):
     if type == "rj":
         result, status_code = Send_Request(url,
                                            config.headers).send_request()
         if status_code == 200:
             data = json.loads(result.content)["data"]
             if len(data) > 0:
                 data = data[0]
                 ra_date = data["SHOULD_CAPI_DATE"]
                 ra_ways = data["INVEST_TYPE_NAME"]
                 reg_amount = data["SHOULD_CAPI_DATE"]
             else:
                 logging.info("无认缴信息")
                 ra_date, ra_ways, reg_amount = '0000-00-00', '', ''
         else:
             ra_date, ra_ways, reg_amount = '0000-00-00', '', ''
         return ra_date, ra_ways, reg_amount
     elif type == "sj":
         result, status_code = Send_Request(url,
                                            config.headers).send_request()
         if status_code == 200:
             data = json.loads(result.content)["data"]
             if len(data) > 0:
                 data = data[0]
                 ta_date = data["REAL_CAPI_DATE"]
                 ta_ways = data["REAL_CAPI"]
                 true_amount = data["INVEST_TYPE_NAME"]
             else:
                 logging.info("无实缴信息")
                 ta_date, ta_ways, true_amount = '0000-00-00', '', ''
         else:
             ta_date, ta_ways, true_amount = '0000-00-00', '', ''
         return ta_date, ta_ways, true_amount
     else:
         pass
Beispiel #2
0
 def get_detail_info(self, url, types):
     info = {}
     result, status_code = Send_Request(url, headers).send_request()
     if status_code == 200:
         data = json.loads(result.content)["data"]
         if types == 'mort_person':
             if len(data) > 0:
                 for i, singledata in enumerate(data):
                     name = singledata["AU_NAME"]
                     cert = singledata["AU_CER_NO"]
                     number = singledata["AU_CER_TYPE"]
                     info[i] = [name, cert, number]
             else:
                 logging.info("无动产抵押权人信息!")
         elif types == "mort_goods":
             if len(data) > 0:
                 for i, singledata in enumerate(data):
                     name = singledata["NAME"]
                     ownership = singledata["BELONG_KIND"]
                     situation = singledata["PA_DETAIL"]
                     remark = singledata["REMARK"]
                     info[i] = [name, ownership, situation, remark]
     else:
         logging.info("获取动产抵押权人信息失败!")
     return info
Beispiel #3
0
    def get_info(self):
        result, status_code = Send_Request(self.url,
                                           self.headers).send_request()
        info = {}

        if status_code == 200:
            flag = 1
            data = json.loads(result.content)

            for i, singledata in enumerate(data):

                name = singledata["DIST_NAME"]
                if name == None:
                    name = ''
                code = singledata["DIST_REG_NO"]
                if code == None:
                    code = ''

                #省份代号中没有以9开头的因此可以用是否以9开头区分是否为注册号
                if code.startswith('9'):
                    ccode = code
                    code = ''
                else:
                    ccode = ''
                gov_dept = singledata["DIST_BELONG_ORG"]
                if name == '' and code == '':
                    pass
                else:
                    info[i] = [name, code, ccode, gov_dept]
        else:
            flag = 100000004
        return info, flag
Beispiel #4
0
    def get_detail_info(self, info, RN, detail_url, status):
        result, status_code = Send_Request(detail_url, headers).send_request()
        if status_code == 200:

            data = json.loads(result.content)["djInfo"][0]
            executor = data["ASSIST_NAME"]
            if executor == None:
                executor = ''
            stock_amount = data["FREEZE_AMOUNT"]
            court = data["EXECUTE_COURT"]
            notice_no = data["NOTICE_NO"]
            items = data["ASSIST_ITEM"]
            rule_no = data["ADJUDICATE_NO"]
            enforce_no = data["NOTICE_NO"]
            cert_cate = data["ASSIST_IDENT_TYPE"]
            cert_code = data["ASSIST_IDENT_NO"]
            start_date = data["FREEZE_START_DATE"]
            end_date = data["FREEZE_END_DATE"]
            period = data["FREEZE_YEAR_MONTH"]
            pub_date = data["PUBLIC_DATE"]
            info[RN] = [
                executor, stock_amount, court, notice_no, status, items,
                rule_no, enforce_no, cert_cate, cert_code, start_date,
                end_date, period, pub_date
            ]
Beispiel #5
0
    def get_info(self):
        result, status_code = Send_Request(self.url,
                                           self.headers).send_request()
        info = {}
        if status_code == 200:
            flag = 1
            data = json.loads(result.content)
            if len(data) > 0:
                uuid = data["ID"]
                birth_owe = data["PAYMENT_SY"]
                birth_num = data["MATERNITY_NUM"]
                birth = data["SOCIALINS_SY"]
                birth_base = data["WAGES_SY"]
                if u"不公示" in birth_owe:
                    if_owe = 0
                else:
                    if_owe = 1
                if u"不公示" in birth_base:
                    if_basenum = 0
                else:
                    if_basenum = 0
                if u"不公示" in birth:
                    if_periodamount = 0
                else:
                    if_periodamount = 1

                birth_owe = deal_html_code.match_float(birth_owe)
                birth_num = deal_html_code.match_float(birth_num)
                birth = deal_html_code.match_float(birth)
                birth_base = deal_html_code.match_float(birth_base)
                old_num = deal_html_code.match_float(data["ENDOWMENT_NUM"])
                old_owe = deal_html_code.match_float(data["PAYMENT_JBYL"])
                old = deal_html_code.match_float(data["SOCIALINS_JBYL"])
                old_base = deal_html_code.match_float(data["WAGES_JBYL"])
                unemploy = deal_html_code.match_float(data["SOCIALINS_SYBX"])
                unemploy_base = deal_html_code.match_float(data["WAGES_SYBX"])
                unemploy_owe = deal_html_code.match_float(data["PAYMENT_SYBX"])
                unemploy_num = deal_html_code.match_float(
                    data["UNEMPLOYED_NUM"])
                medical = deal_html_code.match_float(data["SOCIALINS_YLBX"])
                medical_base = deal_html_code.match_float(data["WAGES_YLBX"])
                medical_owe = deal_html_code.match_float(data["PAYMENT_YLBX"])
                medical_num = deal_html_code.match_float(data["MEDICARE_NUM"])
                injury = deal_html_code.match_float(data["SOCIALINS_GSBX"])
                injury_owe = deal_html_code.match_float(data["PAYMENT_GSBX"])
                injury_num = deal_html_code.match_float(
                    data["EMPLOYMENT_INJURY_NUM"])
                info[0] = [uuid, if_owe, if_basenum, if_periodamount, birth_owe, birth_num, birth, birth_base, old_num,
                     old_owe, old, old_base, \
                     unemploy, unemploy_base, unemploy_owe, unemploy_num, medical, medical_base, medical_owe,
                     medical_num, injury, injury_owe, injury_num]
            else:
                logging.info("无社保信息")
        else:
            flag = 100000004
            logging.info("打开社保链接失败!")

        return info, flag
Beispiel #6
0
def get_keyid(string):
	cookies = None
	url = config.index_url
	headers = config.headers
	result, status_code = Send_Request(url, headers).send_request()
	if status_code == 200:
		flag = 1
		cookies = result.cookies
		firsturl = config.first_url.format(string)
		result, status_code = Send_Request(firsturl, headers).send_request1(cookies)
		if status_code == 200:
			result = json.loads(result.content)
			name = result["bean"]["name"]
		else:
			flag = 100000002
	else:
		flag = 100000001
	return name, flag, cookies
Beispiel #7
0
 def get_info(self):
     result, status_code = Send_Request(self.url,
                                        self.headers).send_request()
     info = {}
     if status_code == 200:
         data = json.loads(result.content)
         flag = 1
         for i, data in enumerate(data):
             regno = data["REGNO"]
             intcls = data["INTCLS"]
             self.get_single_info(regno, intcls, info)
     else:
         flag = 100000004
     return info, flag
Beispiel #8
0
    def get_single_info(self, regno, intcls, info):

        url = more_url.format(intcls, regno)
        result, status_code = Send_Request(url, self.headers).send_request()
        if status_code == 200:
            data = json.loads(result.content)[0]
            ia_zch = regno
            ia_flh = intcls
            ia_zcgg = data["REGANNCNO"]
            url = service_url.format(intcls, regno)
            result, status_code = Send_Request(url,
                                               self.headers).send_request()
            if status_code == 200:
                servicedata = json.loads(result.content)
                ia_servicelist = ''
                for i, single in enumerate(servicedata):
                    similarcode = single["SIMILARCODE"]
                    goods = single["GOODS"]
                    ia_servicelist = ia_servicelist + similarcode + '--' + goods
            else:
                ia_servicelist = ''

            begin = data["PERIBGN"]
            end = data["PERIEND"]

            if begin == '' and end == '':
                ia_zyqqx = ''
            else:
                ia_zyqqx = begin + '至' + end
            ia_zcdate = data["REGANNCDATE"]
            ia_zcdate = deal_html_code.change_chinese_date(ia_zcdate)
            tmImage = img_url.format(intcls, regno)
            info[regno] = [
                ia_zch, ia_flh, ia_zcgg, ia_servicelist, ia_zyqqx, ia_zcdate,
                tmImage
            ]
Beispiel #9
0
 def get_info(self):
     info = {}
     result, status_code = Send_Request(self.url,
                                        self.headers).send_request()
     if status_code == 200:
         flag = 1
         data = json.loads(result.content)
         for i, singledata in enumerate(data):
             types = singledata["WEB_TYPE"]
             name = singledata["WEB_NAME"]
             website = singledata["WEB_URL"]
             info[i] = [types, name, website]
     else:
         flag = 100000004
     return info, flag
Beispiel #10
0
 def get_info(self):
     result, status_code = Send_Request(self.url,
                                        self.headers).send_request()
     info = {}
     if status_code == 200:
         flag = 1
         data = json.loads(result.content)
         for i, single in enumerate(data):
             name = single["PERSON_NAME"]
             position = single["POSITION_NAME"]
             if position == None:
                 position = ''
             info[i] = [name, position]
     else:
         flag = 100000004
     return info, flag
Beispiel #11
0
	def get_report_href(self):
		result, status_code = Send_Request(self.url, self.headers).send_request()
		info = {}
		if status_code == 200:
			flag = 1
			data = json.loads(result.content)["data"]
			if data !=None:
				for i, singledata in enumerate(data):
					report_id = singledata["ID"]
					year = singledata["REPORT_YEAR"]
					NB_TYPE = singledata["NB_TYPE"]
					info[i] = [report_id, year, NB_TYPE]
			else:
				logging.info("该企业中无年报信息")
				
		else:
			flag = 100000004
		return info, flag
Beispiel #12
0
	def get_info(self):
		info = {}
		result,status_code = Send_Request(self.url, self.headers).send_request()
		if status_code ==200:
			flag = 1
			data = json.loads(result.content)
			for i,singledata in enumerate(data):
				name = singledata["INVEST_NAME"]
				code = singledata["INVEST_REG_NO"]
				if code ==None:
					ccode = None
				elif code.startswith("9"):
					ccode = code
				else:
					ccode = None
				info[i] = [name, code, ccode]
		else:
			flag = 100000004
		return info, flag
Beispiel #13
0
 def get_info(self):
     result, status_code = Send_Request(self.url,
                                        self.headers).send_request()
     info = {}
     if status_code == 200:
         flag = 1
         data = json.loads(result.content)
         if len(data) > 0:
             data = data[0]
             leader = data["ACCOUNT_MAN"]
             member = data["ACCOUNT_MEMBER"]
             position1 = "清算组负责人"
             position2 = "清算组成员"
             if leader != None:
                 info[0] = [leader, position1]
             if member != None:
                 memberlist = member.split("、")
                 for i, single in enumerate(memberlist, 1):
                     info[i] = [single, position2]
     else:
         flag = 100000004
     return info, flag
Beispiel #14
0
    def name(self):
        result, status_code = Send_Request(self.url,
                                           self.headers).send_request()
        info = []
        if status_code == 200:
            #flag用于标记程序运行状态
            flag = 1
            data = json.loads(result.content)
            name = data["CORP_NAME"]
            ccode = data["REG_NO"]
            status = data["CORP_STATUS"]
            types = data["ZJ_ECON_KIND"]
            legal_person = data["OPER_MAN_NAME"]
            reg_date = data["START_DATE"]
            reg_date = deal_html_code.change_chinese_date(reg_date)
            appr_date = data["CHECK_DATE"]
            appr_date = deal_html_code.change_chinese_date(appr_date)
            reg_amount = data["REG_CAPI"]
            start_date = data["FARE_TERM_START"]
            start_date = deal_html_code.change_chinese_date(start_date)
            end_date = data["FARE_TERM_END"]
            end_date = deal_html_code.change_chinese_date(end_date)
            reg_zone = data["BELONG_ORG"]
            reg_address = data["ADDR"]
            scope = data["FARE_SCOPE"]
            del_date = data["WRITEOFF_DATE"]
            del_date = deal_html_code.change_chinese_date(del_date)
            encryed_code = data["REG_NO_EN"]

            info = [
                name, ccode, status, types, legal_person, reg_date, appr_date,
                reg_amount, start_date, end_date, reg_zone, reg_address, scope,
                del_date
            ]
        else:
            encryed_code = ''
            flag = 100000004
        return info, flag, encryed_code
    def get_info(self):
        result, status_code = Send_Request(self.url,
                                           self.headers).send_request()
        info = {}
        runinfo = {}
        if status_code == 200:
            flag = 1
            data = json.loads(result.content)
            code = data["REG_NO"]
            if code.startswith("9"):
                ccode = code
            else:
                ccode = ''
            name = data["CORP_NAME"]
            tel = data["TEL"]
            address = data["ADDR"]
            email = data["E_MAIL"]
            postcode = data["ZIP"]
            status = data["PRODUCE_STATUS"]
            employee = data["PRAC_PERSON_NUM"]
            if employee == None:
                if_empnum = 0
            elif u"不公示" in employee:
                if_empnum = 0
            else:
                if_empnum = 1

            womennum = data["WOM_EMP_NUM"]
            if womennum == None:
                if_womennum = 0
            elif u"不公示" in womennum:
                if_womennum = 0
            else:
                if_womennum = 1
            holding = data["HOLDINGS_MSG"]
            if holding == None:
                if_holding = 0
            elif u"不公示" in holding:
                if_holding = 0
            else:
                if_holding = 1
            mainbus = data["MAIN_BUSIACT"]
            runner = data["OPER_MAN_NAME"]
            amount = data["REG_CAPI"]
            fill_date = data["REPORT_DATE"]

            info[0] = [
                name, tel, address, email, postcode, status, employee,
                if_empnum, womennum, if_womennum, holding, if_holding, mainbus,
                code, ccode, runner, amount, fill_date
            ]
            asset = data["NET_AMOUNT"]
            if_asset = self.judge_if_public(asset)

            asset = deal_html_code.match_float(asset)
            benifit = data["TOTAL_EQUITY"]
            if_benifit = self.judge_if_public(benifit)
            benifit = deal_html_code.match_float(benifit)
            income = data["SERV_FARE_INCOME"]
            if_income = self.judge_if_public(income)
            income = deal_html_code.match_float(income)

            profit = data["PROFIT_TOTAL"]
            if_profit = self.judge_if_public(profit)
            profit = deal_html_code.match_float(profit)

            main_income = data["SALE_INCOME"]
            if_main = self.judge_if_public(main_income)
            main_income = deal_html_code.match_float(main_income)
            net_income = data["PROFIT_RETA"]
            if_net = self.judge_if_public(net_income)
            net_income = deal_html_code.match_float(net_income)
            tax = data["TAX_TOTAL"]
            if_tax = self.judge_if_public(tax)
            tax = deal_html_code.match_float(tax)
            debt = data["DEBT_AMOUNT"]
            if_debt = self.judge_if_public(debt)
            debt = deal_html_code.match_float(debt)
            loan = data["LOAN"]
            if_loan = self.judge_if_public(loan)
            loan = deal_html_code.match_float(loan)
            subsidy = data["SUBSIDY"]
            if_subsidy = self.judge_if_public(subsidy)
            subsidy = deal_html_code.match_float(subsidy)
            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, loan, if_loan, subsidy, if_subsidy
            ]

        else:
            flag = 100000004
        return info, runinfo, flag