验证销售部门的数据查看权限-脚本demo
2024-09-01 12:55:21
1 # coding:utf-8
2 '''
3 @file: run_old.py
4 @author: jingsheng hong
5 @ide: PyCharm
6 @createTime: 2019年08月20日 17点16分
7 @contactInformation: 727803257@qq.com
8 '''
9
10 import sys
11
12 from tableData.m_tp_account import M_tp_account
13 from tableData.m_tp_store import M_tp_store
14
15 class Run:
16
17 '''验证销售部门的数据查看权限'''
18
19 def __init__(self,account_id:int):
20 '''
21 :param account_id 登录后台的账号id/账号表单个主键id (模拟业务流程,从后台登录页面登录成功后,会传给该后台服务器接口一个登录账号id)
22 '''
23 self.account_id = account_id
24 self.account_information()
25 self.store_information()
26
27 def account_information(self):
28 '''获取:账号A的单条账号表数据'''
29 # 校验account_id是否存在且是否有效
30 account_information = M_tp_account().mysql_account_information(self.account_id)
31 # 关联的员工id
32 self.staff_id = account_information["staff_id"]
33 # 可查看数据范围
34 self.viewable_data_range = account_information["viewable_data_range"]
35 # 数据权限类型
36 self.data_permission_type = account_information["data_permission_type"]
37 # 五种数据权限类型对应的可查看的部门清单
38 self.department_of_viewable = account_information["department_of_viewable"]
39
40 def store_information(self):
41 '''返回:符合数据查看权限规则的销售部门数据'''
42 store_information = M_tp_store().mysql_store_information(self.account_id,self.staff_id,self.viewable_data_range,self.data_permission_type,self.department_of_viewable)
43 return store_information
44
45
46
47 if __name__ == "__main__":
48 # 填写登录账号id即可
49 Run(sys.argv[1])
昨晚完成的培训资料,记录一下~
最新文章
- request.getRequestDispather().forward()与response.sendRedirect()
- Swift 吐槽下Swift里一个逼死强迫症的语法:中缀语法
- DB2 create partitioned table
- Android WebView 向上向下滑动监听
- Java学习-027-JSON 之一 -- 初识
- 【转】HashSet的用法
- 执行CMD代码
- JavaEE(1) - Weblogic 服务器管理的数据源
- Linux系统采用netstat命令查看DDOS攻击的方法
- php Excel文件导入 Spreadsheet_Excel_Reader
- 如何实现 Service 伸缩?- 每天5分钟玩转 Docker 容器技术(97)
- Linux时间子系统之(四):timekeeping
- Rancher学习笔记-----1.分享链接
- Android AbsListView Abs前缀
- 基于selector的socket并发
- [HDOJ]Coin Change(DP)
- 小程序获取地址授权的修改 wx.openSetting需点击
- angularjs结合html5的拖拽行为
- 【nodejs】修改了下对股票表进行crud操作的代码
- Linux之Libcurl库的介绍与应用20170509
热门文章
- Java面试(解答题一)
- spark SQL (四)数据源 Data Source----Parquet 文件的读取与加载
- c++指针 c指针 改变值
- python输出乘法口诀
- linux基础进阶命令详解(输出重定向(2>;&;1,1>;&;2,&;>;file)、输入重定向、管道符、通配符、三种引号、软连接、硬链接、根“/”、绝对路径vs相对路径)
- 纯js添加类
- 从零开始教你安装Oracle数据库
- Educational Codeforces Round 91 (Rated for Div. 2) D. Berserk And Fireball
- 阅读笔记:Item-based Collaborative Filtering Recommendation Algorithms
- Codeforces Round #533 (Div. 2) A. Salem and Sticks(枚举)