Commit 7780c010 by Aeolus

update

parent c38a6836
...@@ -304,11 +304,13 @@ def run_tally_over(): ...@@ -304,11 +304,13 @@ def run_tally_over():
tally_record.status = 2 tally_record.status = 2
db.session.add(tally_record) db.session.add(tally_record)
db.session.commit() db.session.commit()
hatch = Hatch.query.filter_by(machine_no=machine_no, hatch_no=hatch_no, status=2).update({"status": 1}) hatch = Hatch.query.filter(Hatch.machine_no == machine_no, Hatch.hatch_no.in_(hatch_no),
Hatch.status == 2).update({"status": 1})
db.session.commit() db.session.commit()
elif tally_type == 2: elif tally_type == 2:
tally_record = TallyRecord.query.filter(TallyRecord.user_no == g.user.user_no, TallyRecord.machine_no == machine_no, tally_record = TallyRecord.query.filter(TallyRecord.user_no == g.user.user_no,
TallyRecord.machine_no == machine_no,
TallyRecord.hatch_no == hatch_no, TallyRecord.hatch_no == hatch_no,
TallyRecord.status == 1).order_by(TallyRecord.id.desc()).first() TallyRecord.status == 1).order_by(TallyRecord.id.desc()).first()
if tally_record: if tally_record:
...@@ -341,8 +343,6 @@ def get_tally_report(): ...@@ -341,8 +343,6 @@ def get_tally_report():
return BaseResponse(data={"empty_number": empty_number, "over_number": over_number}) return BaseResponse(data={"empty_number": empty_number, "over_number": over_number})
@tallyman_route.route('machine_activate', methods=["post"]) @tallyman_route.route('machine_activate', methods=["post"])
def run_machine_activate(): def run_machine_activate():
json_data = request.get_json() json_data = request.get_json()
......
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