|
|
|
@ -172,33 +172,30 @@ def solve_apply():
|
|
|
|
|
# user_id_pt = request.values.get("user_id_pt")
|
|
|
|
|
t = request.values.get("t")
|
|
|
|
|
obj = BllUserApply().findEntity(EntityUserApply.id == apply_id)
|
|
|
|
|
if obj.is_solve == 1:
|
|
|
|
|
return jsonify(Utils.false_return(msg="已受理,无需重复受理"))
|
|
|
|
|
# obj.is_solve = 1
|
|
|
|
|
if obj.is_solve == 1 or obj.is_solve == 2:
|
|
|
|
|
msg = "驳回" if obj.is_solve == 2 else "受理"
|
|
|
|
|
return jsonify(Utils.false_return(msg=f"已{msg},无需重复处理"))
|
|
|
|
|
if user_id == obj.user_id:
|
|
|
|
|
return jsonify(Utils.false_return(msg="申请人与审批人不能为同一人"))
|
|
|
|
|
if user_id in [obj.solve_user_id_sh, obj.solve_user_id, obj.solve_user_id_sh]:
|
|
|
|
|
return jsonify(Utils.false_return(msg="不能为同一人审批"))
|
|
|
|
|
|
|
|
|
|
if not obj.solve_user_id_sh:
|
|
|
|
|
obj.solve_user_id_sh = user_id
|
|
|
|
|
elif not obj.solve_user_id:
|
|
|
|
|
obj.solve_user_id = user_id
|
|
|
|
|
else:
|
|
|
|
|
obj.solve_user_id_pt = user_id
|
|
|
|
|
|
|
|
|
|
if str(request.values.get('result')) == "0":
|
|
|
|
|
obj.information = request.values.get("information")
|
|
|
|
|
obj.is_solve = 2
|
|
|
|
|
else:
|
|
|
|
|
if user_id == obj.user_id:
|
|
|
|
|
return jsonify(Utils.false_return(msg="申请人与审批人不能为同一人"))
|
|
|
|
|
if not obj.solve_user_id_sh:
|
|
|
|
|
obj.solve_user_id_sh = user_id
|
|
|
|
|
else:
|
|
|
|
|
if not obj.solve_user_id:
|
|
|
|
|
if user_id == obj.solve_user_id_sh:
|
|
|
|
|
return jsonify(Utils.false_return(msg="不能位同一人审批"))
|
|
|
|
|
obj.solve_user_id = user_id
|
|
|
|
|
else:
|
|
|
|
|
if user_id == obj.solve_user_id or user_id == obj.solve_user_id_sh:
|
|
|
|
|
return jsonify(Utils.false_return(msg="不能位同一人审批"))
|
|
|
|
|
obj.solve_user_id_pt = user_id
|
|
|
|
|
obj.is_solve = 1
|
|
|
|
|
obj.time_hour = t
|
|
|
|
|
BllUserTemporaryAuth().create_temporary_auth(user_ids=[obj.user_id, obj.user_id_pt], auth_type=2, t=t)
|
|
|
|
|
if obj.solve_user_id_pt:
|
|
|
|
|
obj.is_solve = 1
|
|
|
|
|
obj.time_hour = t
|
|
|
|
|
BllUserTemporaryAuth().create_temporary_auth(user_ids=[obj.user_id, obj.user_id_pt], auth_type=2, t=t)
|
|
|
|
|
obj.solve_date = Utils.get_str_datetime()
|
|
|
|
|
# obj.solve_user_id = user_id
|
|
|
|
|
# obj.solve_user_id_pt = user_id_pt
|
|
|
|
|
# BllUserTemporaryAuth().create_temporary_auth(user_ids=[obj.user_id, obj.user_pt], auth_type=2)
|
|
|
|
|
BllUserApply().update(obj)
|
|
|
|
|
return jsonify(Utils.true_return())
|
|
|
|
|
|
|
|
|
|