示例#1
0
def step2(args, browser):
    regTypeDic = {
        '1': '普通企业--普通执照',
        '2': '普通企业--三证合一',
        '3': '个体工商--普通执照',
        '4': '个体工商--三证合一'
    }
    browser = waitTo(browser, SCENSEE, way='id', name='id00', operate='click')
    time.sleep(0.5)
    if args.type == '4':
        browser.find_element_by_xpath(
            '/html/body/div[2]/div[2]/div/div/div[2]/div/div/ul/li[3]').click(
            )
        time.sleep(0.5)
    browser.find_element_by_xpath(
        f'/html/body/div[2]/div[2]/div/div/div[2]/div/div/ul/li[{args.type}]'
    ).click()
    time.sleep(0.5)
    browser.find_element_by_class_name('cube-picker-confirm').click()  #点击确定
    time.sleep(1)
    if saveToMysql:
        mysqlOpt(
            f"""INSERT INTO registerinfo (CreateDate,Environmental,RegistTypes,LoginID) VALUES ("{time.strftime('%Y-%m-%d %X',time.localtime())}","{envDict[args.env]}","{regTypeDic[args.type]}","{args.loginID}")"""
        )
    else:
        save_file(f"{regTypeDic[args.type]}\n登录号: {args.loginID}")
    print(f"{regTypeDic[args.type]}\n登录号: {args.loginID}\t\t")
    if args.robot:
        saveFileRobot(f"{regTypeDic[args.type]}\n登录号: {args.loginID}\t\t")
    return browser
示例#2
0
def main(args):
    if args.mode == 'a':  #获客查询→一体化进件
        browser, result = getCustomers(args)
        print(result)
        if '需要注册' in result:
            args.all = 'y'
            browser, result = mainYTH(args, bro=browser)
    elif args.mode == 'b':
        args.all = 'n'
        browser, result = mainH5(args)
        browser, result = getCustomers(args, bro=browser)
        print(result)
        browser = loginH5(username=args.loginID,
                          passwd=newpassword,
                          env=args.env,
                          fillLoginID=0,
                          bro=browser)  #修改后的密码登陆
        JBC = True if args.daddy == '2' and args.legalName == '杨光杰' else False
        browser, result = AutoFillH5(loginId=args.loginID,
                                     password=newpassword,
                                     bankCode=args.legal_bank,
                                     env=args.env,
                                     change=change,
                                     JBC=JBC,
                                     bro=browser)
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET IsApplicate=1 WHERE LoginID='{args.loginID}'"
            )
    elif args.mode == 'c':
        args.all = 'y'
        browser, result = mainYTH(args)
        browser, result = getCustomers(args, bro=browser)
        # print(result)
    return browser, result
示例#3
0
def Putong(browser):#选择普通营业执照
	time.sleep(3)
	if args.robot:saveFileRobot('开始填写开户资料')
	browser=waitTo(browser,SCENSEE,way='id',name='certificateType1',operate='click',timeout=30)#选择普通营业执照
	if args.overfill:overFill(browser,'enterpriseName',company.companyName,comId='normalCertificateNo')
	else:browser.find_element_by_id('enterpriseName').send_keys(company.companyName)
	if args.overfill:overFill(browser,'normalAccName1',company.companyName,comId='normalCertificateNo')
	else:browser.find_element_by_id('normalAccName1').send_keys(company.companyName)#经营名称/简称
	#随机选择行业
	browser.find_element_by_id('trdTpCdType1_combobox_default').click()
	if type(1)==type(company.industry):
		browser.find_element_by_xpath(f'//*[@id="trdTpCdType1_combobox_ul"]/li[{company.industry}]').click()
	else:
		company.industry=company.industry if company.industry in industryList else '其他'
		browser.find_element_by_xpath(f'//*[@id="trdTpCdType1_combobox_ul"]/li[text()="{company.industry}"]').click()
	#随机选择区域
	browser.find_element_by_id('province1_combobox_default').click()
	if type(1)==type(company.province):
		browser.find_element_by_xpath(f'//*[@id="province1_combobox_ul"]/li[{company.province}]').click()
	else:
		browser.find_element_by_xpath(f'//*[@id="province1_combobox_ul"]/li[text()="{company.province}"]').click()#点击省
		browser.find_element_by_id('city2_combobox_default').click()
		browser.find_element_by_xpath(f'//*[@id="city1_combobox_ul"]/li[text()="{company.city}"]').click()#点击市
		browser.find_element_by_id('areaCode1_combobox_default').click()
		browser.find_element_by_xpath(f'//*[@id="areaCode1_combobox_ul"]/li[text()="{company.district}"]').click()#点击区
	if args.overfill:overFill(browser,'normalRunAddr',company.officeAddr,comId='normalCertificateNo')
	else:browser.find_element_by_id('normalRunAddr').send_keys(company.officeAddr)#办公地址
	if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET RegistNum='{company.BLRN}' WHERE LoginID='{company.loginID}'")
	else:save_file(f'营业执照注册号: {company.BLRN}')
	print(f'企业名称:{company.companyName}\n营业执照注册号: {company.BLRN}')
	if args.robot:saveFileRobot(f'企业名称:{company.companyName}\n营业执照注册号: {company.BLRN}')
	browser.find_element_by_id('normalCertificateNo').send_keys(company.BLRN)#营业执照注册号,15位数字,随机生成
	# dates=company.regTime
	browser.find_element_by_id('licenseBeginDate').send_keys(company.regTime)#营业执照有效期,开始
	if re.match(r'\d{4}-\d{2}-\d{2}',company.endTime):
		browser.find_element_by_id('licenseEndDate').send_keys(company.endTime)#营业执照有效期,结束
	else:
		browser.find_element_by_id('bizLicenseValidTime1').click()#营业执照有效期,长期
	browser.find_element_by_id('orgCode').send_keys(company.orgCode)#组织机构代码
	browser.find_element_by_id('orgCodeBeginDate').send_keys(company.regTime)#组织机构代码有效期,开始
	if re.match(r'\d{4}-\d{2}-\d{2}',company.endTime):
		browser.find_element_by_id('orgCodeEndDate').send_keys(company.endTime)#组织机构代码有效期,结束
	else:
		browser.find_element_by_id('orgCodeValidTime1').click()#组织机构代码有效期,长期
	browser.find_element_by_id('taxRegCode').send_keys(company.taxRegCode)#税务登记证号,15位数字或字母,随机生成
	browser.find_element_by_id('bankApprovedNum').send_keys(company.permitNum)#开户许可证核准号,14位数字或字母,随机生成
	if args.overfill:overFill(browser,'normalWebInfo',company.fake.url(),comId='normalCertificateNo')
	else:browser.find_element_by_id('normalWebInfo').send_keys(company.fake.url())#网络支付商户网址信息
	if args.overfill:overFill(browser,'normalOperate',company.scope,comId='normalCertificateNo')
	else:browser.find_element_by_id('normalOperate').send_keys(company.scope)#经营范围
	# if args.overfill:overFill(browser,'normalRegAmt',str(company.regCapital),comId='normalCertificateNo')
	# else:
	browser.find_element_by_id('normalRegAmt').send_keys(company.regCapital)#注册资本金	
	return browser
示例#4
0
def Sanzhengheyi(browser):#选择三证合一营业执照
	time.sleep(3)
	if args.robot:saveFileRobot('开始填写开户资料')
	browser=waitTo(browser,SCENSEE,way='id',name='certificateType2',operate='click',timeout=30)#选择三证合一营业执照
	if args.overfill:overFill(browser,'usccCustomerName',company.companyName,comId='usccCodeCertificateNo')
	else:browser.find_element_by_id('usccCustomerName').send_keys(company.companyName)#企业名称
	if args.overfill:overFill(browser,'usccAccName1',company.companyName,comId='usccCodeCertificateNo')
	else:browser.find_element_by_id('usccAccName1').send_keys(company.companyName)#经营名称/简称
	if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET USCNUM='{company.BLRN}' WHERE LoginID='{company.loginID}'")
	else:save_file(f'统一社会信用代码: {company.BLRN}')
	print(f'企业名称:{company.companyName}\n统一社会信用代码: {company.BLRN}')
	if args.robot:saveFileRobot(f'企业名称:{company.companyName}\n统一社会信用代码: {company.BLRN}')
	browser.find_element_by_id('usccCodeCertificateNo').send_keys(company.BLRN)#统一社会信用代码,18位数字或字母,随机生成
	#随机选择区域
	browser.find_element_by_id('province2_combobox_default').click()
	if type(1)==type(company.province):
		browser.find_element_by_xpath(f'//*[@id="province2_combobox_ul"]/li[{company.province}]').click()
	else:
		browser.find_element_by_xpath(f'//*[@id="province2_combobox_ul"]/li[text()="{company.province}"]').click()#点击省
		browser.find_element_by_id('city2_combobox_default').click()
		browser.find_element_by_xpath(f'//*[@id="city2_combobox_ul"]/li[text()="{company.city}"]').click()#点击市
		browser.find_element_by_id('areaCode2_combobox_default').click()
		browser.find_element_by_xpath(f'//*[@id="areaCode2_combobox_ul"]/li[text()="{company.district}"]').click()#点击区
	if args.overfill:overFill(browser,'usccRunAddr',company.officeAddr,comId='usccCodeCertificateNo')
	else:browser.find_element_by_id('usccRunAddr').send_keys(company.officeAddr)#办公地址
	#随机选择行业
	browser.find_element_by_id('trdTpCdType2_combobox_default').click()
	if type(1)==type(company.industry):
		browser.find_element_by_xpath(f'//*[@id="trdTpCdType2_combobox_ul"]/li[{company.industry}]').click()
	else:
		company.industry=company.industry if company.industry in industryList else '其他'
		browser.find_element_by_xpath(f'//*[@id="trdTpCdType2_combobox_ul"]/li[text()="{company.industry}"]').click()
	browser.find_element_by_id('usccLicenseBeginDate').send_keys(company.regTime)#营业执照有效期,开始
	if re.match(r'\d{4}-\d{2}-\d{2}',company.endTime):
		browser.find_element_by_id('usccLicenseEndDate').send_keys(company.endTime)#营业执照有效期,结束
	else:
		browser.find_element_by_id('bizLicenseValidTime2').click()#勾选长期
	# if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET PermitNum='{ACCN}' WHERE LoginID='{company.loginID}'")
	# else:save_file(f'开户许可证核准号: {ACCN}')
	browser.find_element_by_id('usccBankApproved').send_keys(company.permitNum)#开户许可证核准号,14位数字或字母,随机生成
	if args.overfill:overFill(browser,'usccWebInfo',company.fake.url(),comId='usccCodeCertificateNo')
	else:browser.find_element_by_id('usccWebInfo').send_keys(company.fake.url())#网络支付商户网址信息
	if args.overfill:overFill(browser,'usccOperate',company.scope,comId='usccCodeCertificateNo')
	else:browser.find_element_by_id('usccOperate').send_keys(company.scope)#经营范围
	# if args.overfill:overFill(browser,'usccRegAmt',str(company.regCapital),comId='normalCertificateNo')
	# else:
	browser.find_element_by_id('usccRegAmt').send_keys(company.regCapital)#注册资本金
	return browser
示例#5
0
def Getigongshanghu(browser):#选择个体工商户营业执照
	time.sleep(3)
	if args.robot:saveFileRobot('开始填写开户资料')
	browser=waitTo(browser,SCENSEE,way='id',name='certificateType3',operate='click',timeout=30)#选择个体工商户营业执照
	if args.overfill:overFill(browser,'singleCustomerName',company.companyName,comId='singleCertificateNo')
	else:browser.find_element_by_id('singleCustomerName').send_keys(company.companyName)#商户名称
	if args.overfill:overFill(browser,'singleAccName1',company.companyName,comId='singleCertificateNo')
	else:browser.find_element_by_id('singleAccName1').send_keys(company.companyName)#经营名称/简称	
	if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET RegistNum='{company.BLRN}' WHERE LoginID='{company.loginID}'")
	else:save_file(f'营业执照注册号: {company.BLRN}')
	print(f'企业名称:{company.companyName}\n营业执照注册号: {company.BLRN}')
	if args.robot:saveFileRobot(f'企业名称:{company.companyName}\n营业执照注册号: {company.BLRN}')
	browser.find_element_by_id('singleCertificateNo').send_keys(company.BLRN)#营业执照注册号,15至20个字符,随机生成
	#随机选择区域
	browser.find_element_by_id('province3_combobox_default').click()
	if type(1)==type(company.province):
		browser.find_element_by_xpath(f'//*[@id="province3_combobox_ul"]/li[{company.province}]').click()
	else:
		browser.find_element_by_xpath(f'//*[@id="province3_combobox_ul"]/li[text()="{company.province}"]').click()#点击省
		browser.find_element_by_id('city3_combobox_default').click()
		browser.find_element_by_xpath(f'//*[@id="city3_combobox_ul"]/li[text()="{company.city}"]').click()#点击市
		browser.find_element_by_id('areaCode3_combobox_default').click()
		browser.find_element_by_xpath(f'//*[@id="areaCode3_combobox_ul"]/li[text()="{company.district}"]').click()#点击区	
	if args.overfill:overFill(browser,'singleRunAddr',company.officeAddr,comId='singleCertificateNo')
	else:browser.find_element_by_id('singleRunAddr').send_keys(company.officeAddr)#办公地址
	#随机选择行业
	browser.find_element_by_id('trdTpCd_select3').click()
	if type(1)==type(company.industry):
		browser.find_element_by_xpath(f'//*[@id="trdTpCdType3_combobox_ul"]/li[{company.industry}]').click()
	else:
		company.industry=company.industry if company.industry in industryList else '其他'
		browser.find_element_by_xpath(f'//*[@id="trdTpCdType3_combobox_ul"]/li[text()="{company.industry}"]').click()
	browser.find_element_by_id('singleLicenseBeginDate').send_keys(company.regTime)#营业执照有效期,开始
	if re.match(r'\d{4}-\d{2}-\d{2}',company.endTime):
		browser.find_element_by_id('singleLicenseEndDate').send_keys(company.endTime)#营业执照有效期,结束
	else:
		browser.find_element_by_id('bizLicenseValidTime3').click()#勾选长期
	if args.overfill:overFill(browser,'singleOperate',company.scope,comId='singleCertificateNo')
	else:browser.find_element_by_id('singleOperate').send_keys(company.scope)#经营范围
	# browser.find_element_by_id('usccRegAmt').send_keys(company.regCapital)#注册资本金	
	return browser
示例#6
0
def main(args, **bro):
    try:
        global newpassword, paypassword
        browser, result = checkFace(
            uploadPic(
                args,
                fillLegalInfo(
                    args, fillCompanyInfo(args, step2(args, step1(args,
                                                                  **bro))))))
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET IsReview=0,IsApplicate=1 WHERE LoginID='{args.loginID}'"
            )
        if args.all == 'y':
            # browser=bbossCheck(args.loginID,env=args.env,op='3',login=True,bro=browser)
            out('大总管审核中……\t\t\t')
            auditSta = 3 if args.auditSta else 2
            bbCheckData = bbossCheck(args.loginID,
                                     env=args.env,
                                     op='3',
                                     auditSta=auditSta,
                                     path=args.path)
            if bbCheckData['auditSta'] == '审核通过':
                out('大总管审核通过……\t\t\t')
            else:
                print('大总管', bbCheckData['auditSta'], bbCheckData['respCode'],
                      bbCheckData['respMsg'])
                sys.exit()
            if saveToMysql:
                mysqlOpt(
                    f"UPDATE registerinfo SET IsReview=1 WHERE LoginID='{args.loginID}'"
                )
            if args.env in ['k', 'c']:
                # browser,om_cookie=loginOM(env=args.env,bro=browser)
                out('正在获取初始密码...')
                password = getOMpassword(args.loginID,
                                         args.legalTel,
                                         env=args.env,
                                         path=args.path)  #获取初始密码
                out('正在获取商户号...')
                merchantNum = getMerchantNum(args.loginID,
                                             env=args.env,
                                             path=args.path)  #获取商户号
                if saveToMysql:
                    mysqlOpt(
                        f"UPDATE registerinfo SET MerchantNum='{merchantNum}' WHERE loginID='{args.loginID}'"
                    )
            elif args.env in ['p', 's']:
                if args.robot:
                    sendInput('请发送初始密码,格式:初始密码 xxxx')
                    password = getInput('初始密码')
                else:
                    password = input('输入初始密码后按回车,退出请按"q":')
                    if password == 'q':
                        browser.quit()
                        sys.exit(0)
            if saveToMysql:
                mysqlOpt(
                    f"UPDATE registerinfo SET InitialPWD='{password}' WHERE loginID='{args.loginID}'"
                )
            else:
                save_file(f'初始密码: {password}')
            print(f'初始密码: {password}\t\t\t\t')
            if args.robot: saveFileRobot(f'初始密码: {password}\t\t')
            browser = loginH5(username=args.loginID,
                              passwd=password,
                              env=args.env,
                              menhuPath=args.path,
                              bro=browser)  #初始密码登陆
            browser, newpassword = changePasswordH5(loginId=args.loginID,
                                                    password=password,
                                                    newpassword=newpassword,
                                                    paypassword=paypassword,
                                                    env=args.env,
                                                    menhuPath=args.path,
                                                    bro=browser)
            if saveToMysql:
                mysqlOpt(
                    f"UPDATE registerinfo SET Password='******',Payword='{paypassword}' WHERE LoginID='{args.loginID}'"
                )
            else:
                save_file(f'登陆密码: {newpassword}\t支付密码: {paypassword}')
            print(f'登陆密码: {newpassword}\t支付密码: {paypassword}\t\t')
            if args.robot:
                saveFileRobot(f'登陆密码: {newpassword}\t支付密码: {paypassword}\t\t')
        return browser, result
    except Exception as err:
        reason = getErrReason(browser)
        if not reason: reason = err
        print('开户失败!原因:', reason)
        sys.exit()
示例#7
0
def fillCompanyInfo(args, browser):  #types in [1,2,3,4]
    # WebDriverWait(browser,10,0.5,SCENSEE).until(EC.presence_of_element_located((By.XPATH,'//*[@id="id1"]/div[2]/div/input')))
    browser = waitTo(browser, (SCENSEE, SCEENVE, SCESERE),
                     way='xpath',
                     name='//*[@id="id1"]/div[2]/div/input',
                     operate='click')
    if args.overfill:
        browser.find_element_by_xpath(
            '//*[@id="id1"]/div[2]/div/input').send_keys(args.companyName *
                                                         256)
    else:
        browser.find_element_by_xpath(
            '//*[@id="id1"]/div[2]/div/input').send_keys(
                args.companyName)  #企业名称
    print(f'企业名称:{args.companyName}')
    if args.robot: saveFileRobot(f'企业名称:{args.companyName}')
    browser.find_elements_by_class_name('cube-form-field')[2].click()  #区域
    time.sleep(0.5)
    browser.find_element_by_xpath(
        '/html/body/div[5]/div[2]/div/div/div[1]/span[2]').click()  #点击确定
    time.sleep(0.5)
    if args.overfill:
        browser.find_element_by_xpath(
            '//*[@id="id3"]/div[2]/div/input').send_keys(
                fake.address().split()[0] * 256)
    else:
        browser.find_element_by_xpath(
            '//*[@id="id3"]/div[2]/div/input').send_keys(
                fake.address().split()[0])  #办公地址
    browser.find_elements_by_class_name('cube-input-field')[2].send_keys(
        args.precreditID)  #营业执照注册号或统一信用代码
    browser.find_elements_by_class_name('validity')[0].click()  #起始日期
    time.sleep(0.5)
    for year in range(28, randint(20, 25), -1):
        browser.find_element_by_xpath(
            f'/html/body/div[6]/div[2]/div/div/div[2]/div/div[1]/ul/li[{year}]'
        ).click()
        time.sleep(0.5)
    browser.find_element_by_xpath(
        '/html/body/div[6]/div[2]/div/div/div[1]/span[2]').click()  #点击确定
    time.sleep(0.5)
    browser.find_element_by_class_name('cube-checkbox').click()  #勾选长期有效
    browser.find_elements_by_class_name('cube-form-field')[1].click()  #所属行业
    time.sleep(0.5)
    browser.find_element_by_xpath(
        '/html/body/div[3]/div[2]/div/div/div[1]/span[2]').click()  #点击确定
    time.sleep(0.5)
    if args.type == '1':
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET RegistNum='{args.precreditID}' WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file(f'营业执照注册号: {args.precreditID}')
        print(f'营业执照注册号: {args.precreditID}')
        if args.robot: saveFileRobot(f'营业执照注册号: {args.precreditID}')
        browser.find_element_by_xpath(
            '//*[@id="id6"]/div[2]/div/input').send_keys(str(
                uuid1())[:10])  #组织机构代码
        browser.find_elements_by_class_name('validity')[1].click()  #起始日期
        time.sleep(0.5)
        browser.find_element_by_xpath(
            '/html/body/div[6]/div[2]/div/div/div[1]/span[2]').click()  #点击确定
        time.sleep(0.5)
        browser.find_element_by_xpath(
            '//*[@id="id7"]/div[2]/div').click()  #勾选长期有效
        browser.find_element_by_xpath(
            '//*[@id="id8"]/div[2]/div/input').send_keys(
                str(uuid4()).replace('-', '')[:15])  #税务登记号
        browser.find_element_by_xpath(
            '//*[@id="id9"]/div[2]/div/input').send_keys(
                str(uuid1()).replace('-', '')[:14])  #开户许可证核准号
    elif args.type == '2':
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET USCNUM='{args.precreditID}' WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file(f'统一社会信用代码: {args.precreditID}')
        print(f'统一社会信用代码: {args.precreditID}')
        if args.robot: saveFileRobot(f'统一社会信用代码: {args.precreditID}')
        browser.find_element_by_xpath(
            '//*[@id="id6"]/div[2]/div/input').send_keys(
                str(uuid1()).replace('-', '')[:14])  #开户许可证核准号
    elif args.type == '3':
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET RegistNum='{args.precreditID}' WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file(f'营业执照注册号: {args.precreditID}')
        print(f'营业执照注册号: {args.precreditID}')
        if args.robot: saveFileRobot(f'营业执照注册号: {args.precreditID}')
    elif args.type == '4':
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET USCNUM='{args.precreditID}' WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file(f'统一社会信用代码: {args.precreditID}')
        print(f'统一社会信用代码: {args.precreditID}')
        if args.robot: saveFileRobot(f'统一社会信用代码: {args.precreditID}')
    browser.find_element_by_xpath('//*[@id="id11"]/div[2]').click()  #点击工商登记类型
    time.sleep(0.5)
    browser.find_element_by_xpath(
        '/html/body/div[4]/div[2]/div/div/div[1]/span[2]').click()  #点击确定
    time.sleep(0.5)
    if args.overfill:
        browser.find_element_by_xpath(
            '//*[@id="id12"]/div[2]/div/input').send_keys(
                fake.address().split()[0] * 256)
    else:
        browser.find_element_by_xpath(
            '//*[@id="id12"]/div[2]/div/input').send_keys(
                fake.address().split()[0])  #登记注册地址
    if args.overfill:
        browser.find_element_by_xpath(
            '//*[@id="id13"]/div[2]/div/input').send_keys(
                str(randint(100, 1000)) * 256)
    else:
        browser.find_element_by_xpath(
            '//*[@id="id13"]/div[2]/div/input').send_keys(randint(100,
                                                                  1000))  #年收入
    if args.overfill:
        browser.find_element_by_xpath(
            '//*[@id="id14"]/div[2]/div/input').send_keys(fake.name() * 256)
    else:
        browser.find_element_by_xpath(
            '//*[@id="id14"]/div[2]/div/input').send_keys(
                fake.name())  #电信返佣银行账户名(选填)
    if args.overfill:
        browser.find_element_by_xpath(
            '//*[@id="id15"]/div[2]/div/input').send_keys('招商银行' * 256)
    else:
        browser.find_element_by_xpath(
            '//*[@id="id15"]/div[2]/div/input').send_keys(
                '招商银行')  #电信返佣银行账户开户行(选填)
    if args.overfill:
        browser.find_element_by_xpath(
            '//*[@id="id16"]/div[2]/div/input').send_keys(bankCode * 512)
    else:
        browser.find_element_by_xpath(
            '//*[@id="id16"]/div[2]/div/input').send_keys(
                bankCode)  #电信返佣银行账户账号(选填)
    if args.robot: saveFileRobot('开始预授信')
    if args.doPrecredit:
        if args.manual == 'y':
            creditHead = 0
            creditTypeDic = {
                '1': '佣金',
                '2': '采购',
                '3': '小CEO',
            }
            for creditType in args.creditType:
                out(f'正在导入预授信,类型 {creditTypeDic[creditType]}...')
                save_excel(args.precreditID, args.companyName, creditType,
                           args.daddy)
                creditResult, creditHead = uploadExcel(idlist=[company.BLRN],
                                                       env=args.env,
                                                       head=creditHead,
                                                       menhuPath=args.path)
                addWhiteList(args.env, creditHead, company, args.daddy,
                             args.robot)
                if not creditResult:  #预授信
                    if args.robot:
                        print(f'导入预授信失败,类型 {creditTypeDic[creditType]}')
                        sys.exit()
                    else:
                        s = input(
                            f'导入预授信失败,类型 {creditTypeDic[creditType]} ,请手动完成后按回车,退出请按"q":'
                        )
                        if s == 'q':
                            browser.quit()
                            sys.exit(0)
        else:
            if args.robot:
                sendInput('请手动导入预授信后发送 已完成预授信')
                getInput('已完成预授信')
            else:
                s = input('请手动完成预授信后按回车,退出请按"q":')
                if s == 'q':
                    browser.quit()
                    sys.exit(0)
        print('已完成预授信\t\t')
    if args.robot: saveFileRobot('已完成预授信,下一步填写进件信息')
    if saveToMysql:
        mysqlOpt(
            f"UPDATE registerinfo SET IsPreCredit=1 WHERE LoginID='{args.loginID}'"
        )
    else:
        save_file('已完成预授信')
    browser.find_element_by_class_name('nextbtn').click()  #下一步
    return browser
示例#8
0
def main(args, **bro):
    # try:
    global newpassword, paypassword
    browser = uploadPic(
        args,
        fillLegalInfo(
            args,
            fillCompanyInfo(args, step3(args, step2(args, step1(args,
                                                                **bro))))))
    if saveToMysql:
        mysqlOpt(
            f"UPDATE registerinfo SET IsReview=0,IsPreCredit=0,IsApplicate=0 WHERE LoginID='{args.loginID}'"
        )
    if args.robot: saveFileRobot('已提交开户申请,下一步大总管审核')
    out('大总管审核中……\t\t\t')
    auditSta = 3 if args.auditSta else 2
    bbCheckData = bbossCheck(args.loginID,
                             env=args.env,
                             op='',
                             auditSta=auditSta,
                             path=args.path)
    if bbCheckData['auditSta'] == '审核通过':
        out('大总管审核通过……\t\t\t')
    else:
        print('大总管', bbCheckData['auditSta'], bbCheckData['respCode'],
              bbCheckData['respMsg'])
        sys.exit()
    if args.robot: saveFileRobot('大总管审核完成,下一步预授信')
    if saveToMysql:
        mysqlOpt(
            f"UPDATE registerinfo SET IsReview=1 WHERE LoginID='{args.loginID}'"
        )
    if args.doPrecredit:
        if args.manual == 'y':
            creditHead = 0
            creditTypeDic = {
                '1': '*',
                '2': '*',
                '3': '*',
            }
            for creditType in args.creditType:
                out(f'正在导入预授信,类型 {creditTypeDic[creditType]}...')
                save_excel(args.precreditID, args.companyName, creditType,
                           args.daddy)
                creditResult, creditHead = uploadExcel(idlist=[company.BLRN],
                                                       env=args.env,
                                                       head=creditHead,
                                                       menhuPath=args.path)
                addWhiteList(args.env, creditHead, company, args.daddy,
                             args.robot)
                if not creditResult:  #预授信
                    if args.robot:
                        print(f'导入预授信失败,类型 {creditTypeDic[creditType]}')
                        sys.exit()
                    else:
                        s = input(
                            f'导入预授信失败,类型 {creditTypeDic[creditType]} ,请手动完成后按回车,退出请按"q":'
                        )
                        if s == 'q':
                            browser.quit()
                            sys.exit(0)
        else:
            if args.robot:
                sendInput('请手动导入预授信后发送 已完成预授信')
                getInput('已完成预授信')
            else:
                s = input('请手动完成预授信后按回车,退出请按"q":')
                if s == 'q':
                    browser.quit()
                    sys.exit(0)
        print('已完成预授信\t\t')
    if saveToMysql:
        mysqlOpt(
            f"UPDATE registerinfo SET IsPreCredit=1 WHERE LoginID='{args.loginID}'"
        )
    else:
        save_file('已完成预授信')
    if saveToMysql:
        mysqlOpt(
            f"UPDATE registerinfo SET Password='******',Payword='111111' WHERE LoginID='{args.loginID}'"
        )
    else:
        save_file(f'登陆密码: {newpassword}\t支付密码: 111111')
    print(f'登陆密码: {newpassword}\t支付密码: 111111\t\t')
    if args.robot: saveFileRobot(f'登陆密码: {newpassword}\t支付密码: 111111\t\t')
    if args.all in ['y', None, 'Y']:
        browser.get(
            f'{H5domainDic[args.env]}/subapps/bpep-credit-h5/index.html#/login'
        )
        time.sleep(2)
        JBC = True if args.daddy == '2' else False
        browser, result = AutoFillH5(loginId=args.loginID,
                                     password=newpassword,
                                     bankCode=args.legal_bank,
                                     env=args.env,
                                     change=change,
                                     pLegalID=args.pLegalID,
                                     oFill=args.overfill,
                                     JBC=JBC,
                                     robot=args.robot,
                                     bro=browser)
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET IsApplicate=1 WHERE LoginID='{args.loginID}'"
            )
    return browser, result
示例#9
0
def fillCompanyInfo(args, browser):  #types in [1,2,3,4]
    WebDriverWait(browser, 10, 0.5, SCENSEE).until(
        EC.presence_of_element_located(
            (By.XPATH, '//*[@id="id1"]/div[2]/div/input')))
    print(f'企业名称:{args.companyName}')
    if args.robot: saveFileRobot(f'企业名称:{args.companyName}')
    time.sleep(0.5)
    browser.find_element_by_xpath('//*[@id="id3"]').click()  #区域
    time.sleep(0.5)
    browser.find_elements_by_class_name(
        'cube-picker-confirm')[2].click()  #点击确定
    time.sleep(0.5)
    if args.overfill:
        browser.find_element_by_xpath(
            '//*[@id="id4"]/div[2]/div/input').send_keys(
                fake.address().split()[0] * 256)
    else:
        browser.find_element_by_xpath(
            '//*[@id="id4"]/div[2]/div/input').send_keys(
                fake.address().split()[0])  #办公地址
    if args.type == '1':
        # browser.find_element_by_xpath('//*[@id="id5"]/div[2]/div/input').send_keys(args.precreditID)#营业执照注册号
        browser.find_element_by_id('id111').click()  #起始日期
        time.sleep(0.5)
        for year in range(28, randint(20, 25), -1):
            browser.find_element_by_xpath(
                f'/html/body/div[6]/div[2]/div/div/div[2]/div/div[1]/ul/li[{year}]'
            ).click()
            time.sleep(0.5)
        browser.find_elements_by_class_name(
            'cube-picker-confirm')[3].click()  #点击确定
        time.sleep(0.5)
        browser.find_element_by_xpath(
            '//*[@id="id6"]/div[2]/div').click()  #勾选长期有效
        browser.find_element_by_xpath(
            '//*[@id="id7"]/div[2]/div/input').send_keys(str(
                uuid1())[:10])  #组织机构代码
        browser.find_element_by_id('id11').click()  #起始日期
        time.sleep(0.5)
        browser.find_elements_by_class_name(
            'cube-picker-confirm')[3].click()  #点击确定
        time.sleep(0.5)
        browser.find_element_by_xpath(
            '//*[@id="id8"]/div[2]/div').click()  #勾选长期有效
        browser.find_element_by_xpath(
            '//*[@id="id9"]/div[2]/div/input').send_keys(
                str(uuid4()).replace('-', '')[:15])  #税务登记号
        browser.find_element_by_xpath(
            '//*[@id="id10"]/div[2]/div/input').send_keys(
                str(uuid1()).replace('-', '')[:14])  #开户许可证核准号
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET RegistNum='{args.precreditID}' WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file(f'营业执照注册号: {args.precreditID}')
        print(f'营业执照注册号: {args.precreditID}')
        if args.robot: saveFileRobot(f'营业执照注册号: {args.precreditID}')
    elif args.type == '2':
        # browser.find_element_by_xpath('//*[@id="id5"]/div[2]/div/input').send_keys(args.precreditID)#统一信用代码
        browser.find_element_by_id('id11').click()  #起始日期
        time.sleep(0.5)
        for year in range(28, randint(20, 25), -1):
            browser.find_element_by_xpath(
                f'/html/body/div[6]/div[2]/div/div/div[2]/div/div[1]/ul/li[{year}]'
            ).click()
            time.sleep(0.5)
        browser.find_elements_by_class_name(
            'cube-picker-confirm')[3].click()  #点击确定
        time.sleep(0.5)
        browser.find_element_by_xpath(
            '//*[@id="id6"]/div[2]/div').click()  #勾选长期有效
        browser.find_element_by_xpath(
            '//*[@id="id7"]/div[2]/div/input').send_keys(
                str(uuid1()).replace('-', '')[:14])  #开户许可证核准号
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET USCNUM='{args.precreditID}' WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file(f'统一社会信用代码: {args.precreditID}')
        print(f'统一社会信用代码: {args.precreditID}')
        if args.robot: saveFileRobot(f'统一社会信用代码: {args.precreditID}')
    elif args.type == '3':
        # browser.find_element_by_xpath('//*[@id="id5"]/div[2]/div/input').send_keys(args.precreditID)#统一信用代码
        browser.find_element_by_id('id11').click()  #起始日期
        time.sleep(0.5)
        for year in range(28, randint(20, 25), -1):
            browser.find_element_by_xpath(
                f'/html/body/div[6]/div[2]/div/div/div[2]/div/div[1]/ul/li[{year}]'
            ).click()
            time.sleep(0.5)
        browser.find_elements_by_class_name(
            'cube-picker-confirm')[3].click()  #点击确定
        time.sleep(0.5)
        browser.find_element_by_xpath(
            '//*[@id="id7"]/div[2]/div').click()  #勾选长期有效
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET RegistNum='{args.precreditID}' WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file(f'营业执照注册号: {args.precreditID}')
        print(f'营业执照注册号: {args.precreditID}')
        if args.robot: saveFileRobot(f'营业执照注册号: {args.precreditID}')
    elif args.type == '4':
        # browser.find_element_by_xpath('//*[@id="id6"]/div[2]/div/input').send_keys(args.precreditID)#统一信用代码
        browser.find_element_by_id('id11').click()  #起始日期
        time.sleep(0.5)
        for year in range(28, randint(20, 25), -1):
            browser.find_element_by_xpath(
                f'/html/body/div[6]/div[2]/div/div/div[2]/div/div[1]/ul/li[{year}]'
            ).click()
            time.sleep(0.5)
        browser.find_elements_by_class_name(
            'cube-picker-confirm')[3].click()  #点击确定
        time.sleep(0.5)
        browser.find_element_by_xpath(
            '//*[@id="id7"]/div[2]/div').click()  #勾选长期有效
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET USCNUM='{args.precreditID}' WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file(f'统一社会信用代码: {args.precreditID}')
        print(f'统一社会信用代码: {args.precreditID}')
        if args.robot: saveFileRobot(f'统一社会信用代码: {args.precreditID}')
    browser.find_element_by_xpath('//*[@id="id2"]/div[2]').click()  #所属行业
    time.sleep(0.5)
    browser.find_elements_by_class_name(
        'cube-picker-confirm')[1].click()  #点击确定
    time.sleep(0.5)
    browser.find_element_by_tag_name('button').click()  #下一步
    time.sleep(2)
    return browser
示例#10
0
def step3(args, browser):
    # browser=waitTo(browser,SCENSEE,way='id',name='btloginKey',operate='click')
    time.sleep(3)
    # os.system('pause')
    browser.quit()
    browser = loginH5(username=args.loginID,
                      passwd=newpassword,
                      env=args.env,
                      menhuPath=args.path,
                      phoneNumber=args.legalTel)
    time.sleep(3)
    browser = waitTo(browser,
                     SCENSEE,
                     way='class',
                     name='paramsBtn',
                     operate='click')  #点击立即开通
    regTypeDic = {
        '1': '普通企业--普通执照',
        '2': '普通企业--三证合一',
        '3': '个体工商--普通执照',
        '4': '个体工商--三证合一'
    }
    time.sleep(2)
    browser = waitTo(browser,
                     SCENSEE,
                     way='xpath',
                     name='//*[@id="id2"]/div[2]',
                     operate='click')  #点击商户类型
    time.sleep(0.5)
    if args.type == '4':
        browser.find_element_by_xpath(
            '/html/body/div[3]/div[2]/div/div/div[2]/div/div/ul/li[2]').click(
            )
        time.sleep(0.5)
    browser.find_element_by_xpath(
        f'/html/body/div[3]/div[2]/div/div/div[2]/div/div/ul/li[{args.type}]'
    ).click()
    time.sleep(0.5)
    browser.find_element_by_class_name('cube-picker-confirm').click()  #点击确定
    time.sleep(1)
    if args.type in '13': xpath = '//*[@id="id3"]/div[2]/div[1]/div/input'
    elif args.type in '24': xpath = '//*[@id="id4"]/div[2]/div[1]/div/input'
    browser.find_element_by_xpath(xpath).clear()
    browser.find_element_by_xpath(xpath).send_keys(args.precreditID)
    browser.find_element_by_xpath(
        '//*[@id="id5"]/div[2]/div[1]/div/input').send_keys(args.legalName)
    browser.find_element_by_xpath(
        '//*[@id="id6"]/div[2]/div[1]/div/input').send_keys(args.legalID)
    browser.find_element_by_class_name('submit').click()  #点击提交
    if saveToMysql:
        mysqlOpt(
            f"""INSERT INTO registerinfo (CreateDate,Environmental,RegistTypes,LoginID) VALUES ("{time.strftime('%Y-%m-%d %X',time.localtime())}","{envDict[args.env]}","{regTypeDic[args.type]}","{args.loginID}")"""
        )
    else:
        save_file(f"{regTypeDic[args.type]}\n登录号: {args.loginID}")
    print(f"{regTypeDic[args.type]}\n登录号: {args.loginID}")
    if args.robot:
        saveFileRobot(f"{regTypeDic[args.type]}\n登录号: {args.loginID}")
    time.sleep(5)
    browser = waitTo(browser,
                     SCENSEE,
                     way='tag_name',
                     name='input',
                     operate='click')  #点击立即激活
    browser = waitTo(browser,
                     SCENSEE,
                     way='xpath',
                     name='//*[@id="id1"]/div[2]',
                     operate='click')  #点击所属省份
    time.sleep(0.5)
    browser.find_element_by_class_name('cube-picker-confirm').click()  #点击确定
    time.sleep(0.5)
    browser.find_element_by_tag_name('button').click()  #点击下一步
    return browser
示例#11
0
def main(**bro):
	try:
		global newpassword,paypassword,manHead,liaHead,browserFund
		if args.getRegUrl:
			longUrl=f"{domain}/bestpay/register?{encryptRegData(company.loginID,time.strftime('%Y%m%d%H%M%S',time.localtime()),platCode)}"
			shortUrl=getShortUrl(longUrl)
			if shortUrl:
				print(shortUrl)
			else:
				print(longUrl)
			print()
			sys.exit()
		if bro:
			browser=bro['bro']
			browser.get(f"{domain}/bestpay/register?{encryptRegData(company.loginID,time.strftime('%Y%m%d%H%M%S',time.localtime()),platCode,company.email)}")
		else:
			browser=openurl(f"{domain}/bestpay/register?{encryptRegData(company.loginID,time.strftime('%Y%m%d%H%M%S',time.localtime()),platCode,company.email)}")
		if args.mode=='b':
			print('-'*50,'注册:',gradeDic[args.grade],'-'*50)
			if args.robot:saveFileRobot(f"{'-'*50} 注册:{gradeDic[args.grade]} {'-'*50}")
		print(f"PC {envDict[args.env]} {time.strftime('%Y-%m-%d %X',time.localtime())}")
		if args.robot:saveFileRobot(f"PC {envDict[args.env]} {time.strftime('%Y-%m-%d %X',time.localtime())}")
		if saveToMysql:mysqlOpt(f"""INSERT INTO registerinfo (CreateDate,Environmental,Grade,loginID,RegistTypes) VALUES ("{time.strftime('%Y-%m-%d %X',time.localtime())}","PC {envDict[args.env]}","{gradeDic[args.grade]}","{company.loginID}","{regTypeDic[args.type]}")""")
		else:save_file(f'登录号: {company.loginID}\n{regTypeDic[args.type]}')
		print(f'登录号: {company.loginID}\n{regTypeDic[args.type]}')	
		if args.robot:saveFileRobot(f'登录号: {company.loginID}\n{regTypeDic[args.type]}')	
		# if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET RegistTypes='{regTypeDic[args.type]}' WHERE LoginID='{company.loginID}'")
		# else:save_file(regTypeDic[args.type])
		# print(regTypeDic[args.type])
		if args.type=='1':browser=fillbankinfor(postpic0(beneficiaryInfo(legalinformation(Putong(browser)))),0)
		elif args.type=='2':browser=fillbankinfor(postpic1(beneficiaryInfo(legalinformation(Sanzhengheyi(browser)))),1)
		elif args.type=='3':browser=fillbankinfor(postpic2(beneficiaryInfo(legalinformation(Getigongshanghu(browser)))),2)
		elif args.type=='4':browser=fillbankinfor(postpic3(Geti(browser)),3)
		if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET IsReview=0,IsPreCredit=0,IsApplicate=0 WHERE LoginID='{company.loginID}'")
		if args.noCheck:#小CEO批量模式
			# browser.quit()
			return '提交完成',browser
		if args.robot:saveFileRobot('已提交开户申请,下一步大总管审核……')
		# browser=bbossCheck(company.loginID,env=args.env,bro=browser)
		out('大总管审核中……\t\t\t')
		auditSta=3 if args.auditSta else 2
		bbCheckData=bbossCheck(company.loginID,env=args.env,op='1',auditSta=auditSta,path=args.path)
		if bbCheckData['auditSta']=='审核通过':
			out('大总管审核通过……\t\t\t')
		else:
			print('大总管',bbCheckData['auditSta'],bbCheckData['respCode'],bbCheckData['respMsg'])
			sys.exit()
		if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET IsReview=1 WHERE LoginID='{company.loginID}'")
		if args.robot:saveFileRobot('大总管已审核,下一步获取初始密码……')
		if args.env in ['k','c']:
			# browser,om_cookie=loginOM(env=args.env,bro=browser)
			out('正在获取初始密码...')
			password=getOMpassword(company.loginID,company.legalTel,env=args.env,path=args.path)#获取初始密码
			out('正在获取商户号...')
			merchantNum=getMerchantNum(company.loginID,env=args.env,path=args.path)#获取商户号
			if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET MerchantNum='{merchantNum}' WHERE LoginID='{company.loginID}'")
		elif args.env in ['p','s']:
			if args.robot:
				sendInput('请发送初始密码,格式:初始密码 xxxx')
				password=getInput('初始密码')
			else:
				password=input('输入初始密码后按回车,退出请按"q":')
				if password=='q':
					browser.quit()
					sys.exit(0)
		if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET InitialPWD='{password}' WHERE LoginID='{company.loginID}'")
		else:save_file(f'初始密码: {password}')
		print(f'初始密码: {password}\t\t\t\t')
		if args.robot:saveFileRobot(f'初始密码: {password}')
		if noPic or args.env=='k':#H5没有开发环境
		# if 1==1:
			browser=changePassword(company.loginID,password,newpassword,paypassword,env=args.env,bro=browser)
		else:#不禁止加载图片则可以去H5页面修改密码
			browser1=loginH5(username=company.loginID,passwd=password,env=args.env,menhuPath=args.path)#初始密码登陆
			browser1,newpassword=changePasswordH5(loginId=company.loginID,password=password,newpassword=newpassword,paypassword=paypassword,env=args.env,menhuPath=args.path,bro=browser1)
			browser1.quit()
		if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET Password='******',Payword='{paypassword}' WHERE LoginID='{company.loginID}'")
		else:save_file(f'登陆密码: {newpassword}\t支付密码: {paypassword}')
		print(f'登陆密码: {newpassword}\t支付密码: {paypassword}')
		if args.robot:saveFileRobot(f'登陆密码: {newpassword}\t支付密码: {paypassword}')
		result='密码修改完成!'
		creditTypeDic={'1':'佣金','2':'采购','3':'小CEO',}
		if args.mode=='a':
			if args.precredit=='y':
				creditHead=0
				for creditType in args.creditType:
					out(f'正在导入预授信,类型 {creditTypeDic[creditType]}...')
					save_excel(company.BLRN,company.companyName,creditType,args.daddy)
					creditResult,creditHead=uploadExcel(idlist=[company.BLRN],env=args.env,head=creditHead,menhuPath=args.path)
					addWhiteList(args.env,creditHead,company,args.daddy,args.robot)
					if not creditResult:#预授信
						if args.robot:
							print(f'导入预授信失败,类型 {creditTypeDic[creditType]}')
							sys.exit()
						else:
							s=input(f'导入预授信失败,类型 {creditTypeDic[creditType]} ,请手动完成后按回车,退出请按"q":')
							if s=='q':
								browser.quit()
								sys.exit(0)
			else:
				if args.robot:
					sendInput('请手动导入预授信后发送 已完成预授信')
					getInput('已完成预授信')
				else:
					s=input('请手动完成预授信后按回车,退出请按"q":')
					if s=='q':
						browser.quit()
						sys.exit(0)
			if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET IsPreCredit=1 WHERE LoginID='{company.loginID}'")
			else:save_file('已完成预授信')
			print('已完成预授信\t\t')
			if args.robot:saveFileRobot('已完成预授信\t\t')
			if args.all=='y':
				JBC=True if args.daddy=='2' else False
				browser,result=AutoFill(company.loginID,newpassword,env=args.env,bankCode=company.bankCode,oFill=args.overfill,pLegalID=company.getPlegalID(company.legalID),JBC=JBC,robot=args.robot,path=args.path,bro=login(company.loginID,newpassword,env=args.env,menhuPath=args.path,bro=browser))
				if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET IsApplicate=1 WHERE LoginID='{company.loginID}'")
				else:save_file(f"完成! {time.strftime('%Y-%m-%d %X',time.localtime())}")
			browser.quit()
			return f'{result}\t\t\t\t'
		elif args.mode=='b':
			browser=login(username=company.loginID,passwd=newpassword,env=args.env,menhuPath=args.path,bro=browser)#改完密码后登陆
			browser,initialPWD=addOperator(opLoginID=company.opLoginID,env=args.env,newRole=1,bro=browser)#新增操作员
			if saveToMysql:mysqlOpt(f"""INSERT INTO registerinfo (CreateDate,Environmental,Grade,loginID,RegistTypes,InitialPWD) VALUES ("{time.strftime('%Y-%m-%d %X',time.localtime())}","PC {envDict[args.env]}","{gradeDic[args.grade]}","{company.opLoginID}","操作员","{initialPWD}")""")
			else:save_file(f'操作员登录号: {company.opLoginID}')
			print(f'操作员登录号: {company.opLoginID}\t初始密码:{initialPWD}')
			if args.robot:saveFileRobot(f'操作员登录号: {company.opLoginID}\t初始密码:{initialPWD}')
			if noPic or args.env=='k':#H5没有开发环境
				browser=changePassword(company.opLoginID,initialPWD,newpassword,paypassword,env=args.env,bro=browser)
			else:#不禁止加载图片则可以去H5页面修改密码
				# browser.quit()
				browser1=loginH5(username=company.opLoginID,passwd=initialPWD,env=args.env,menhuPath=args.path)#初始密码登陆
				browser1,newpassword=changePasswordH5(loginId=company.opLoginID,password=initialPWD,newpassword=newpassword,paypassword=paypassword,env=args.env,menhuPath=args.path,bro=browser1)
				browser1.quit()
			if saveToMysql:mysqlOpt(f"UPDATE registerinfo SET Password='******',Payword='{paypassword}' WHERE LoginID='{company.opLoginID}'")
			else:save_file(f'操作员登陆密码: {newpassword}\t操作员支付密码: {paypassword}')
			print(f'操作员登陆密码: {newpassword}\t操作员支付密码: {paypassword}')
			if args.robot:saveFileRobot(f'操作员登陆密码: {newpassword}\t操作员支付密码: {paypassword}')
			#电子凭证授信
			company.cusType='CORE' if args.grade=='1' else 'CUSTOMER'
			browser.maximize_window()
			browser,result,manHead,liaHead=AutoFillElect(company=company,renewal='n',reFill='y',passwd=newpassword,bro=browser)
			print(f'{result}\t\t\t\t')
			if args.robot:saveFileRobot(result)
			# 翼融平台客户录入
			browser.find_element_by_id('login').click()#登出
			if browserFund:
				browserFund=entryCustInfo(company=company,jump=0,needLogin=0,bro=browserFund)#换资金方经办员录入客户信息
			else:
				browserFund=entryCustInfo(company=company,jump=1,needLogin=1)#换资金方经办员录入客户信息
			print('翼融平台客户录入成功!\t\t\t\t\t\n')
			if args.robot:saveFileRobot('翼融平台客户录入成功!')
			return browser,browserFund
	except Exception as err:
		reason=getErrReason(browser)
		if not reason:reason=err
		print('开户失败!原因:',reason)
		sys.exit()
示例#12
0
def main(args, **bro):
    try:
        global newpassword, paypassword
        browser = uploadPic(
            args,
            fillLegalInfo(
                args,
                fillCompanyInfo(args,
                                step3(args, step2(args, step1(args, **bro))))))
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET IsReview=0,IsPreCredit=0,IsApplicate=0 WHERE LoginID='{args.loginID}'"
            )
        if args.robot: saveFileRobot('已提交开户申请,下一步大总管审核')
        # browser=bbossCheck(args.loginID,env=args.env,op='3',bro=browser)
        out('大总管审核中……\t\t\t')
        auditSta = 3 if args.auditSta else 2
        bbCheckData = bbossCheck(args.loginID,
                                 env=args.env,
                                 op='3',
                                 auditSta=auditSta,
                                 path=args.path)
        # print("pathH5:",args.path)
        if bbCheckData['auditSta'] == '审核通过':
            out('大总管审核通过……\t\t\t')
        else:
            print('大总管', bbCheckData['auditSta'], bbCheckData['respCode'],
                  bbCheckData['respMsg'])
            sys.exit()
        if args.robot: saveFileRobot('大总管审核完成,下一步预授信')
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET IsReview=1 WHERE LoginID='{args.loginID}'"
            )
        if args.doPrecredit:
            if args.manual == 'y':
                creditHead = 0
                creditTypeDic = {
                    '1': '佣金',
                    '2': '采购',
                    '3': '小CEO',
                }
                for creditType in args.creditType:
                    out(f'正在导入预授信,类型 {creditTypeDic[creditType]}...')
                    save_excel(args.precreditID, args.companyName, creditType,
                               args.daddy)
                    creditResult, creditHead = uploadExcel(
                        idlist=[company.BLRN],
                        env=args.env,
                        head=creditHead,
                        menhuPath=args.path)
                    addWhiteList(args.env, creditHead, company, args.daddy,
                                 args.robot)
                    if not creditResult:  #预授信
                        if args.robot:
                            print(f'导入预授信失败,类型 {creditTypeDic[creditType]}')
                            sys.exit()
                        else:
                            s = input(
                                f'导入预授信失败,类型 {creditTypeDic[creditType]} ,请手动完成后按回车,退出请按"q":'
                            )
                            if s == 'q':
                                browser.quit()
                                sys.exit(0)
            else:
                if args.robot:
                    sendInput('请手动导入预授信后发送 已完成预授信')
                    getInput('已完成预授信')
                else:
                    s = input('请手动完成预授信后按回车,退出请按"q":')
                    if s == 'q':
                        browser.quit()
                        sys.exit(0)
            print('已完成预授信\t\t')
        if args.robot: saveFileRobot('已完成预授信,下一步获取初始密码')
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET IsPreCredit=1 WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file('已完成预授信')
        if args.env == 'c':
            # browser,om_cookie=loginOM(env=args.env,bro=browser)
            out('正在获取初始密码...')
            password = getOMpassword(args.loginID,
                                     args.legalTel,
                                     env=args.env,
                                     path=args.path)
            out('正在获取商户号...')
            merchantNum = getMerchantNum(args.loginID,
                                         env=args.env,
                                         path=args.path)
            if saveToMysql:
                mysqlOpt(
                    f"UPDATE registerinfo SET MerchantNum='{merchantNum}',InitialPWD='{password}' WHERE LoginID='{args.loginID}'"
                )
            else:
                save_file(f'初始密码: {password}')
        elif args.env in ['p', 's']:
            if args.robot:
                sendInput('请发送初始密码,格式:初始密码 xxxx')
                password = getInput('初始密码')
            else:
                password = input('输入初始密码后按回车,退出请按"q":')
                if password == 'q':
                    browser.quit()
                    sys.exit(0)
            if saveToMysql:
                mysqlOpt(
                    f"UPDATE registerinfo SET InitialPWD='{password}' WHERE LoginID='{args.loginID}'"
                )
            else:
                save_file(f'初始密码: {password}')
        print(f'初始密码: {password}\t\t\t\t')
        if args.robot: saveFileRobot(f'初始密码: {password}')
        browser = loginH5(username=args.loginID,
                          passwd=password,
                          env=args.env,
                          menhuPath=args.path,
                          bro=browser)  #初始密码登陆
        browser, newpassword = changePasswordH5(loginId=args.loginID,
                                                password=password,
                                                newpassword=newpassword,
                                                paypassword=paypassword,
                                                env=args.env,
                                                menhuPath=args.path,
                                                bro=browser)
        if saveToMysql:
            mysqlOpt(
                f"UPDATE registerinfo SET Password='******',Payword='{paypassword}' WHERE LoginID='{args.loginID}'"
            )
        else:
            save_file(f'登陆密码: {newpassword}\t支付密码: {paypassword}')
        print(f'登陆密码: {newpassword}\t支付密码: {paypassword}\t\t')
        if args.robot:
            saveFileRobot(f'登陆密码: {newpassword}\t支付密码: {paypassword}\t\t')
        result = '密码修改完成!'
        if args.all in ['y', None, 'Y']:
            browser = loginH5(username=args.loginID,
                              passwd=newpassword,
                              env=args.env,
                              fillLoginID=0,
                              menhuPath=args.path,
                              bro=browser)  #修改后的密码登陆
            JBC = True if args.daddy == '2' else False
            browser, result = AutoFillH5(loginId=args.loginID,
                                         password=newpassword,
                                         bankCode=args.legal_bank,
                                         env=args.env,
                                         change=change,
                                         pLegalID=args.pLegalID,
                                         oFill=args.overfill,
                                         JBC=JBC,
                                         robot=args.robot,
                                         bro=browser)
            if saveToMysql:
                mysqlOpt(
                    f"UPDATE registerinfo SET IsApplicate=1 WHERE LoginID='{args.loginID}'"
                )
            # browser.quit()
        return browser, result
    except Exception as err:
        reason = getErrReason(browser)
        if not reason: reason = err
        print('开户失败!原因:', reason)
        sys.exit()