Commit 620888a7 authored by qa_quantgroup's avatar qa_quantgroup

add new updatepayment-center.user_detail and changezhiyongscript

parent 13ecbb6d
#!/bin/bash
ip=$1
phone_no=$2
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ]
then
echo "请输入11位手机号!"
else
break
fi
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
update xyqb.loan_application_history
set xyqb.loan_application_history.progress=40
where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1;
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no=$2
fund_id=$3
#fund_id:"请输入资金方编号,湖北消金输入290、洋钱罐140,广源小贷210,其他的参考表xyqb.fund_corp:"
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ]
then
echo "请输入11位手机号!"
else
break
fi
date=`date "+%Y-%m-%d %H:%M:%S"`
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use xyqb;
update xyqb.loan_application_history
set xyqb.loan_application_history.progress=9
where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1;
delete from xyqb.loan_application_manifest_history
where loan_application_history_id =111112222233333;
INSERT INTO xyqb.loan_application_manifest_history (user_id, loan_application_history_id, channel_id, product_id, transaction_flow_id, funding_corp_id, funding_corp_name, contract_loan_amount, contract_term, service_fee_per_term, one_time_service_fee, monthly_interest_rate, total_repayment_amount, monthly_repayment, real_loan_amount, annual_interest_rate, principal_and_interest_per_term, total_principal_and_interest, company_income, loan_received_at, loan_paid_at, transaction_status, remark, red_packet_strategy)
VALUES (1, 111112222233333, 1, 32, 0, $fund_id, '测试资金方', 2000.00, 3, 150.00, 0.00, 0.011675, 2496.88, 832.29, 2000.00, 0.140100, 682.29, 2046.88, 46.88, '2017-06-08 18:39:33', '1989-09-29 00:00:00', 0, '', NULL);
delete from xyqb.loan_application_manifest_history
where loan_application_history_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1);
update xyqb.loan_application_manifest_history
set user_id=(select id from xyqb_user.user where phone_no =$phone_no),
loan_application_history_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1),
loan_received_at='$date',
product_id=(select distinct(product_id) from risk_control.product_strategy_dispatcher where funding_corp_id=$fund_id),
loan_paid_at='$date'
where loan_application_history_id =111112222233333;
update xyqb.page_state_info
set state='AuditedSuccState'
where loan_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1);
update risk_control.review_history
set progress=0
where phone_no=$phone_no
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no=$2
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ]
then
echo "请输入11位手机号!"
else
break
fi
date=`date "+%Y-%m-%d %H:%M:%S"`
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use xyqb;
update xyqb.loan_application_history
set xyqb.loan_application_history.progress=21
where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1;
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no=$2
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ]
then
echo "请输入11位手机号!"
else
break
fi
#把资金方放款时间更新为昨天,便于测试
date=`date -d yesterday "+%Y-%m-%d %H:%M:%S"`
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use xyqb;
update xyqb.loan_application_history
set xyqb.loan_application_history.progress=15
where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1;
update xyqb.loan_application_manifest_history
set loan_paid_at='$date'
where loan_application_history_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1);
update xyqb.page_state_info
set state='ViewRepayState'
where loan_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1);
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no=$2
seq=$3
#seq "请输入消费流水号(随意修改以下值几个数字值即可XYBT2015122219571073084102263893):"
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use xyqb;
update xyqb.loan_application_history
set progress=39
where user_id=(
select id from xyqb.user where phone_no='$phone_no'
);
update xyqb.baitiao_account
set status=1
where user_id=(
select id from xyqb.user where phone_no='$phone_no'
);
insert into xyqb.baitiao_consume_history
(user_id,order_id,remaining_amount,consume_type,consume_seq)
values
((select id from xyqb.user where phone_no='$phone_no'),-1,
(select credit_amount from baitiao_account
where user_id=(select id from xyqb.user where phone_no='$phone_no')),0,'$seq');
update xyqb.baitiao_account
set pay_pwd='7da26eb97215a944743cc22d49e39f0d', pay_pwd_salt='NkUzMjY3QjIzQTEzMjdBNDQzM0M2MTIz'
where user_id=(
select id from xyqb.user where phone_no='$phone_no');
EOF
#!/bin/bash
ip=$1
phone_no_after=$2
phone_no_before=$3
#"请输入新用户手机号:" phone_no_after
#"请输入旧用户手机号:" phone_no_before
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use payment_center;
update payment_center.bank_card
set user_id=(select id from payment_center.user where phone_no='$phone_no_after')
where user_id=(select id from payment_center.user where phone_no='$phone_no_before');
update payment_center.bind_card_order
set user_id=(select id from payment_center.user where phone_no='$phone_no_after')
where user_id=(select id from payment_center.user where phone_no='$phone_no_before');
update payment_center.card_bind_info
set user_id=(select id from payment_center.user where phone_no='$phone_no_after')
where user_id=(select id from payment_center.user where phone_no='$phone_no_before');
EOF
echo "————success————"
#!/bin/bash
ip=$1
phone_no=$2
#"input user's phone_no:" phone_no
#echo $phone_no
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use risk_control;
update risk_control.review_history
set user_id = 1 , progress=3 , credit_class=0 , comments=null , quantify_product_name=null, fund_assign_status=0 , fund_corp_id=null
where phone_no='$phone_no'
order by created_at desc limit 1;
EOF
#!/bin/bash
phone_no=$1
#"请输入用户手机号:" phone_no
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ]
then
echo "请输入11位手机号!"
else
break
fi
ip=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
resp=`curl "http://$ip:7037/app/login?registerFrom=214&phoneNo=$phone_no" 2>/dev/null`
token=`echo $resp | jq ".data.token" | sed "s/\"//g"`
echo $token
echo "http://$ip:7001/app-landing?token=$token&registerFrom=214&channelId=1"
#!/bin/bash
ip=$1
card_no=$2
#"请输入要删除的银行卡号或者该银行卡绑卡的手机号:" card_no
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
delete from payment_center.bank_card where card_no=$card_no;
delete from payment_center.bank_card_detail where card_no=$card_no;
delete from payment_center.card_bind_info where card_no=$card_no;
delete from payment_center.bank_card where user_id=(select id from payment_center.user where phone_no =$card_no);
delete from payment_center.bind_card_order where user_id=(select id from payment_center.user where phone_no =$card_no);
delete from payment_center.card_bind_info where user_id=(select id from payment_center.user where phone_no =$card_no);
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no=$2
#"请输入用户手机号:" phone_no
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ]
then
echo "请输入11位手机号!"
else
break
fi
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use payment_center;
delete from payment_center.bank_card where user_id=111112222233333;
delete from payment_center.card_bind_info where user_id=111112222233333;
delete from payment_center.bind_card_order where user_id=111112222233333;
delete from payment_center.bank_card where card_no=6227000010912341234;
delete from payment_center.card_bind_info where card_no=6227000010912341234;
delete from payment_center.bank_card_detail where card_no=6227000010912341234;
INSERT INTO payment_center.bank_card (user_id, card_no, card_top, card_last, card_type, card_holder_name, preserve_phone_no, bank_name, bank_code, branch_no, branch_name, city, province, valid_from, valid_thru)
VALUES
(111112222233333, '6227000010912341234', '622700', '1234', 2, '小测', '18610271234', '建设银行', 'CCB', NULL, NULL, '110102', '110000', NULL, NULL);
INSERT INTO payment_center.bank_card_detail (bank_name, bank_code, card_no, account_property, card_type, is_valid)
VALUES
('建设银行', 'CCB', '6227000010912341234', '00', 2, 1);
INSERT INTO payment_center.bind_card_order (user_id, merchant_id, merchant_order_no, pay_approach, ext_data, bind_status, sms_error_code, confirm_error_code, request_id)
VALUES
(111112222233333, 3, '43779518', 1, '', 5, '', '', 'yeepay1488525851371');
INSERT INTO payment_center.card_bind_info (user_id, pay_approach, bind_id, bank_card_id, is_active, card_no, bind_valid_thru)
VALUES
(111112222233333, 1, '1488525851371', 1492596, 1, '6227000010912341234', NULL);
update payment_center.bank_card t set t.user_id=(select id from payment_center.user where phone_no =$phone_no) where t.user_id=111112222233333;
update payment_center.bind_card_order t set t.user_id=(select id from payment_center.user where phone_no =$phone_no) where t.user_id=111112222233333;
update payment_center.card_bind_info t set t.user_id=(select id from payment_center.user where phone_no =$phone_no),bank_card_id=(select id from payment_center.bank_card where card_no=6227000010912341234 and user_id=(select id from payment_center.user where phone_no =$phone_no)) where t.user_id=111112222233333;
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no=$2
#"请输入用户手机号:" phone_no
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ]
then
echo "请输入11位手机号!"
else
break
fi
echo "开始授信:$phone_no ~"
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use spider_center;
insert into spider_center.user_authorization (auth_type,user_id)
select 0, u.id from spider_center.user u
where u.phone_no = '$phone_no';
insert into spider_center.user_authorization (auth_type,user_id)
select 3, u.id from spider_center.user u
where u.phone_no = '$phone_no';
EOF
echo "结束成功:$phone_no ~"
#!/bin/bash
ip=$1
phone_no=$2
#"请输入用户手机号:" phone_no
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ]
then
echo "请输入11位手机号!"
else
break
fi
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use xyqb;
update xyqb.repayment_plan
set repayment_status=3
where loan_application_history_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1) and repayment_status=0;
update xyqb.loan_application_history
set progress=16, is_active=0
where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1;
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no=$2
#"请输入用户手机号:" phone_no
do
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ]
then
echo "请输入11位手机号!"
else
break
fi
done
echo "————start————"
mysql -h"192.168.4.$ip" -p"3306" -u"qa" -p"qatest" <<EOF
use xyqb;
update xyqb.repayment_plan
set repayment_status=3
where loan_application_history_id=(select id from xyqb.loan_application_history where business_type=0 and user_id=(select id from xyqb_user.user where phone_no =$phone_no) and is_active=1) and repayment_status=0 limit 1;
EOF
echo "done!!!"
#!/bin/bash
ip=$1
phone_no_before=$2
phone_no_after=$3
name=$4
id_no=$5
DBNAME="payment_center"
TABLENAME="user_detail"
TABLENAME1="user"
mysqld="-h192.168.4.$ip -p3306 -uqa -pqatest"
function updatecarddetail()
{
echo "开始修改"
#查询userID
select_sql="select id from ${TABLENAME1} where phone_no=${phone_no_before}"
#echo "$select_sql"
user_id=`mysql -N $mysqld ${DBNAME} -e "${select_sql}"`
echo "user_id=$user_id"
#插入授信数据0和3
update_sql="update ${TABLENAME} set phone_no=$phone_no_after,name='$name',id_no=$id_no where user_id=${user_id}"
echo "$update_sql"
#echo "$insert_sql3"
mysql $mysqld ${DBNAME} -e "${update_sql}"
echo "修改成功"
}
updatecarddetail $ip $phone_no_before $phone_no_after $name $id_no
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment