liuyu 4 lat temu
rodzic
commit
ae8514fd05
2 zmienionych plików z 60 dodań i 5 usunięć
  1. 20 5
      app/model/teacher.js
  2. 40 0
      app/service/school.js

+ 20 - 5
app/model/teacher.js

@@ -22,6 +22,20 @@ const FileInfo = new Schema({
   type: { type: String, required: false, maxLength: 200 }, // 资料类别,教案(Word)、PPT、视频(Mp4)、其他(zip)
 });
 
+// 教育培训经历
+const experienceInfo = new Schema({
+  startDate: { type: String, required: false, maxLength: 200 }, // 开始日期
+  endDate: { type: String, required: false, maxLength: 200 }, // 结束日期
+  content: { type: String, required: false }, // 内容
+});
+
+// 主要学术成果及获奖情况
+const academicInfo = new Schema({
+  startDate: { type: String, required: false, maxLength: 200 }, // 开始日期
+  endDate: { type: String, required: false, maxLength: 200 }, // 结束日期
+  content: { type: String, required: false }, // 内容
+});
+
 // 教师表
 const TeacherSchema = {
   name: { type: String, required: true, maxLength: 200 }, // 教师姓名
@@ -29,9 +43,9 @@ const TeacherSchema = {
   idnumber: { type: String, required: true, maxLength: 200 }, // 身份证号
   gender: { type: String, required: true, maxLength: 200 }, // 教师性别
   zynumber: { type: String, required: true, maxLength: 200 }, // 职业资格证号
-  zynumberfile: { type: [ zynumberfileInfo ], required: true, maxLength: 200 }, // 职业资格证图片
-  schid: { type: String, required: true, maxLength: 200 }, // 学校id
-  schname: { type: String, required: true, maxLength: 200 }, // 学校名称
+  zynumberfile: { type: [ zynumberfileInfo ], select: true }, // 职业资格证图片
+  schid: { type: String, required: false, maxLength: 200 }, // 学校id
+  schname: { type: String, required: false, maxLength: 200 }, // 学校名称
   email: { type: String, required: true, maxLength: 200 }, // 邮箱
   openid: { type: String, required: false, maxLength: 200 }, // 微信openid
   age: { type: String, required: true, maxLength: 200 }, // 年龄
@@ -45,10 +59,11 @@ const TeacherSchema = {
   degree: { type: String, required: true, maxLength: 200 }, // 最后学位
   major: { type: String, required: true, maxLength: 200 }, // 教师所学专业
   schlesson: { type: String, required: true, maxLength: 200 }, // 教师在校所教课程
-  experience: { type: String, required: true, maxLength: 200 }, // 教育培训经历(从大学开始)
+  experience: { type: [ experienceInfo ], select: true }, // 教育培训经历(从大学开始)
   courses: { type: String, required: true, maxLength: 200 }, // 主讲课程
-  academic: { type: String, required: true, maxLength: 200 }, // 主要学术成果及获奖情况
+  academic: { type: [ academicInfo ], select: true }, // 主要学术成果及获奖情况
   jobyear: { type: String, required: true, maxLength: 200 }, // 从事就业创业教学工作年限
+  jobaddress: { type: String, required: true, maxLength: 500 }, // 工作地点
   subid: { type: String, required: true, maxLength: 200 }, // 科目id
   islyteacher: { type: String, required: true, maxLength: 200 }, // 是否可讲礼仪课,0-否,1-是
   zlscore: { type: String, required: false, maxLength: 200 }, // 资料评分

+ 40 - 0
app/service/school.js

@@ -233,6 +233,10 @@ class SchoolService extends CrudService {
         errorcode = '1';
         data.msg = data.msg + '性别不允许为空,';
       }
+      if (!data.nation) {
+        errorcode = '1';
+        data.msg = data.msg + '民族不允许为空,';
+      }
       if (!data.id_number) {
         errorcode = '1';
         data.msg = data.msg + '身份证号不允许为空,';
@@ -245,6 +249,42 @@ class SchoolService extends CrudService {
         errorcode = '1';
         data.msg = data.msg + '手机号不允许为空,';
       }
+      if (!data.faculty) {
+        errorcode = '1';
+        data.msg = data.msg + '院系不允许为空,';
+      }
+      if (!data.major) {
+        errorcode = '1';
+        data.msg = data.msg + '专业不允许为空,';
+      }
+      if (!data.entry_year) {
+        errorcode = '1';
+        data.msg = data.msg + '入学年份不允许为空,';
+      }
+      if (!data.finish_year) {
+        errorcode = '1';
+        data.msg = data.msg + '毕业年份不允许为空,';
+      }
+      if (!data.school_job) {
+        errorcode = '1';
+        data.msg = data.msg + '职务不允许为空,';
+      }
+      if (!data.qq) {
+        errorcode = '1';
+        data.msg = data.msg + 'QQ号不允许为空,';
+      }
+      if (!data.family_place) {
+        errorcode = '1';
+        data.msg = data.msg + '家庭所在地不允许为空,';
+      }
+      if (!data.family_is_hard) {
+        errorcode = '1';
+        data.msg = data.msg + '家庭是否困难不允许为空,';
+      }
+      if (!data.have_grant) {
+        errorcode = '1';
+        data.msg = data.msg + '是否获得过助学金不允许为空,';
+      }
       if (!/^\d{11}$/i.test(data.phone)) {
         errorcode = '1';
         data.msg = data.msg + '手机号不正确,';