Commit d8c89673 by Aeolus

update

parent e4fdc820
...@@ -34,10 +34,10 @@ def get_production_list(): ...@@ -34,10 +34,10 @@ def get_production_list():
tmp_dict = {} tmp_dict = {}
for i in hatch_list: for i in hatch_list:
if tmp_dict.get(i.production_id, None): if tmp_dict.get(i.production_id, None) is None:
tmp_dict[i.production_id] = { tmp_dict[i.production_id] = {
"machine_no": i.machine_no, "machine_no": i.machine_no,
"hatch_no": i.hatch_no, "hatch_no": [i.hatch_no],
"production_id": i.production_id, "production_id": i.production_id,
"name": i.name, "name": i.name,
"title": i.title, "title": i.title,
...@@ -56,7 +56,8 @@ def get_production_list(): ...@@ -56,7 +56,8 @@ def get_production_list():
} }
else: else:
tmp_dict[i.production_id]["count"] += 1 tmp_dict[i.production_id]["count"] += 1
hatch_data = tmp_dict.values() tmp_dict[i.production_id]["hatch_no"].append(i.hatch_no)
hatch_data = list(tmp_dict.values())
return BaseResponse(data=hatch_data) return BaseResponse(data=hatch_data)
......
...@@ -7,8 +7,16 @@ author:Aeolus ...@@ -7,8 +7,16 @@ author:Aeolus
""" """
import logging import logging
from flask import Blueprint from flask import Blueprint, request
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
tally_route = Blueprint('tally', __name__) tally_route = Blueprint('tally', __name__)
@tally_route.route("/login", methods = ["POST"])
def run_tally_login():
json_data = request.get_json()
user_name = json_data["user_name"]
password = json_data["password"]
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