def guaranteePayCommit(self, token): # 追偿逾期还款 -------> 追偿逾期还款 db_info = self.get_coreDB_info() get_loanNo_sql = "SELECT * from (select LOAN_NO from ph_disposal_loanplan GROUP BY LOAN_NO ORDER BY LOAN_NO DESC) WHERE ROWNUM=1" loanNo = oracle_sql(db_info, get_loanNo_sql)[0][0] get_guaranteePay_sql = "select * from ph_disposal_repayrecord where loan_no = '%s'" % loanNo actual_org = oracle_sql(db_info, get_guaranteePay_sql)[0] org_money = actual_org[6] + actual_org[8] + actual_org[ 10] + actual_org[12] + actual_org[14] path = '/plms-repay-service/http/repay/guaranteePay/guaranteePayCommit' data = {"loanNo": loanNo, "repayAmount": "10"} header = self.get_PLMS_header() header["acctoken"] = token res = requests.post(self.url + path, json=data, headers=header).json() retCode = res.get('retCode') return retCode, loanNo, org_money
def test_PLMS_004_追偿逾期还款(self): token = self.login() retCode, loanNo, org_money = self.guaranteePayCommit(token) # 接口返回结果判断 self.assertEqual(retCode, '000000') # 数据库结果判断 status为S db_info = self.get_coreDB_info() get_guaranteePay_sql = "select * from ph_disposal_repayrecord where loan_no = '%s'" % loanNo actual_new = oracle_sql(db_info, get_guaranteePay_sql)[0] new_money = actual_new[6] + actual_new[8] + actual_new[ 10] + actual_new[12] + actual_new[14] money = new_money - org_money self.assertEqual(money, 10) print("追偿逾期还款成功", loanNo, 10)
def xg_test_PLMS_003_代偿手续费还款(self): token = self.login() loanNo, paySum = self.getCompensatoryFeeInfoList(token) retCode = self.payPguaFee(token, loanNo, paySum) # 接口返回结果判断 self.assertEqual(retCode, '000000') # 数据库结果判断 status为S db_info = self.get_coreDB_info() sql = "select * from PH_LOANOUT_FEE_REPAY_RECORD ee where ee.loan_no='%s'" % loanNo res = oracle_sql(db_info, sql) flag = 0 if not res else res[0][-3] actual_pay = 0 if not res else res[0][-5] self.assertEqual(flag, "1") self.assertEqual(str(actual_pay), paySum) print("代偿手续费还款成功", loanNo, paySum)
def xg_test_PLMS_001_一次性费用还款(self): # 测试步骤 token = self.login() loanNo = self.getLoanNo(token) paySum = self.getOnceFeeDetail(token, loanNo) retCode = self.onceFeeDeduct(token, loanNo, paySum) # 接口返回结果判断 self.assertEqual(retCode, '000000') # 数据库结果判断 PAY_OFF_FLAG 结清标志为1 db_info = self.get_coreDB_info() sql = "SELECT * from (select PAY_OFF_FLAG from PH_LOANOUT_FEE_REPAY_RECORD f where f.LOAN_NO='%s' ORDER BY UPDATE_TIME DESC) WHERE ROWNUM<2" % loanNo res = oracle_sql(db_info, sql) flag = 0 if not res else res[0][0] self.assertEqual(flag, '1') print("一次性费用还款成功", loanNo, paySum)
def xg_test_PLMS_002_逾期管理费还款_预还款(self): token = self.login() loanNo, allPayBalance, unPayOneTimeFee = self.getOverDueRepayDetail( token) self.getOverDueRepayCommit(token, loanNo, allPayBalance, unPayOneTimeFee) payAmount, sterm = self.getPrerepayLoanPlan(token, loanNo) retCode = self.aheadDeductCommit(token, loanNo, payAmount, sterm) # 接口返回结果判断 self.assertEqual(retCode, '000000') # 数据库结果判断 status为S db_info = self.get_coreDB_info() sql = "select * from ph_prerepayrecord where loanapplyserialno ='%s' and sterm=%s" % ( loanNo, sterm) res = oracle_sql(db_info, sql) money = 0 if not res else res[0][5] status = 0 if not res else res[0][6] self.assertEqual(money, 10) self.assertEqual(status, 'S') print("预还款成功", loanNo, sterm, 10)