日报添加字段
This commit is contained in:
parent
dd9b3d5502
commit
df87a8fd65
Binary file not shown.
|
@ -60,8 +60,7 @@
|
|||
"分支机构": [
|
||||
"浙江分公司",
|
||||
"湖南子公司",
|
||||
"鼎信团队",
|
||||
"四川远东"
|
||||
"鼎信团队"
|
||||
]
|
||||
},
|
||||
"监管和同业动态": [
|
||||
|
|
|
@ -63,7 +63,7 @@ def replace_words(content):
|
|||
def daily_add(db: Session, data):
|
||||
daily = Daily(**data)
|
||||
if daily.content:
|
||||
daily.content = replace_word(daily.content)
|
||||
daily.content = replace_words(daily.content)
|
||||
db.add(daily)
|
||||
db.commit()
|
||||
db.refresh(daily)
|
||||
|
@ -73,7 +73,7 @@ def daily_add(db: Session, data):
|
|||
def daily_change(db: Session, item_id, data):
|
||||
content = data.get('content')
|
||||
if content:
|
||||
data['content'] = replace_word(content)
|
||||
data['content'] = replace_words(content)
|
||||
db.query(Daily).filter_by(id=item_id).update(data)
|
||||
db.commit()
|
||||
item = db.query(Daily).filter_by(id=item_id).first()
|
||||
|
|
|
@ -63,7 +63,7 @@ def get_user_not_fill_daily():
|
|||
filled_user_list = {item.fill_user for item in daily_list}
|
||||
|
||||
notice_user_list = [item for item in db.query(User).filter(User.email.not_in(filled_user_list)) if
|
||||
item.name not in ['邢军']]
|
||||
item.name not in ['邢军'] and item.daily_fill_notice is True]
|
||||
email_list = [user.email for user in notice_user_list]
|
||||
name_list = [user.name for user in notice_user_list]
|
||||
# print(name_list)
|
||||
|
@ -140,11 +140,12 @@ class DailyNotice:
|
|||
while True:
|
||||
time.sleep(15)
|
||||
now = datetime.now()
|
||||
if is_workday() and now.hour == 15 and (35<= now.minute < 35 + 3) and not sended:
|
||||
if is_workday() and now.hour == 15 and (35 <= now.minute < 35 + 3) and not sended:
|
||||
sended = True
|
||||
try:
|
||||
user_list = get_user_not_fill_daily()
|
||||
args_list = [['日报填报提醒', user.email, daily_fill_send] for user in user_list if user.daily_fill_notice]
|
||||
args_list = [['日报填报提醒', user.email, daily_fill_send] for user in user_list if
|
||||
user.daily_fill_notice]
|
||||
# args_list = [['日报填报提醒', user.email, daily_fill_send] for user in user_list if user.name in ['王思川','伍春全','李凯','彭森','徐聿成','陈世杰']]
|
||||
self.email_send_thread(args_list)
|
||||
# send_email('日报填报提醒', "fecribd@fecr.com.cn", daily_fill_send)
|
||||
|
|
|
@ -270,7 +270,7 @@ def set_user_openid(body: UserSchemas.SetUserOpenidReq,
|
|||
@router.post("/get_user_can_watch_department", tags=["获取用户可查看部门列表"], summary=['查询'])
|
||||
def get_user_can_watch_department(token_data: TokenData = Depends(token_data_depend), db: Session = Depends(get_db)):
|
||||
print(token_data)
|
||||
department_list = [item.to_dict() for item in UserCrud.get_department_list(db) if item.id not in [1, 2, 3]]
|
||||
department_list = [item.to_dict() for item in UserCrud.get_department_list(db) if item.id not in [1, 2, 3] and item.name not in ["四川远东"]]
|
||||
department_dict = {item['id']: item for item in department_list}
|
||||
# 所有部门动态查看
|
||||
if check_auth(token_data.auth_data, [2]):
|
||||
|
|
|
@ -5,6 +5,7 @@ from sqlalchemy import create_engine, Column, and_, asc, desc, func, cast, DATE,
|
|||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import sessionmaker, Session, DeclarativeMeta, Query
|
||||
from typing import Literal, List, Any, Optional
|
||||
from sqlalchemy_utils import database_exists, create_database
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
|
@ -13,6 +14,7 @@ password = "123456"
|
|||
host = "127.0.0.1"
|
||||
db = 'daily'
|
||||
|
||||
|
||||
# user = "root"
|
||||
# password = "jntm2.5"
|
||||
# host = "192.168.0.89:13306"
|
||||
|
@ -58,6 +60,9 @@ def get_db_i() -> Session:
|
|||
# yield db
|
||||
# finally:
|
||||
# db.close()
|
||||
def create_db(engine):
|
||||
if not database_exists(engine.url):
|
||||
create_database(engine.url)
|
||||
|
||||
|
||||
def init_database():
|
||||
|
@ -67,7 +72,7 @@ def init_database():
|
|||
|
||||
# 通用查询接口
|
||||
|
||||
QueryType = Literal['=',"!=", '==', '>', '>=', '<', '<=', 'in', 'like', 'range', 'find_in_set', "date=="]
|
||||
QueryType = Literal['=', "!=", '==', '>', '>=', '<', '<=', 'in', 'like', 'range', 'find_in_set', "date=="]
|
||||
|
||||
|
||||
class QueryParam(BaseModel):
|
||||
|
|
|
@ -14,4 +14,5 @@ redis==4.5.1
|
|||
pandas==1.5.3
|
||||
openpyxl==3.1.2
|
||||
docxtpl
|
||||
pyahocorasick
|
||||
pyahocorasick
|
||||
sqlalchemy_utils==0.41.1
|
Loading…
Reference in New Issue