|
@@ -290,11 +290,18 @@ class SchoolService extends CrudService {
|
|
|
errorcode = '1';
|
|
|
data.msg = (data.msg || '') + '身份证号不允许为空;';
|
|
|
} else {
|
|
|
- const { pass, msg } = this.idCodeValid(data.id_number);
|
|
|
- if (!pass) {
|
|
|
+ const res = await this.smodel.findOne({ id_number: data.id_number });
|
|
|
+ if (res) {
|
|
|
errorcode = '1';
|
|
|
- data.msg = (data.msg || '') + `${msg},`;
|
|
|
+ data.msg = (data.msg || '') + '学生已经存在请检查;';
|
|
|
+ } else {
|
|
|
+ const { pass, msg } = this.idCodeValid(data.id_number);
|
|
|
+ if (!pass) {
|
|
|
+ errorcode = '1';
|
|
|
+ data.msg = (data.msg || '') + `${msg},`;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
if (!data.school_name) {
|
|
|
errorcode = '1';
|
|
@@ -364,11 +371,6 @@ class SchoolService extends CrudService {
|
|
|
errorcode = '1';
|
|
|
data.msg = (data.msg || '') + '手机号不正确;';
|
|
|
}
|
|
|
- const res = await this.smodel.findOne({ id_number: data.id_number });
|
|
|
- if (res) {
|
|
|
- errorcode = '1';
|
|
|
- data.msg = (data.msg || '') + '学生已经存在请检查;';
|
|
|
- }
|
|
|
if (errorcode === '1') {
|
|
|
errormsg.push(data);
|
|
|
}
|