def test_random_product_22_base_data_push(self): """基础数据推送数据""" try: self.test_random_product_21_funds_raise() except Exception as e: self.log.error("募资错误") raise e # self.apply_code = 'NT20180529E08' # 修改放款 sql_1 = "UPDATE house_common_loan_info t SET t.pay_date=sysdate, t.status='LOAN_PASS' \ WHERE t.apply_id= (SELECT t.apply_id FROM house_apply_info t \ WHERE t.apply_code =" + "'" + self.apply_code + "'" + ")" sql_2 = "UPDATE house_funds_info t SET t.Funds_Status = 21 \ WHERE t.apply_id = (SELECT t.apply_id FROM house_apply_info t \ WHERE t.apply_code = " + "'" + self.apply_code + "'" + ")" # 修改合同签约表 sql_3 = "UPDATE HOUSE_CONTRACT_SIGN SET STATUS = 'PASS' " \ " WHERE APPLY_ID = (SELECT t.apply_id FROM house_apply_info t \ WHERE t.apply_code =" + "'" + self.apply_code + "')" db = database.DB() db.sql_execute(sql_1) db.sql_execute(sql_2) db.sql_execute(sql_3) db.sql_commit() time.sleep(3) # 基础数据同步 page = Login(self.treasurer) self.BaseData.push_data_to_financial(page, self.apply_code) page.driver.quit()
def test_10_part_authority_card_second_deal(self): """第二次权证办理""" self.test_09_part_funds_raise() self.case_name = custom.get_current_function_name() page = Login(self.company["authority_member"]["user"]) # 修改数据库,将第一次请款修改为放款成功,然后才能发起第二次权证请款,否则第二次权证办理不能跟提交 db = database.DB() sql_1 = "UPDATE house_common_loan_info t SET t.pay_date=sysdate, t.status='LOAN_PASS' \ WHERE t.apply_id= (SELECT t.apply_id FROM house_apply_info t \ WHERE t.apply_code =" + "'" + self.apply_code + "'" + ")" contract_no = self.apply_code + '-3-02-1' sql_2 = "UPDATE house_funds_info t SET t.Funds_Status = 21 \ WHERE t.apply_id = (SELECT t.apply_id FROM house_apply_info t \ WHERE t.apply_code = " + "'" + self.apply_code + "'" + ")" + "AND CONTRACT_NO =" + "'" + contract_no + "'" db.sql_execute(sql_1) db.sql_execute(sql_2) db.sql_commit() time.sleep(3) # 权证员上传权证信息 res = self.WM.authority_card_transact_2(page, self.apply_code, 2, self.env) if not res: self.log.error("上传权证资料失败") raise ValueError("上传权证资料失败") else: self.log.info("权证办理完成") self.next_user_id = common.get_next_user(page, self.apply_code)
def test_query_all_enable_product(self): """查询房贷所有的已启动的产品""" self.log.info("查询房贷所有的已启动的产品") db = database.DB() sql = """ SELECT NAME FROM BASE_PRODUCT WHERE PRODUCT_TYPE_ID = '4003156770' AND STATUS = 'enable' """ db.sql_execute(sql) res = db.sql_print() import report r_dir = report.__path__[0] l_p = os.path.join(r_dir, 'product.xlsx') workbook = xlsxwriter.Workbook(l_p) worksheet = workbook.add_worksheet() lth = res.__len__() fm = workbook.add_format({ 'align': 'center', }) worksheet.write(0, 0, "序号") worksheet.write(0, 1, "名称") for i in range(1, lth): worksheet.write(i, 0, i, fm) worksheet.write(i, 1, res[i])
def test_query_all_disable_product(self): """查询房贷所有的已停用的产品""" self.log.info("查询房贷所有的已启动的产品") db = database.DB() sql = """ SELECT NAME FROM BASE_PRODUCT WHERE PRODUCT_TYPE_ID = '4003156770' AND STATUS = 'disable' """ db.sql_execute(sql) db.sql_print()
def test_01_specail_part_raise(self): """第一次全额请款,第二次为0""" self.case_name = custom.get_current_function_name() # ------------合同打印------------- try: self.before_contract_sign(200000) rc = Cts.ContractSign(self.page, self.apply_code, self.rec_bank_info) res = rc.execute_enter_borroers_bank_info() if res: rc.contract_submit() # 提交 except Exception as e: self.run_result = False raise e self.next_user_id = common.get_next_user(self.page, self.apply_code) # ------------合规审查------------------ # 下一个处理人重新登录 page = Login(self.next_user_id) # 合规审查 res = self.PT.compliance_audit(page, self.apply_code) if res: self.log.info("合规审批结束") page.driver.quit() else: raise ValueError("合规审查失败") # ------------权证办理---------------- page = Login(self.company["authority_member"]["user"]) # 权证员上传权证信息 res = self.WM.authority_card_transact_2(page, self.apply_code, 1, self.env) if not res: raise ValueError("上传权证资料失败") else: self.log.info("权证办理完成") self.next_user_id = common.get_next_user(page, self.apply_code) # ------------权证请款---------------- # 下一个处理人重新登录 page = Login(self.next_user_id) # 部分请款 res = self.PT.part_warrant_apply(page, self.apply_code, 0) if not res: raise AssertionError('权证请款失败!') else: self.log.info("完成权证请款") self.next_user_id = common.get_next_user(page, self.apply_code) # 权证审批流程 roles = ['回执分公司主管', '回执审批经理审批', '回执业务助理处理'] for i in roles: page = Login(self.next_user_id) rec = self.PT.receipt_return(page, self.apply_code) if not rec: self.log.error(i + "审批失败") raise ValueError('失败') else: self.log.info(i + "审批通过") self.next_user_id = common.get_next_user(page, self.apply_code) # ------------财务流程---------------------- page = Login(self.company["business_assistant"]["user"]) rs = self.FA.finace_transact(page, self.apply_code) if not rs: self.log.error("财务办理失败") raise AssertionError('财务办理失败') else: self.log.info("财务办理结束!") # 查看下一步处理人 self.next_user_id = common.get_next_user(page, self.apply_code, 1) role2 = ['分公司经理审', '风控经理', '财务会计', '财务经理'] for e in role2: self.case_name = custom.get_current_function_name() page = Login(self.next_user_id) result = self.FA.finace_approval(page, self.apply_code, e + '审批通过') if not result: raise AssertionError(e + '审批失败') # 查看下一步处理人 self.next_user_id = common.get_next_user(page, self.apply_code, 1) # ----------发起募资----------------------------- page = Login(self.treasurer) res = self.RA.funds_raise(page, self.apply_code, '第一次资金主管募资发起') if not res: self.log.error("募资-资金主管审批失败") raise AssertionError('募资-资金主管审批失败') else: self.log.info("募资-资金主管审批完成!") page.driver.quit() # 修改数据表为放款成功! db = database.DB() sql_1 = "UPDATE house_common_loan_info t SET t.pay_date=sysdate, t.status='LOAN_PASS' \ WHERE t.apply_id= (SELECT t.apply_id FROM house_apply_info t \ WHERE t.apply_code =" + "'" + self.apply_code + "'" + ")" contract_no = self.apply_code + '-3-02-1' sql_2 = "UPDATE house_funds_info t SET t.Funds_Status = 21 \ WHERE t.apply_id = (SELECT t.apply_id FROM house_apply_info t \ WHERE t.apply_code = " + "'" + self.apply_code + "'" + ")" + "AND CONTRACT_NO =" + "'" + contract_no + "'" db.sql_execute(sql_1) db.sql_execute(sql_2) db.sql_commit() time.sleep(3) # ----------第二次权证办理----------------------------- page = Login(self.company["authority_member"]["user"]) # 权证员上传权证信息 res = self.WM.authority_card_transact_2(page, self.apply_code, 2, self.env) if not res: self.log.error("上传权证资料失败") raise ValueError("上传权证资料失败") else: self.log.info("权证办理完成") self.next_user_id = common.get_next_user(page, self.apply_code) # ---------第二次权证请款-------------------------------- # 下一个处理人重新登录 page = Login(self.next_user_id) # 第二次请款金额为0 res = self.PT.part_warrant_apply(page, self.apply_code, 2) if not res: raise ValueError('第二次权证请款金额为0请款流程出错!') else: self.log.info("第二次权证请款金额为0请款流程ok!") self.next_user_id = common.get_next_user(page, self.apply_code) page.driver.quit() # --------------------------回执审批流程--------------------- page = Login(self.next_user_id) rec = self.PT.receipt_return(page, self.apply_code) if not rec: self.log.error("审批失败") raise ValueError('失败') else: self.log.info("审批通过,放款成功") page.driver.quit()
def __init__(self): self.log = custom.mylog() self.db = database.DB()