Skip to content

Commit 3412f22

Browse files
insistencegitee-org
authored andcommitted
!23 RuoYi-Vue-FastAPI v1.6.2
Merge pull request !23 from insistence/develop
2 parents 6527e42 + 15cf71b commit 3412f22

File tree

23 files changed

+258
-125
lines changed

23 files changed

+258
-125
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<p align="center">
22
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
33
</p>
4-
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Vue-FastAPI v1.6.1</h1>
4+
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Vue-FastAPI v1.6.2</h1>
55
<h4 align="center">基于RuoYi-Vue+FastAPI前后端分离的快速开发框架</h4>
66
<p align="center">
77
<a href="https://gitee.com/insistence2022/RuoYi-Vue-FastAPI/stargazers"><img src="https://gitee.com/insistence2022/RuoYi-Vue-FastAPI/badge/star.svg?theme=dark"></a>
88
<a href="https://github.com/insistence/RuoYi-Vue-FastAPI"><img src="https://img.shields.io/github/stars/insistence/RuoYi-Vue-FastAPI?style=social"></a>
9-
<a href="https://gitee.com/insistence2022/RuoYi-Vue-FastAPI"><img src="https://img.shields.io/badge/RuoYiVueFastAPI-v1.6.1-brightgreen.svg"></a>
9+
<a href="https://gitee.com/insistence2022/RuoYi-Vue-FastAPI"><img src="https://img.shields.io/badge/RuoYiVueFastAPI-v1.6.2-brightgreen.svg"></a>
1010
<a href="https://gitee.com/insistence2022/RuoYi-Vue-FastAPI/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
1111
<img src="https://img.shields.io/badge/python-≥3.9-blue">
1212
<img src="https://img.shields.io/badge/MySQL-≥5.7-blue">

ruoyi-fastapi-backend/.env.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
1010
# 应用端口
1111
APP_PORT = 9099
1212
# 应用版本
13-
APP_VERSION= '1.6.1'
13+
APP_VERSION= '1.6.2'
1414
# 应用是否开启热重载
1515
APP_RELOAD = true
1616
# 应用是否开启IP归属区域查询

ruoyi-fastapi-backend/.env.prod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
1010
# 应用端口
1111
APP_PORT = 9099
1212
# 应用版本
13-
APP_VERSION= '1.6.1'
13+
APP_VERSION= '1.6.2'
1414
# 应用是否开启热重载
1515
APP_RELOAD = false
1616
# 应用是否开启IP归属区域查询

ruoyi-fastapi-backend/config/constant.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ class GenConstant:
252252
'double',
253253
'decimal',
254254
]
255+
COLUMNNAME_NOT_ADD_SHOW = ['create_by', 'create_time']
256+
COLUMNNAME_NOT_EDIT_SHOW = ['update_by', 'update_time']
255257
COLUMNNAME_NOT_EDIT = ['id', 'create_by', 'create_time', 'del_flag']
256258
COLUMNNAME_NOT_LIST = ['id', 'create_by', 'create_time', 'del_flag', 'update_by', 'update_time']
257259
COLUMNNAME_NOT_QUERY = ['id', 'create_by', 'create_time', 'del_flag', 'update_by', 'update_time', 'remark']

ruoyi-fastapi-backend/config/get_scheduler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,12 @@ def execute_scheduler_job_once(cls, job_info: JobModel):
201201
job_executor = job_info.job_executor
202202
if iscoroutinefunction(job_func):
203203
job_executor = 'default'
204+
job_trigger = DateTrigger()
205+
if job_info.status == '0':
206+
job_trigger = OrTrigger(triggers=[DateTrigger(), MyCronTrigger.from_crontab(job_info.cron_expression)])
204207
scheduler.add_job(
205208
func=eval(job_info.invoke_target),
206-
trigger=OrTrigger(triggers=[DateTrigger(), MyCronTrigger.from_crontab(job_info.cron_expression)]),
209+
trigger=job_trigger,
207210
args=job_info.job_args.split(',') if job_info.job_args else None,
208211
kwargs=json.loads(job_info.job_kwargs) if job_info.job_kwargs else None,
209212
id=str(job_info.job_id),

ruoyi-fastapi-backend/module_admin/dao/log_dao.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from module_admin.entity.vo.log_vo import LogininforModel, LoginLogPageQueryModel, OperLogModel, OperLogPageQueryModel
66
from utils.common_util import SnakeCaseUtil
77
from utils.page_util import PageUtil
8+
from utils.time_format_util import TimeFormatUtil
89

910

1011
class OperationLogDao:
@@ -38,8 +39,8 @@ async def get_operation_log_list(cls, db: AsyncSession, query_object: OperLogPag
3839
SysOperLog.business_type == query_object.business_type if query_object.business_type else True,
3940
SysOperLog.status == query_object.status if query_object.status else True,
4041
SysOperLog.oper_time.between(
41-
datetime.combine(datetime.strptime(query_object.begin_time, '%Y-%m-%d'), time(00, 00, 00)),
42-
datetime.combine(datetime.strptime(query_object.end_time, '%Y-%m-%d'), time(23, 59, 59)),
42+
datetime.combine(TimeFormatUtil.parse_date(query_object.begin_time), time(00, 00, 00)),
43+
datetime.combine(TimeFormatUtil.parse_date(query_object.end_time), time(23, 59, 59)),
4344
)
4445
if query_object.begin_time and query_object.end_time
4546
else True,
@@ -120,8 +121,8 @@ async def get_login_log_list(cls, db: AsyncSession, query_object: LoginLogPageQu
120121
SysLogininfor.user_name.like(f'%{query_object.user_name}%') if query_object.user_name else True,
121122
SysLogininfor.status == query_object.status if query_object.status else True,
122123
SysLogininfor.login_time.between(
123-
datetime.combine(datetime.strptime(query_object.begin_time, '%Y-%m-%d'), time(00, 00, 00)),
124-
datetime.combine(datetime.strptime(query_object.end_time, '%Y-%m-%d'), time(23, 59, 59)),
124+
datetime.combine(TimeFormatUtil.parse_date(query_object.begin_time), time(00, 00, 00)),
125+
datetime.combine(TimeFormatUtil.parse_date(query_object.end_time), time(23, 59, 59)),
125126
)
126127
if query_object.begin_time and query_object.end_time
127128
else True,

ruoyi-fastapi-backend/module_admin/service/dict_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,10 @@ async def edit_dict_type_services(cls, request: Request, query_db: AsyncSession,
103103
if dict_type_info.dict_type != page_object.dict_type:
104104
for dict_data in dict_data_list:
105105
edit_dict_data = DictDataModel(
106-
dictCode=dict_data.dict_code,
106+
dictCode=dict_data.get('dict_code'),
107107
dictType=page_object.dict_type,
108108
updateBy=page_object.update_by,
109+
updateTime=page_object.update_time,
109110
).model_dump(exclude_unset=True)
110111
await DictDataDao.edit_dict_data_dao(query_db, edit_dict_data)
111112
await DictTypeDao.edit_dict_type_dao(query_db, edit_dict_type)

ruoyi-fastapi-backend/module_admin/service/user_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ async def export_user_list_services(user_list: List):
494494
}
495495

496496
for item in user_list:
497+
item['deptName'] = item.get('dept').get('deptName')
497498
if item.get('status') == '0':
498499
item['status'] = '正常'
499500
else:

ruoyi-fastapi-backend/module_generator/templates/python/dao.py.jinja2

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ class {{ BusinessName }}Dao:
118118
{{ ClassName }}.{{ field }} <= query_object.{{ field }} if query_object.{{ field }} else True,
119119
{% elif column.query_type == "LIKE" %}
120120
{{ ClassName }}.{{ field }}.like(f'%{% raw %}{{% endraw %}query_object.{{ field }}{% raw %}}{% endraw %}%') if query_object.{{ field }} else True,
121-
{% elif column.query_type == "BETWEEN" %}
121+
{% elif column.html_type == "datetime" and column.query_type == "BETWEEN" %}
122122
{{ ClassName }}.{{ field }}.between(
123-
datetime.combine(datetime.strptime(query_object.begin_time, '%Y-%m-%d'), time(00, 00, 00)),
124-
datetime.combine(datetime.strptime(query_object.end_time, '%Y-%m-%d'), time(23, 59, 59)),
123+
datetime.combine(datetime.strptime(query_object.begin_{{ column.column_name }}, '%Y-%m-%d'), time(00, 00, 00)),
124+
datetime.combine(datetime.strptime(query_object.end_{{ column.column_name }}, '%Y-%m-%d'), time(23, 59, 59)),
125125
)
126-
if query_object.begin_time and query_object.end_time
126+
if query_object.begin_{{ column.column_name }} and query_object.end_{{ column.column_name }}
127127
else True,
128128
{% endif %}
129129
{% endif %}
@@ -145,7 +145,7 @@ class {{ BusinessName }}Dao:
145145
:param {{ businessName }}: {{ functionName }}对象
146146
:return:
147147
"""
148-
db_{{ businessName }} = {{ ClassName }}(**{{ businessName }}.model_dump(exclude={% raw %}{{% endraw %}{% if table.sub %}'{{ subclassName }}_list', {% endif %}{% for column in columns %}{% if not column.insert %}'{{ column.python_field | camel_to_snake }}'{% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% raw %}}{% endraw %}))
148+
db_{{ businessName }} = {{ ClassName }}(**{{ businessName }}.model_dump(exclude={% raw %}{{% endraw %}{% if table.sub %}'{{ subclassName }}_list', {% endif %}{% for column in columns %}{% if not column.insert and column.column_name not in column_not_add_show + column_not_edit_show %}'{{ column.python_field | camel_to_snake }}'{% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% raw %}}{% endraw %}))
149149
db.add(db_{{ businessName }})
150150
await db.flush()
151151

ruoyi-fastapi-backend/module_generator/templates/python/service.py.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class {{ BusinessName }}Service:
103103
:param page_object: 编辑{{ functionName }}对象
104104
:return: 编辑{{ functionName }}校验结果
105105
"""
106-
edit_{{ businessName }} = page_object.model_dump(exclude_unset=True, exclude={% raw %}{{% endraw %}{% if table.sub %}'{{ subclassName }}_list', {% endif %}{% for column in columns %}{% if not column.edit and not column.pk %}'{{ column.python_field | camel_to_snake }}'{% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% raw %}}{% endraw %})
106+
edit_{{ businessName }} = page_object.model_dump(exclude_unset=True, exclude={% raw %}{{% endraw %}{% if table.sub %}'{{ subclassName }}_list', {% endif %}{% for column in columns %}{% if not column.edit and not column.pk and column.column_name not in column_not_edit_show %}'{{ column.python_field | camel_to_snake }}'{% if not loop.last %}, {% endif %}{% endif %}{% endfor %}{% raw %}}{% endraw %})
107107
{{ businessName }}_info = await cls.{{ businessName }}_detail_services(query_db, page_object.{{ pk_field }})
108108
if {{ businessName }}_info.{{ pk_field }}:
109109
{% for column in columns %}

0 commit comments

Comments
 (0)