Commit 9ee3064c authored by 王瑞环's avatar 王瑞环

update

parent 34a72ffc
......@@ -34,7 +34,7 @@ def main():
"query": {"bool": {
"filter": [
{"terms": {"id": doctor_ids}}]}}}
es_result = es.search(query)
es_result = es.search(query, settings_local.ES_INDEX)
budgetSql = """
select budget, is_open from bdtransfer_prioritybdtransfer
where merchant_id = {}
......@@ -43,7 +43,7 @@ def main():
consumeSql = """
select amount from bdtransfer_bdtransferconsume
where merchant_id = {}
and date = {} """
and date = '{}' """
today = str(datetime.date.today())
num = 0.0
......@@ -71,23 +71,28 @@ def main():
mysql_is_merchant_priority_send_order = budget_res[1]
if consume_res:
consume = consume_res[0]
mysql_left_consume = consume - budget
mysql_left_consume = budget - consume
if (
int(merchant_left_money) == int(mysql_merchant_left_money) and
int(left_consume) == int(mysql_left_consume) and
int(is_merchant_priority_send_order) == int(mysql_is_merchant_priority_send_order)):
pass
else:
if (is_merchant_priority_send_order == mysql_is_merchant_priority_send_order and is_merchant_priority_send_order==False):
pass
else:
print("""
doctor_id: {},
merchant_left_money: {}, mysql_merchant_left_money: {},
left_consume: {}, mysql_left_consume:{},
is_merchant_priority_send_order: {},
mysql_is_merchant_priority_send_order:{}""".format(
doctor_id,
merchant_left_money, mysql_merchant_left_money,
left_consume, mysql_left_consume,
is_merchant_priority_send_order,
mysql_is_merchant_priority_send_order
))
if (
merchant_left_money == mysql_merchant_left_money and
left_consume == mysql_left_consume and
is_merchant_priority_send_order == mysql_is_merchant_priority_send_order):
pass
else:
num = num + 1
error_doctors.append(doctor_id)
print(num)
......
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