def update(): myRes = MyResponse() DPT_KEY = MyRequest.get_verify_empty("DPT_KEY", errmsg="ID不能为空") upd_attr={} upd_attr["DPT_NAME"] = MyRequest.get_verify_empty("DPT_NAME", errmsg="部门名称不能为空") upd_attr["DPT_SOFT"] = MyRequest.get("DPT_SOFT", type=int) try: MySqlalchemy.comUpdate(DptInfo,[DptInfo.DPT_KEY==DPT_KEY],upd_attr) myRes.code = ResState.HTTP_SUCCESS myRes.msg = "操作成功" except SQLAlchemyError as ex: mylog.error(ex) myRes.msg = ResState.ERROR_DB return myRes.to_json()
def update(): myRes = MyResponse() ROLE_KEY = MyRequest.get("ROLE_KEY", type=int) role_attrs = {} role_attrs["ROLE_NAME"] = MyRequest.get_verify_empty("ROLE_NAME") role_attrs["DESCRIPT"] = MyRequest.get("DESCRIPT") role_attrs["TIME_MODIFY"] = getSysDateTime() try: MySqlalchemy.comUpdate(RoleInfo, [RoleInfo.ROLE_KEY == ROLE_KEY], role_attrs) myRes.code = ResState.HTTP_SUCCESS myRes.msg = "操作成功" except SQLAlchemyError as ex: mylog.error(ex) myRes.msg = str(ex) return myRes.to_json()
def update(): myRes = MyResponse() MENU_KEY = MyRequest.get_verify_empty("MENU_KEY", errmsg="MENU_KEY不能为空") menu_attrs = {} menu_attrs["MENU_NAME"] = MyRequest.get("MENU_NAME", type=str) menu_attrs["MENU_URL"] = MyRequest.get("MENU_URL", type=str) menu_attrs["MENU_ICON"] = MyRequest.get("MENU_ICON", type=str) menu_attrs["MENU_SOFT"] = MyRequest.get("MENU_SOFT", type=str) try: MySqlalchemy.comUpdate(MenuInfo, [MenuInfo.MENU_KEY == MENU_KEY], menu_attrs) myRes.code = ResState.HTTP_SUCCESS myRes.msg = "操作成功" except SQLAlchemyError as ex: mylog.error(ex) myRes.msg = str(ex) return myRes.to_json()
def updMyInfo(): myRes = MyResponse() USER_KEY = g.USER_KEY upd_attr = {} upd_attr["USER_NAME"] = MyRequest.get_verify_empty("USER_NAME", errmsg="姓名不能为空") upd_attr["PHONE"] = MyRequest.get("PHONE", type=str) try: MySqlalchemy.comUpdate(UserInfo, [UserInfo.USER_KEY == USER_KEY], upd_attr) myRes.code = ResState.HTTP_SUCCESS myRes.msg = "操作成功" except SQLAlchemyError as ex: mylog.error(ex) myRes.msg = str(ex) finally: db_session.close() return myRes.to_json()
def update(): myRes = MyResponse() OPER_KEY = MyRequest.get_verify_empty("OPER_KEY", errmsg="OPER_KEY不能为空") oper_attrs = {} oper_attrs["OPER_NAME"] = MyRequest.get_verify_empty("OPER_NAME", errmsg="按钮编码不能为空") oper_attrs["OPER_URL"] = MyRequest.get("OPER_URL", type=str) oper_attrs["OPER_TYPE"] = MyRequest.get("OPER_TYPE", type=int) oper_attrs["OPER_SOFT"] = MyRequest.get("OPER_SOFT", type=int) try: MySqlalchemy.comUpdate(OperInfo, [OperInfo.OPER_KEY == OPER_KEY], oper_attrs) myRes.code = ResState.HTTP_SUCCESS myRes.msg = "操作成功" except SQLAlchemyError as ex: mylog.error(ex) myRes.msg = str(ex) return myRes.to_json()
def update(): myRes = MyResponse() USER_KEY = MyRequest.get("USER_KEY", type=int) upd_attr = {} upd_attr["USER_NAME"] = MyRequest.get_verify_empty("USER_NAME", errmsg="姓名不能为空") upd_attr["USER_SEX"] = MyRequest.get("USER_SEX", type=int, default=1) upd_attr["DPT_KEY"] = MyRequest.get_verify_empty("DPT_KEY", errmsg="部门ID不能为空") upd_attr["USER_POSITION"] = MyRequest.get("USER_POSITION", type=str) upd_attr["PHONE"] = MyRequest.get("PHONE", type=str) upd_attr["TIME_MODIFY"] = getSysDateTime() try: MySqlalchemy.comUpdate(UserInfo, [UserInfo.USER_KEY == USER_KEY], upd_attr) myRes.code = ResState.HTTP_SUCCESS myRes.msg = "操作成功" except SQLAlchemyError as ex: mylog.error(ex) myRes.msg = str(ex) return myRes.to_json()