Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

online表单开发中,导入EXCEL时,必填校验逻辑不完善 #3778

Closed
wwuddan123 opened this issue Jun 6, 2022 · 5 comments
Closed

Comments

@wwuddan123
Copy link

版本号:

3.2.0

问题描述:

online表单开发中,某字段del_flag设置为”不能为NULL“,但有默认值。
此时通过EXCEL导入,EXCEL中未包含此字段的列。
期望效果:成功导入,且数据库中此列全为默认值。
实际效果:开启导入校验后,全部都导入失败,原因为”此字段不能为空“。
推测原因:在EXCEL导入时,只校验了字段是否”不能为NULL“,未考虑存在默认值的情况,逻辑不完整。因为从新建按钮创建实体时,也没有提交此字段,但却新建成功了,说明这里的校验是完整的。

截图&代码:

del_flag_0
del_flag_1
del_flag_2
del_flag_3
del_flag_4

@zhangdaiscott
Copy link
Member

你的默认值是数据库层面的默认值,程序不可能知道数据库的默认值

@wwuddan123
Copy link
Author

你的默认值是数据库层面的默认值,程序不可能知道数据库的默认值

第一张截图确实是数据库层面的,但第二张截图是jeecg在线表单的啊,默认值我就是在在线表单中设置的0,然后同步给数据库的,所以jeecg肯定是知道的

@wwuddan123
Copy link
Author

image

onl_cgform_field表中是知道此字段有默认值的

@zhangdaiscott
Copy link
Member

ty

@tygithub1
Copy link

已修改

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants