1.修改钉钉返回的数据,添加depid

This commit is contained in:
李伟 2022-09-08 11:26:46 +08:00
parent 8a31d8ed1b
commit c7545f2395
3 changed files with 12 additions and 5 deletions

View File

@ -27,7 +27,7 @@ class CRUDUser(CRUDBase):
return res
#获取用户信息list
async def get_users(self, db: AsyncIOMotorDatabase, user_id: list):
res = await db[self.coll_name].find_many({'user_id':{'$in': user_id}}, {'name': 1,'user_id':1})
res = await self.find_many(db,{'user_id':{'$in': user_id}}, {'name': 1,'user_id':1})
return res
async def edit_profile(self, db: AsyncIOMotorDatabase, data_id: schemas.UserProfileEdit, user_id):

View File

@ -148,7 +148,10 @@ def get_section():
da_s.append(k)
if v != 'NBD':
da_dict[v] = da_s
return da_dict
depid = {}
for k, v in section.items():
depid[v] = k
return da_dict, depid
def get_all_uid():
@ -156,11 +159,12 @@ def get_all_uid():
获取所有部门的钉钉用户id
:return: list
"""
date_s = get_section()
date_s,depid = get_section()
res_c = []
for k, v in date_s.items():
res = {}
res['section_name'] = k
res['depid'] = depid[k]
res_list = []
for i in v:
user_list = get_uid(i)
@ -270,5 +274,5 @@ def get_alluid_list():
if __name__ == '__main__':
#a = user_details('16371426094531014')
a=get_alluid_list()
a=get_all_uid()
pprint.pprint(a)

View File

@ -359,4 +359,7 @@ def doc2pdf(fn, path_data, filename):
if __name__ == '__main__':
get_every_months('2022-01-01', '2022-12-31')
fn=r'C:\Users\Administrator\Desktop\面试简历\智联招聘_张双琪_Web开发工程师_中文.doc'
path_data=r'C:\Users\Administrator\Desktop\面试简历\\'
filename='智联招聘_张双琪_Web开发工程师_中文.doc'
doc2pdf(fn, path_data, filename)