Commit 43d88d7c by 冯佳佳

update

parent 5a9dc40c
......@@ -19,9 +19,6 @@ logger = logging.getLogger(__name__)
machine_route = Blueprint('machine', __name__)
@machine_route.route('mac_upload', methods=["post"])
def run_machine_mac_upload():
json_data = request.get_json()
......@@ -82,3 +79,15 @@ def run_machine_hatch_data_upload():
Hatch.query.filter(Hatch.hatch_no.notin_(hatch_data)).update({"status": 2})
db.session.commit()
return BaseResponse()
@machine_route.route('get_machine_no', methods=["post"])
def run_get_machine_no():
json_data = request.get_json()
qrcode_no = json_data["qrcode_no"]
machine = Machine.query.filter_by(qrcode_no=qrcode_no, status=1).first()
if machine:
return BaseResponse(data={"machine_no": machine.machine_no})
else:
return jsonify(MACHINE_NOT_EXIST_ERROR)
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