|
|
|
@ -74,11 +74,11 @@ def user_apply_log():
|
|
|
|
|
if client_obj:
|
|
|
|
|
i["client_name"]=client_obj.client_name
|
|
|
|
|
else:
|
|
|
|
|
i["client_name"]=''
|
|
|
|
|
use_content =json.dumps(data_obj)
|
|
|
|
|
solve_user_id_sh ="-"
|
|
|
|
|
if tag ==1:
|
|
|
|
|
solve_user_id_sh = ''
|
|
|
|
|
i["client_name"]=''
|
|
|
|
|
use_content =json.dumps(data_obj)
|
|
|
|
|
solve_user_id_sh ="-"
|
|
|
|
|
if tag ==1:
|
|
|
|
|
solve_user_id_sh = ''
|
|
|
|
|
obj = EntityUserApply(
|
|
|
|
|
user_id=g.current_user.user_id,
|
|
|
|
|
user_id_pt=user_id_pt,
|
|
|
|
@ -92,7 +92,7 @@ def user_apply_log():
|
|
|
|
|
func_type=func_type,
|
|
|
|
|
# client_code=client_code,
|
|
|
|
|
use_doc=use_doc
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
BllUserApply().insert(obj)
|
|
|
|
|
return jsonify(Utils.true_return())
|
|
|
|
|
|
|
|
|
@ -142,11 +142,11 @@ def get_info_list():
|
|
|
|
|
# i_dict = dict(zip(i.keys(), [(x if x is not None else '') for x in i.values()]))
|
|
|
|
|
i_dict['user_name'] = user_dict.get(i_dict["user_id"])
|
|
|
|
|
i_dict["user_name_pt"] = user_dict.get(i_dict["user_id_pt"])
|
|
|
|
|
i_dict["solve_user_name"] = user_dict.get(i_dict["solve_user_id"], '')
|
|
|
|
|
i_dict["solve_user_name"] = user_dict.get(i_dict["solve_user_id"], '')
|
|
|
|
|
i_dict["solve_user_pt_name"] = user_dict.get(i_dict["solve_user_id_pt"], '')
|
|
|
|
|
i_dict["solve_user_sh_name"] = user_dict.get(i_dict["solve_user_id_sh"], '')
|
|
|
|
|
i_dict["solve_user_sh_name"] = user_dict.get(i_dict["solve_user_id_sh"], '')
|
|
|
|
|
if i_dict["solve_user_id_sh"] =='-':
|
|
|
|
|
i_dict["solve_user_sh_name"]='-'
|
|
|
|
|
i_dict["solve_user_sh_name"]='-'
|
|
|
|
|
data_list.append(i_dict)
|
|
|
|
|
return jsonify(Utils.true_return(data={"data_list": data_list, "total_count": page_param.totalRecords}))
|
|
|
|
|
|
|
|
|
@ -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())
|
|
|
|
|
|
|
|
|
@ -244,7 +241,7 @@ def set_register():
|
|
|
|
|
if int(is_empty) ==0:
|
|
|
|
|
setattr(obj, "status", 2)
|
|
|
|
|
else:
|
|
|
|
|
setattr(obj, "status", 3)
|
|
|
|
|
setattr(obj, "status", 3)
|
|
|
|
|
BllMedicament().update(obj)
|
|
|
|
|
# 登记
|
|
|
|
|
BllUserApply().update_use_content(client_id=obj.client_id, user=g.current_user, drug_info=obj)
|
|
|
|
@ -308,6 +305,6 @@ def update_notes():
|
|
|
|
|
if i["bar_code"] ==bar_code:
|
|
|
|
|
print('5555')
|
|
|
|
|
i["info"] =info
|
|
|
|
|
obj.use_content =json.dumps(data_obj)
|
|
|
|
|
obj.use_content =json.dumps(data_obj)
|
|
|
|
|
BllUserApply().update(obj)
|
|
|
|
|
return jsonify(Utils.true_return(data=obj))
|
|
|
|
|
return jsonify(Utils.true_return(data=obj))
|
|
|
|
|