Commit 1d73f828 authored by qa_quantgroup's avatar qa_quantgroup

update

parent 33de1118
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/bin/bash
project_name=$1
is_public_ip=$2
ip=$3
pwd_path="/home/qa-deploy-utils/qa_shell_script"
config_shell_path="$pwd_path"
config_server="$pwd_path/config_server"
project_type=`node $config_server/get_project_config.js -name $project_name -attr type`
project_path=`cat $config_server/project_path.sh`
config_path=`cat $config_server/config_path.sh`
if [ -z "$project_name" ];then
echo "清输入项目名称"
exit -1
fi
cd $project_path/$project_name
echo `pwd`
if [ "$project_type" = "java" ]; then
sh $pwd_path/base_script/restartJava.sh $project_name $config_server $project_path $ip
# restartJavaProject $project_name $3
elif [ "$project_type" = "node" ]; then
sh $pwd_path/base_script/restartNode.sh $project_name $config_server $project_path $ip
# restartNodeProject $project_name $3
elif [ "$project_type" = "python" ]; then
sh $pwd_path/base_script/restartPython.sh $project_name $config_server $project_path $ip
# restartPythonProject $project_name $3
elif [ "$project_type" = "ui" ]; then
sh $pwd_path/base_script/restartUi.sh $project_name $config_server $project_path $ip
# restartUiProject $project_name $3
fi
......@@ -183,6 +183,11 @@ new pClass().init(1,false,"java", "7093", "account-center-helper", "QG", "accoun
new pClass().init(1,false,"java", "9093", "pinjamancepat", "QG", "", "application.properties", "--worker 1 --curr entWorker 1 -t ", "", "mimi", "mimi", "", "");
new pClass().init(1,false,"java", "9093", "pinjamancepat-credit-review", "QG", "", "application.properties", "--worker 1 --curr entWorker 1 -t ", "", "mimi", "", "", "");
new pClass().init(1,false,"java", "9093", "zero-gateway-zuul", "QG", "", "", "", "", "mimi", "", "", "");
new pClass().init(1,true, "java", "7096", "card", "baitiao", "card.log", "application.properties", "--worker 1 --currentWorker 1 -t -ts","", "白条量卡", "刘志国","mvn clean package -Ptest -Dmaven.test.skip=true", "");
// ui----
......@@ -218,10 +223,9 @@ new pClass().init(1,true, "ui", "7078", "ka-factory-ui", "ui", null, "src/config
new pClass().init(1,false, "ui", "7064", "statistics-op-ui", "ui", null, "src/app/config/env.config.js", "npm run qa", "node7", "流量统计平台-ui", "刘威", "", "");
new pClass().init(1,true, "ui", "7084", "gdxd-op-ui", "ui", null, "src/config/env.config.js", "npm run qa", "node7", "广达小贷后台-ui", "薛志杰", "", "");
new pClass().init(1,true, "ui", "7080", "new-mall-ui", "ui", null, "src/app/config/env.config.js", "npm run qa", "node7", "微信商城-ui", "郑少文,周珊", "", "");
new pClass().init(1,false, "ui", "9999", "uanguang-credit-review-ui", "ui", null, "src/config/env.config.js", "npm run build", "", "MM项目", "MM", "", "");
new pClass().init(2,true, "ui", "7094", "cuishou_external", "data", null, "app/config/production.config.js", "npm run build", "node7", "催收对外平台-ui", "李斌", "", "");
new pClass().init(1,true, "ui", "7095", "fund-operate-ui", "ui", null, "src/config/env.config.js", "npm run qa", "node7", "资金运营系统-ui", "徐胜男", "", "");
new pClass().init(1,true, "ui", "9095", "pinjamancepat-credit-review-ui", "ui", null, "src/config/env.config.js", "npm run build", "", "mimi", "", "", "");
new pClass().init(1,true, "ui", "9095", "pinjamancepat-credit-review-ui", "ui", null, "src/config/env.config.js", "npm run qa", "", "mimi", "", "", "");
// node
new pClass().init(1,true, "node", "7018", "app-backend", "QG", null, "config/environment/test.js", "forever start -a -s --uid AppBackend bin/www", null, "APP后台服务-server", "", "forever stop AppBackend", "");
......
......@@ -152,6 +152,8 @@ tranceConfig ui "wx89894cd83d117b26" "wxd019cd24f6edae9f" "192.168.4.22" "activi
tranceConfig node "192.168.4.50:9050" "192.168.4.23:7060" "192.168.4.23" "op-api.js"
#tranceConfig java "xyqb.is.debug=0" "xyqb.is.debug=1" "192.168.4.23" "baitiao.properties"
#tranceConfig java "pay.debug=0" "pay.debug=1" "192.168.4.23" "xyqb-mall.properties"
tranceConfig java "http://221.207.229.3:17500/wlpf/HttpServer/XFXD_INPUT_SVR/" "http://mock.q-gp.com/" "192.168.4.23" "baitiao-zhitou.properties"
#4.24
#tranceConfig java "sms.is.debug=1" "sms.is.debug=0" "192.168.4.24" "di-ting.properties"
......
qa6|192.168.167.3 liuzhiguo|192.168.167.2
qa6|192.168.167.3 dongmeifeng|192.168.167.4 tower|192.168.167.5 zhiyong|192.168.167.7 yawei|192.168.167.10 tianyawei|192.168.167.10
......@@ -160,7 +160,7 @@ do
do
var=(${projectAndPort//|/ })
ip_last_repeat=${ip_last//./-}
addFrpcSub $var[0] http $ipfirst $iplast ${var[1]} ${var[0]}-${ip_last_repeat} $filename
addFrpcSub ${var[0]} http $ipfirst $iplast ${var[1]} ${var[0]}-${ip_last_repeat} $filename
createNginxSSLConf ${var[0]}-${ip_last} $ipfirst.$iplast ${var[1]} $nginxname/${var[0]}-${ip_last}.conf
done
done
......@@ -172,12 +172,12 @@ do
do
var=(${projectAndPort//|/ })
namespace=(${host_name//|/ })
addFrpcSub ${var[0]}-${var[2]} http 127.0.0 1 8000 ${var[2]}-${namespace[0]} $filename
if [[ $var[0] != "xyqb-ui" ]] && [[ $var[0] != "paycenter-ui" ]];then
if [[ ${var[0]} != "xyqb-ui" ]] && [[ ${var[0]} != "paycenter-ui" ]];then
addFrpcSub ${var[0]}-${var[2]} http 127.0.0 1 8000 ${var[2]}-${namespace[0]} $filename
createNginxHttpAndSSLConf ${var[2]}-${namespace[0]} ${namespace[1]} ${var[1]} $nginxname/${var[0]}-${namespace[0]}.conf
fi
done
basePorts="redis|80 db|3306 rabbitmq|80 pinja-api|80 pinja-cr|80 pinja-cr-api|80"
basePorts="redis|80 db|3306 rabbitmq|80"
for basePort in ${basePorts[@]}
do
var=(${basePort//|/ })
......
#!/bin/bash
ip=$1
phone_no=$2
bill_num=3
bill_num_a=0
PORT="3306"
USERNAME="qa"
PASSWORD="qatest"
mysqld="-h${ip} -P${PORT} -u${USERNAME} -p${PASSWORD}"
date_now=`date "+%Y-%m-%d %H:%M:%S"`
function baitiao_bill()
{
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ] ; then
echo "请输入11位手机号 !"
else
#生成订单
#白条订单表增加数据
select_user_id="SELECT id from user where user.phone_no=${phone_no}"
xyqb_user_id=`mysql -N $mysqld xyqb_user -e "set names utf8;${select_user_id}"`
# echo $select_user_id
order_no='xyqb'${phone_no}
order="INSERT INTO baitiao_order( "user_id", "merchant_id", "order_no", "order_name", "order_amount", "repay_term", "status", "created_at", "updated_at", "baitiao_order_type") VALUES (${xyqb_user_id}, 7, '${order_no}', '信用钱包订单', 2499.000000, 1,1, '$date_now', '$date_now', 0)"
mysql $mysqld xyqb -e "set names utf8;${order}"
# echo " order=$order"
select_order_id="SELECT id from baitiao_order where user_id=${xyqb_user_id}"
baitiao_order_id=`mysql -N $mysqld xyqb -e "set names utf8;${select_order_id}"`
#echo "select_order_id=$select_order_id"
# echo "baitiao_order_id=$baitiao_order_id"
insert_fund="INSERT INTO baitiao_fund_order ( "order_id", "status", "rate", "refund_status", "start_interest_date", "fund_id", "finance_record_id", "created_at", "updated_at") VALUES ( $baitiao_order_id, 0, 0.060200, 0, NULL, '3', NULL, '$date_now', '$date_now')"
# echo "insert_fund=$insert_fund"
mysql $mysqld xyqb -e "set names utf8;${insert_fund}"
#白条还款计划表增加数据
repayment_plan1="INSERT INTO baitiao_bill_repayment_plan ("bill_id", "user_id", "user_phone", "order_id", "order_no", "order_name", "order_time", "merchant_id", "order_amount", "deadline", "term_no", "contract_term", "rate", "principal", "interest", "penalty_interest", "red_packet_amount", "collection_reduction", "repay_amount", "repay_amount_compute_time", "lock_time", "repaid_at", "repayment_received_at", "repayment_status", "pay_center_order_no", "enable", "created_at", "updated_at") VALUES (NULL, ${xyqb_user_id}, '${phone_no}', ${baitiao_order_id},'信用钱包订单', '手机', '$date_now', 7, 2499.000000, '2018-01-20 23:59:59', 1, 3, 0.030000, 833.000000, 74.970000, 0.000000, 0.000000, 0.000000, 907.970000, '$date_now', NULL, '$date_now', NULL, '0', NULL, 1, '$date_now', '$date_now')"
mysql $mysqld xyqb -e "set names utf8;${repayment_plan1}"
# echo "plan1=$repayment_plan1"
repayment_plan2="INSERT INTO baitiao_bill_repayment_plan ("bill_id", "user_id", "user_phone", "order_id", "order_no", "order_name", "order_time", "merchant_id", "order_amount", "deadline", "term_no", "contract_term", "rate", "principal", "interest", "penalty_interest", "red_packet_amount", "collection_reduction", "repay_amount", "repay_amount_compute_time", "lock_time", "repaid_at", "repayment_received_at", "repayment_status", "pay_center_order_no", "enable", "created_at", "updated_at") VALUES (NULL, ${xyqb_user_id}, '${phone_no}', ${baitiao_order_id}, '信用钱包订单', '手机','$date_now', 7, 2499.000000, '2018-02-20 23:59:59', 2, 3, 0.030000, 833.000000, 74.970000, 0.000000, 0.000000, 0.000000, 907.970000, '$date_now', NULL, '$date_now',NULL, '0', NULL, 1,'$date_now', '$date_now')"
mysql $mysqld xyqb -e "set names utf8;${repayment_plan2}"
#echo "plan2=$repayment_plan2"
repayment_plan3="INSERT INTO baitiao_bill_repayment_plan ("bill_id", "user_id", "user_phone", "order_id", "order_no", "order_name", "order_time", "merchant_id", "order_amount", "deadline", "term_no", "contract_term", "rate", "principal", "interest", "penalty_interest", "red_packet_amount", "collection_reduction", "repay_amount", "repay_amount_compute_time", "lock_time", "repaid_at", "repayment_received_at", "repayment_status", "pay_center_order_no", "enable", "created_at", "updated_at") VALUES (NULL, ${xyqb_user_id}, ${phone_no}, ${baitiao_order_id}, '信用钱包订单', '手机', '$date_now', 7, '2499.000000', '2018-03-20 23:59:59', '3', '3', '0.030000', '833.000000', '74.970000', '0.000000', '0.000000', '0.000000', '907.970000', '$date_now', NULL,'$date_now', NULL, '0', NULL, '1', '$date_now','$date_now')"
mysql $mysqld xyqb -e "set names utf8;${repayment_plan3}"
#echo "plan3=$repayment_plan3"
#白条额度表变化表增加数据
consume_seq1='ABCD201708051511458'${phone_no}
consume="INSERT INTO baitiao_consume_history("user_id", "order_id", "order_amount", "remaining_amount", "consume_type", "consume_seq", "created_at", "updated_at") VALUES(${xyqb_user_id}, ${baitiao_order_id}, '2499.00', '13501.00', '1', '${consume_seq1}', '$date_now','$date_now')"
# echo "consume=$consume"
mysql $mysqld xyqb -e "set names utf8;${consume}"
fi
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ] ; then
echo "请输入11位手机号 !"
else
#生成账单
user_id=`mysql -N $mysqld xyqb_user -e "SELECT id from user where user.phone_no='${phone_no}'"`
#echo "user_id=$user_id"
order_id=`mysql -N $mysqld xyqb -e "select id from baitiao_order where baitiao_order.user_id=${user_id}"`
# echo "order_id=${order_id}"
SELECT_plan1="SELECT id from baitiao_bill_repayment_plan where baitiao_bill_repayment_plan.user_phone='${phone_no}' LIMIT 1"
plan_id1=`mysql -N $mysqld xyqb -e "${SELECT_plan1}"`
# echo "plan_id=$plan_id1"
select_fund_order_id1="SELECT id from baitiao_fund_order where baitiao_fund_order.order_id=${order_id} limit 1"
#echo ${select_fund_order_id1}
fund_order_id1=`mysql -N $mysqld xyqb -e "${select_fund_order_id1}"`
# echo "fund_order_id1=$fund_order_id1"
select_order_amount1="SELECT order_amount from baitiao_bill_repayment_plan where baitiao_bill_repayment_plan.user_phone='${phone_no}' LIMIT 1"
# echo ${select_order_amount1}
order_amount1=`mysql -N $mysqld xyqb -e "${select_order_amount1}"`
# echo "order_amount1=$order_amount1"
#更新baitiao_fund_order.status,start_interest_date
update_baitiao_fund_order="UPDATE baitiao_fund_order as aaa set aaa.status=3, aaa.start_interest_date='${date_now}' where aaa.id=${fund_order_id1}"
# echo "update_fund_order=${update_baitiao_fund_order}"
mysql $mysqld xyqb -e "${update_baitiao_fund_order}"
# echo ${update_baitiao_fund_order}
#插入一条数据到baitiao_finance_record
insert_baitiao_finance_record="INSERT INTO baitiao_finance_record("third_no","total_amount","local_no","type", "remark", "created_at", "updated_at")VALUES ( 'test001', ${order_amount1}, NULL, '0', '笑脸资金方批量放款到量化派', '${date_now}','${date_now}')"
#echo ${insert_baitiao_finance_record}
mysql $mysqld xyqb -e "${insert_baitiao_finance_record}"
while [ ${bill_num_a} -lt ${bill_num} ]; do
# echo ${bill_num_a}
paymonth=`date -d "+${bill_num_a} month" +%Y%m`
# echo "paymonth=$paymonth"
deadline=`date -d "+${bill_num_a} month" +%Y-%m`
day1="-28 23:59:59"
deadlineTime=${deadline}${day1}
# echo "deadlineTime=${deadlineTime}"
if [ $bill_num_a -eq 0 ] ; then
select_baitiao_bill="INSERT INTO baitiao_bill ("user_id", "user_phone", "month", "already_repay_amount", "bill_repay_status", "enable", "created_at", "updated_at")VALUES ( ${user_id},'${phone_no}', ${paymonth}, '0.00', '1', '1', '${date_now}', '${date_now}')"
# echo ${select_baitiao_bill}
mysql -N $mysqld xyqb -e "${select_baitiao_bill}"
else
select_baitiao_bill1="INSERT INTO baitiao_bill ("user_id", "user_phone", "month", "already_repay_amount", "bill_repay_status", "enable", "created_at", "updated_at")VALUES ( ${user_id}, '${phone_no}', ${paymonth}, '0.00', '0', '1','${date_now}','${date_now}')"
mysql -N $mysqld xyqb -e "${select_baitiao_bill1}"
# echo ${select_baitiao_bill1}
fi;
#xyqb.baitiao_bill_repayment_plan插入一个bill_id
id=$((${plan_id1}+${bill_num_a}))
# echo "id=$id"
update_repayment_plan="UPDATE baitiao_bill_repayment_plan as a set a.bill_id=(SELECT id from baitiao_bill where baitiao_bill.user_phone='${phone_no}' and baitiao_bill.month=${paymonth}) where a.id=${id}"
# echo ${update_repayment_plan}
mysql -N $mysqld xyqb -e "${update_repayment_plan}"
#插入一条笑脸还款计划
insert_fund_repayment_plan="INSERT INTO baitiao_fund_repayment_plan ( "plan_id", "fund_order_id", "term_no", "principal", "interest", "discount", "finance_record_id", "status", "deadline", "created_at", "updated_at")VALUES(${id}, ${fund_order_id1}, $(( $bill_num_a + 1 )), 0.00, 0.00,0.00, NULL, '0','${deadlineTime}', '${date_now}','${date_now}')"
# echo "dead1 = ${deadlineTime}"
# echo ${insert_fund_repayment_plan}
mysql -N $mysqld xyqb -e "${insert_fund_repayment_plan}"
# echo "deadlineTime=${deadlineTime}"
#更新baitiao_bill_repayment_plan deadline
select_deadline="SELECT deadline from baitiao_fund_repayment_plan where baitiao_fund_repayment_plan.plan_id=${id}"
line1=`mysql -N $mysqld xyqb -e "${select_deadline}"`
# echo ${select_deadline}
# echo "deadline1=${line1}"
select_update_repayment_plan="UPDATE baitiao_bill_repayment_plan as aa set aa.deadline='${line1}' WHERE aa.id=${id}"
# echo ${select_update_repayment_plan}
mysql -N $mysqld xyqb -e "${select_update_repayment_plan}"
#更新笑脸还款计划金额baitiao_fund_repayment_plan
select_fund_repayment_plan1="update baitiao_fund_repayment_plan as a,baitiao_bill_repayment_plan as b set a.principal=b.principal,a.interest=b.interest WHERE a.plan_id=b.id and b.id=${id} and a.fund_order_id=${fund_order_id1}"
# echo ${select_fund_repayment_plan1}
mysql -N $mysqld xyqb -e "${select_update_repayment_plan}"
bill_num_a=$(( $bill_num_a + 1 ))
# echo "bill_num_a=${bill_bum_a} jjj"
done
echo "done!!! `date`"
fi;
}
baitiao_bill $ip $phone_no
......@@ -2,7 +2,7 @@
set -e
ip=$1
phone_no=$2
coupon_type=$3 # 1-友宝满减券;2-商城购物满减券;3-商城购物折扣券;4-商城购物实物折扣券;5-商城购物实物满减券;6-商城购物充值折扣券;7-现金贷还款折扣券;8-现金贷还款抵扣券;9-现金贷还款免息券;10-白条购物满减券;11-外部白条满减券(深圳通);12-白条外部满减券【环球黑卡】;13-白条外部免息券【环球黑卡】;14-外部白条免息券【e袋洗】;15-外部白条满减券【e袋洗】;16-外部白条免息券【武汉一卡通】;17-外部白条满减券【武汉一卡通】;18-白条外部免息券【深圳通】;19-白条外部免息券【友宝】;20-白条外部免息券【新氧】;21-外部白条满减券【新氧】;22-白条外部满减券【全部渠道】;23-白条外部免息券【全部渠道】
coupon_type=$3 # 1-友宝满减券;2-商城满减券;3-商城折扣券;4-商城实物折扣券;5-商城实物满减券;6-商城充值折扣券;7-现金贷还款折扣券;8-现金贷还款抵扣券;9-现金贷还款免息券;10-白条购物满减券;11-【深圳通】满减券;12-【环球黑卡】满减券;13-【环球黑卡】免息券;14-【e袋洗】免息券;15-【e袋洗】满减券;16-【武汉一卡通】免息券;17-【武汉一卡通】满减券;18-【深圳通】免息券;19-【友宝】免息券;20-【新氧】免息券;21-【新氧】满减券;22-【全部外部渠道】满减券;23-【全部外部渠道】免息券;24-商城免息券
HOSTNAME="$ip" #数据库信息
PORT="3306"
......@@ -315,7 +315,20 @@ else
fi
;;
24)
coupon_24="INSERT INTO redpacket.tb_coupon (unique_business_id, phone, group_id, name, category, category_info, category_type, category_type_info, valid_start_date, valid_end_date, sms_reminder_on_invalid, status, created_at, used_at, updated_at, mark, uid)
VALUES
(concat('BAITIAO201712271407402808bbcb4e2',$date), '$phone_no', 10000686, '商城免息券', 10, '{}', 5, '{\"discount\":50,\"type\":1,\"terms\":{\"3\":[1,2,3]}}', now(), '2028-01-20 23:59:59', 0, 2, now(), NULL, now(), NULL, 1002316);"
mysql -h${HOSTNAME} -p${PORT} -u${USERNAME} -p${PASSWORD} ${DBNAME} -e"set names utf8; ${coupon_24}"
return=$?
if [ "$return" = "0" ];then
echo "商城免息券新增成功!!!"
else
echo "商城免息券新增失败!!!"
fi
;;
*)
echo "优惠券类型请输入1~23"
echo "优惠券类型请输入1~24"
;;
esac
#!/bin/bash
#白条激活运营商、芝麻信用认证
ip=$1
phone_no=$2
HOSTNAME="$ip" #数据库信息
PORT="3306"
USERNAME="qa"
PASSWORD="qatest"
DBNAME1="xyqb" #数据库名称
DBNAME2="xyqb_user"
DBNAME3="spider_center"
date="`date +%Y%m%d%H%M%S`"
date_now=`date +"%Y-%m-%d %T"`
echo $date_now
mysql1="-h${HOSTNAME} -P${PORT} -u${USERNAME} -p${PASSWORD} ${DBNAME1}"
mysql2="-h${HOSTNAME} -P${PORT} -u${USERNAME} -p${PASSWORD} ${DBNAME2}"
mysql3="-h${HOSTNAME} -P${PORT} -u${USERNAME} -p${PASSWORD} ${DBNAME3}"
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ];then
echo "请输入11位手机号!"
exit -1
fi
#xyqb_user.user插入一条用户数据
user_id=`mysql -N $mysql2 -e"SELECT id from xyqb_user.user where phone_no="$phone_no""`
if [[ $user_id == "" ]];then
xyqb_user_insert="INSERT INTO xyqb_user.user (phone_no, password, registered_from, uuid, enable, created_at, updated_at)
VALUES
('$phone_no', '318e235d3e52648b236faa3f748000d5', 217, concat('f6529c70-57f6-45ed-8a01-fafda8c7b4bc',$date), 1, now(), now());"
mysql $mysql2 -e"set names utf8; ${xyqb_user_insert}"
fi
#xyqb_user.user_detail插入用户实名信息
user_id_select=`mysql -N $mysql2 -e"SELECT id from xyqb_user.user where phone_no="$phone_no""`
user_detail=`mysql -N $mysql2 -e"SELECT id from xyqb_user.user_detail where phone_no=${phone_no} and user_id=${user_id_select}"`
if [[ $user_detail == "" ]];then
user_detail_insert="INSERT INTO xyqb_user.user_detail (user_id, phone_no, name, id_no, id_type, is_authenticated, gender, email, qq, created_at, updated_at)
VALUES
($user_id_select, ${phone_no}, '滕尘', '532523198811050620', 0, 0, 1, '', 'undefined', now(), now());"
mysql $mysql2 -e"set names utf8; ${user_detail_insert}"
fi
#spider_center.user插入用户信息
spider_center_user=`mysql -N $mysql3 -e"SELECT id from spider_center.user where phone_no=${phone_no};"`
if [[ $spider_center_user == "" ]];then
spider_center_user_insert="INSERT INTO spider_center.user (phone_no, password, registered_from, uuid, enable, created_at, updated_at)
VALUES
(${phone_no}, '4c00961baa8857e558c10db0e58c003e', 217, concat('f6529c70-57f6-45ed-8a01-fafda8c7b4bc',$date), 1, now(), now());"
mysql $mysql3 -e"set names utf8; ${spider_center_user_insert}"
fi
#spider_center.user_authorization插入一条授信信息
spider_center_user_id=`mysql -N $mysql3 -e"SELECT id from spider_center.user where phone_no=${phone_no};"`
user_authorization_type=`mysql -N $mysql3 -e"select auth_type from spider_center.user_authorization where user_id=${spider_center_user_id} and auth_type in (0,3);"`
user_authorization_status=`mysql -N $mysql3 -e"select auth_status from spider_center.user_authorization where user_id=${spider_center_user_id};"`
if [[ $user_authorization_type == "" ]] ;then
user_authorization_insert="INSERT INTO spider_center.user_authorization ( auth_type, last_auth_time, auth_account_name, user_id, auth_status)
VALUES
(3, now(), NULL, ${spider_center_user_id}, 1),
(0, now(), NULL, ${spider_center_user_id}, 1);"
mysql $mysql3 -e"set names utf8; ${user_authorization_insert}"
fi
if [[ ${user_authorization_type[*]} =~ "3" || ${user_authorization_type[*]} =~ "0" && $user_authorization_status != "1" ]];then
mysql $mysql3 -e"update spider_center.user_authorization set auth_status=1 where user_id=${spider_center_user_id} and auth_type in (0,3);"
fi
echo "运营商、芝麻信用验证通过"
#!/bin/bash
#白条激活运营商、芝麻信用认证
ip=$1
phone_no=$2
merchant_id=$3 #渠道号,默认为7
HOSTNAME="$ip" #数据库信息
PORT="3306"
USERNAME="qa"
PASSWORD="qatest"
DBNAME1="xyqb" #数据库名称
DBNAME2="xyqb_user"
DBNAME3="spider_center"
date="`date +%Y%m%d%H%M%S`"
date_now=`date +"%Y-%m-%d %T"`
echo $date_now
mysql1="-h${HOSTNAME} -P${PORT} -u${USERNAME} -p${PASSWORD} ${DBNAME1}"
mysql2="-h${HOSTNAME} -P${PORT} -u${USERNAME} -p${PASSWORD} ${DBNAME2}"
mysql3="-h${HOSTNAME} -P${PORT} -u${USERNAME} -p${PASSWORD} ${DBNAME3}"
len=`echo $phone_no|awk '{print length($0)}'`
if [ $len -ne 11 ];then
echo "请输入11位手机号!"
exit -1
fi
#xyqb_user.user插入一条用户数据
user_id_select=`mysql -N $mysql2 -e"SELECT id from xyqb_user.user where phone_no="$phone_no""`
if [[ $user_id_select == "" ]];then
xyqb_user_insert="INSERT INTO xyqb_user.user (phone_no, password, registered_from, uuid, enable, created_at, updated_at)
VALUES
("$phone_no", '318e235d3e52648b236faa3f748000d5', 217, concat('f6529c70-57f6-45ed-8a01-fafda8c7b4bc',$date), 1, now(), now());"
mysql $mysql2 -e"set names utf8; ${xyqb_user_insert}"
fi
#xyqb_user.user_detail插入用户实名信息
user_id=`mysql -N $mysql2 -e"SELECT id from xyqb_user.user where phone_no="$phone_no""`
user_detail=`mysql -N $mysql2 -e"SELECT id from xyqb_user.user_detail where phone_no=${phone_no} and user_id=${user_id}"`
if [[ $user_detail == "" ]];then
user_detail_insert="INSERT INTO xyqb_user.user_detail (user_id, phone_no, name, id_no, id_type, is_authenticated, gender, email, qq, created_at, updated_at)
VALUES
(${user_id}, "${phone_no}", '滕尘', '532523198811050620', 0, 0, 1, '', 'undefined', now(), now());"
mysql $mysql2 -e"set names utf8; ${user_detail_insert}"
fi
#spider_center.user插入一条数据
spider_center_user=`mysql -N $mysql3 -e"SELECT id from spider_center.user where phone_no=${phone_no};"`
if [[ $spider_center_user == "" ]];then
spider_center_user_insert="INSERT INTO spider_center.user (phone_no, password, registered_from, uuid, enable, created_at, updated_at)
VALUES
(${phone_no}, '4c00961baa8857e558c10db0e58c003e', 217, concat('f6529c70-57f6-45ed-8a01-fafda8c7b4bc',$date), 1, now(), now());"
mysql $mysql3 -e"set names utf8; ${spider_center_user_insert}"
fi
#spider_center.user_authorization插入一条授信信息
spider_center_user_id=`mysql -N $mysql3 -e"SELECT id from spider_center.user where phone_no=${phone_no};"`
user_authorization_type=`mysql -N $mysql3 -e"select auth_type from spider_center.user_authorization where user_id=${spider_center_user_id} and auth_type in (0,3);"`
user_authorization_status=`mysql -N $mysql3 -e"select auth_status from spider_center.user_authorization where user_id=${spider_center_user_id};"`
if [[ $user_authorization_type == "" ]] ;then
user_authorization_insert="INSERT INTO spider_center.user_authorization ( auth_type, last_auth_time, auth_account_name, user_id, auth_status)
VALUES
(3, now(), NULL, ${spider_center_user_id}, 1),
(0, now(), NULL, ${spider_center_user_id}, 1);"
mysql $mysql3 -e"set names utf8; ${user_authorization_insert}"
fi
if [[ ${user_authorization_type[*]} =~ "3" || ${user_authorization_type[*]} =~ "0" && $user_authorization_status != "1" ]];then
mysql $mysql3 -e"update spider_center.user_authorization set auth_status=1 where user_id=${spider_center_user_id} and auth_type in (0,3);"
fi
#xyqb.loan_application_history插入一条贷款记录
if [[ ${merchant_id} == "" ]];then
merchant_id=7
fi
loan_application_history_insert="INSERT INTO xyqb.loan_application_history (user_id, channel_id, bank_card_id, is_active, progress, created_from, business_type, pay_approach, baitiao_merchant_id, created_at, updated_at)
VALUES
(${user_id}, 222, 1234567890123456789, 1, 36, 222, 1, NULL, ${merchant_id}, now(), now());"
mysql $mysql2 -e"${loan_application_history_insert}"
#xyqb.baitiao_account插入一条白条信用账户
baitiao_account_insert="INSERT INTO xyqb.baitiao_account (user_id, registered_from, pay_pwd, pay_pwd_salt, credit_amount, status, created_at, updated_at)
VALUES
(${user_id}, ${merchant_id}, '', '', 160000.00, 0, now(), now());"
mysql $mysql2 -e"${baitiao_account_insert}"
#xyqb.baitiao_consume_history插入一条白条消费记录
baitiao_consume_history_insert="INSERT INTO xyqb.baitiao_consume_history (user_id, order_id, order_amount, remaining_amount, consume_type, consume_seq, created_at, updated_at)
VALUES
(${user_id}, -1, 160000.00, 160000.00, 0, concat('XYBT20101511498169088',$date), now(), now());"
mysql $mysql2 -e"${baitiao_consume_history_insert}"
echo "白条审核通过"
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