1.添加权限
This commit is contained in:
parent
2307b5db23
commit
cd8dfea5b9
@ -287,7 +287,7 @@ async def file_to_hw(
|
||||
if fn.endswith('pdf'): # pdf正常上传到华为云
|
||||
res = obsClient.putFile('legu-cdn-source', 'hrms/' + filename, path_data + '/' + filename)
|
||||
else: # doc/docx则转化为pdf上传到华为云
|
||||
new_fn,fil = doc2pdf(fn, path_data, filename)
|
||||
new_fn, fil = doc2pdf(fn, path_data, filename)
|
||||
res = obsClient.putFile('legu-cdn-source', 'hrms/' + fil, new_fn)
|
||||
if res.status < 300:
|
||||
# 地址
|
||||
@ -1681,3 +1681,24 @@ async def add_role_domain(
|
||||
# 存在则在这个用户表示已经有权限
|
||||
else:
|
||||
return schemas.Msg(code=-9, msg='权限已存在', data='')
|
||||
|
||||
|
||||
@router.post("/send_interviewee")
|
||||
async def send_interviewee(
|
||||
request: Request,
|
||||
data_in: schemas.send_in,
|
||||
db: AsyncIOMotorDatabase = Depends(get_database),
|
||||
ckdb: CKDrive = Depends(get_ck_db),
|
||||
current_user: schemas.UserDB = Depends(deps.get_current_user)
|
||||
) -> schemas.Msg:
|
||||
"""一键推送给用人部门"""
|
||||
up_da = data_in.push
|
||||
up_list = await crud.user.get_users(db, up_da)
|
||||
up_da_str = ','.join(up_da)
|
||||
interview_name = [i['name'] for i in up_list] # 分配的面试官的名字
|
||||
interview_str = ','.join(interview_name)
|
||||
sql = f"""
|
||||
ALTER TABLE HR.resumes update interview_name = '{interview_str}',interview_id = '{up_da_str}' WHERE uid = '{data_in.uid}'
|
||||
"""
|
||||
await ckdb.execute(sql) # 初次分配面试官
|
||||
return schemas.Msg(code=200, msg='ok', data='')
|
||||
|
@ -25,6 +25,10 @@ class CRUDUser(CRUDBase):
|
||||
async def get_user(self, db: AsyncIOMotorDatabase, user_id: str):
|
||||
res = await db[self.coll_name].find_one({'user_id': user_id})
|
||||
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})
|
||||
return res
|
||||
|
||||
async def edit_profile(self, db: AsyncIOMotorDatabase, data_id: schemas.UserProfileEdit, user_id):
|
||||
if data_id.nickname:
|
||||
|
@ -328,3 +328,12 @@ api:/api/v1/itr/find_job
|
||||
请求方式:post
|
||||
参数:
|
||||
job_id: str # 职位的唯一id
|
||||
|
||||
#一键推送给用人部门
|
||||
api:/api/v1/itr/send_interviewee
|
||||
请求方式:post
|
||||
参数:
|
||||
uid: str # 求职者uid
|
||||
push: List[str] # 推送
|
||||
content: str # 备注内容
|
||||
bcc: List[str] # 抄送
|
@ -137,3 +137,10 @@ class ExtendendOAuth(OAuth2PasswordRequestForm):
|
||||
super().__init__(grant_type, username, password, scope, client_id, client_secret)
|
||||
self.unionid = unionid # 通过钉钉扫码获取的unionid
|
||||
# unionid :str # 通过钉钉扫码获取的unionid
|
||||
|
||||
|
||||
class send_in(BaseModel):
|
||||
uid: str # 求职者uid
|
||||
push: List[str] # 推送
|
||||
content: str # 备注内容
|
||||
bcc: List[str] # 抄送
|
||||
|
Loading…
Reference in New Issue
Block a user