def changeCreditEngine(channel, engine1, engine2, engine3): if channel == 'Android': sql1 ='update zw_sys_dict set name = %s where parent_id = "420" and code = "engine1"' sql2 = 'update zw_sys_dict set name = %s where parent_id = "420" and code = "engine2"' sql3 = 'update zw_sys_dict set name = %s where parent_id = "420" and code = "engine3"' elif channel == 'IOS': sql1 ='update zw_sys_dict set name = %s where parent_id = "766" and code = "engine1"' sql2 = 'update zw_sys_dict set name = %s where parent_id = "766" and code = "engine2"' sql3 = 'update zw_sys_dict set name = %s where parent_id = "766" and code = "engine3"' elif channel == 'H5': sql1 ='update zw_sys_dict set name = %s where parent_id = "899" and code = "engine1"' sql2 = 'update zw_sys_dict set name = %s where parent_id = "899" and code = "engine2"' sql3 = 'update zw_sys_dict set name = %s where parent_id = "899" and code = "engine3"' elif channel == 'fp_rz': sql1 ='update zw_sys_dict set name = %s where parent_id = "882" and code = "engine1"' sql2 = 'update zw_sys_dict set name = %s where parent_id = "882" and code = "engine2"' sql3 = 'update zw_sys_dict set name = %s where parent_id = "882" and code = "engine3"' elif channel == 'fp_jd': sql1 ='update zw_sys_dict set name = %s where parent_id = "905" and code = "engine1"' sql2 = 'update zw_sys_dict set name = %s where parent_id = "905" and code = "engine2"' sql3 = 'update zw_sys_dict set name = %s where parent_id = "905" and code = "engine3"' elif channel == 'fp_jdjt': sql1 ='update zw_sys_dict set name = %s where parent_id = "909" and code = "engine1"' sql2 = 'update zw_sys_dict set name = %s where parent_id = "909" and code = "engine2"' sql3 = 'update zw_sys_dict set name = %s where parent_id = "909" and code = "engine3"' elif channel == 'qts': sql1 ='update zw_sys_dict set name = %s where parent_id = "924" and code = "engine1"' sql2 = 'update zw_sys_dict set name = %s where parent_id = "924" and code = "engine2"' sql3 = 'update zw_sys_dict set name = %s where parent_id = "924" and code = "engine3"' else: print('暂不支持' + channel + '渠道') Mysql.updatewithparams(business, sql1, engine1)
def credittimes(name, tel, channel): # 清除锦程方该客户额度 JCapi.JCmoveLimitByName(name) # 获取客户编号 customer_id = Mysql.selectwithparams(business, RequestDataSql.getcustomerid, tel)[0] # 清除拒绝原因 Mysql.updatewithparams(business, RequestDataSql.deleterefusecode, tel) # 修改申请状态为拒绝 Mysql.updatewithparams(business, RequestDataSql.updateapplystate, tel) # 修改额度为null Mysql.updatewithparams(business, RequestDataSql.updateamount, tel) # 修改channelcode已通过风控规则 APP -> 111 Mysql.updatewithparams(business, RequestDataSql.updatechannelcode, tel) login(tel, channel) if channel == 'Android': r = Appapi.CreditForRisk(RequestDataSql.CreditForRiskdata(customer_id)) Appapi.apiprint('安卓额度审批接口', RequestDataSql.CreditForRiskdata(customer_id), r) elif channel == 'IOS': r = Appapi.CreditForIosRisk( RequestDataSql.CreditForIosRiskdata(customer_id)) Appapi.apiprint('IOS额度审批接口', RequestDataSql.CreditForIosRiskdata(customer_id), r) else: print('暂不支持' + channel + '渠道') time.sleep(5) GetResult.getcreditresult(tel)
def changeLoanEngine(channel, engine): if channel == 'Android': sql = 'update zw_sys_dict set name = %s where parent_id = "794" and code = "alp_android"' elif channel == 'IOS': sql = 'update zw_sys_dict set name = %s where parent_id = "794" and code = "alp_ios"' elif channel == 'H5': sql = 'update zw_sys_dict set name = %s where parent_id = "794" and code = "alp_h5"' elif channel == 'fp_rz': sql = 'update zw_sys_dict set name = %s where parent_id = "794" and code = "fp_rz"' elif channel == 'fp_jd': sql = 'update zw_sys_dict set name = %s where parent_id = "794" and code = "fp_jd"' else: print('暂不支持' + channel + '渠道') Mysql.updatewithparams(business, sql, engine)
def changeloaninfo(tel, loanresult): applyno = Mysql.selectwithparams(business, RequestDataSql.selectapplno, tel)[0] state1 = Mysql.selectwithparams(business, RequestDataSql.getloanstate, tel)[0] if applyno != None and state1 == '1': print('订单审核中') elif applyno != None and state1 == '2': print('订单失效') elif applyno != None and state1 == '3': print('申请提现成功,借据状态为‘放款中’。开始进行放款结果回调...') if loanresult =='S': # 调锦程葵花宝典为放款成功 JCapi.JCsetLoanStatusS(applyno) # 查看借据状态变成‘还款中’ time.sleep(60) state2 = Mysql.selectwithparams(business, RequestDataSql.getloanstate, tel)[0] if state2 !='6': time.sleep(70) state3 = Mysql.selectwithparams(business, RequestDataSql.getloanstate, tel)[0] if state3 !='6': print('放款成功可能没有回调,看下日志吧') else: print('放款成功已回调,借据状态为‘还款中’') # 修改mysql库借据申请时间 yesterday = datetime.datetime.today() - datetime.timedelta(days=1) newcreatetime = datetime.datetime.strftime(yesterday, '%Y%m%d%H%M%S') params = (newcreatetime, tel) Mysql.updatewithparams(business, RequestDataSql.updateloancreatetime, params) # 调锦程葵花宝典修改系统时间为明天 tomorrow = datetime.datetime.today() + datetime.timedelta(days=1) date = datetime.datetime.strftime(tomorrow, '%Y%m%d') JCapi.JCsetCurrentDate(date) # 跑批 JCapi.JCrunAll() print('借据可以进行还款操作了') else: print('放款成功已回调,借据状态为‘还款中’') # 修改mysql库借据申请时间 yesterday = datetime.datetime.today() - datetime.timedelta(days=1) newcreatetime = datetime.datetime.strftime(yesterday, '%Y%m%d%H%M%S') params = (newcreatetime, tel) Mysql.updatewithparams(business, RequestDataSql.updateloancreatetime, params) # 调锦程葵花宝典修改系统时间为明天 tomorrow = datetime.datetime.today() + datetime.timedelta(days=1) date = datetime.datetime.strftime(tomorrow, '%Y%m%d') JCapi.JCsetCurrentDate(date) # 跑批 JCapi.JCrunAll() print('借据可以进行还款操作了') elif loanresult == 'F': # 调锦程葵花宝典为放款失败 JCapi.JCsetLoanStatusF(applyno) time.sleep(60) state4 = Mysql.selectwithparams(business, RequestDataSql.getloanstate, tel)[0] if state4 == '5': print('放款失败回调成功') else: time.sleep(65) state5 = Mysql.selectwithparams(business, RequestDataSql.getloanstate, tel)[0] if state5 == '5': print('放款失败回调成功') else: print('放款失败可能没有回调,看下日志吧') else: print('放款回调结果输入错误') elif applyno != None and state1 == '4': print('审批拒绝') elif applyno != None and state1 == '5': print('放款失败') elif applyno != None and state1 == '6': print('申请提现成功,借据状态为‘还款中’') elif applyno != None and state1 == '7': print('借据已结清') else: print('提现异常了')