|
@@ -0,0 +1,145 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const moment = require('moment');
|
|
|
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
+const { ObjectId } = require('mongoose').Types;
|
|
|
+
|
|
|
+const basic = new Schema({
|
|
|
+ achieve_name: { type: String },
|
|
|
+ achieve_type: { type: Array },
|
|
|
+ achieve_num: { type: String },
|
|
|
+ achieve_date: { type: String },
|
|
|
+ achieve_form: { type: Array },
|
|
|
+ apply_personal: { type: String },
|
|
|
+ apply_phone: { type: String },
|
|
|
+ apply_company: { type: String },
|
|
|
+ address: { type: String },
|
|
|
+ apply_nature: { type: String },
|
|
|
+ contacts: { type: String },
|
|
|
+ phone: { type: String },
|
|
|
+ email: { type: String },
|
|
|
+ fax: { type: String },
|
|
|
+ objective: { type: String },
|
|
|
+ stage: { type: String },
|
|
|
+ output: { type: String },
|
|
|
+ profit: { type: String },
|
|
|
+ revenue: { type: String },
|
|
|
+
|
|
|
+ cert_jfh: { type: String },
|
|
|
+ cert_num: { type: String },
|
|
|
+ cert_sign: { type: String },
|
|
|
+
|
|
|
+ szd: { type: String },
|
|
|
+ yb: { type: String },
|
|
|
+ ls: { type: String },
|
|
|
+ oneCom_name: { type: String },
|
|
|
+ oneCom_szd: { type: String },
|
|
|
+ twoCom_name: { type: String },
|
|
|
+ twoCom_szd: { type: String },
|
|
|
+
|
|
|
+ shxy: { type: String },
|
|
|
+
|
|
|
+ gjjl_num: { type: String },
|
|
|
+ gjjl_name: { type: String },
|
|
|
+ gjjl_grade: { type: String },
|
|
|
+
|
|
|
+ sjjl_num: { type: String },
|
|
|
+ sjjl_name: { type: String },
|
|
|
+ sjjl_grade: { type: String },
|
|
|
+
|
|
|
+ gjjh_num: { type: String },
|
|
|
+ gjjh_money: { type: String },
|
|
|
+
|
|
|
+ sjjh_num: { type: String },
|
|
|
+ sjjh_money: { type: String },
|
|
|
+ achieve_influence: { type: Array },
|
|
|
+});
|
|
|
+basic.index({ id: 1 });
|
|
|
+basic.index({ achieve_num: 1 });
|
|
|
+
|
|
|
+
|
|
|
+const brief = new Schema({
|
|
|
+ achieve_brief: { type: String },
|
|
|
+ field: { type: String },
|
|
|
+ kpi_index: { type: String },
|
|
|
+ compare: { type: String },
|
|
|
+ advanced: { type: String },
|
|
|
+ sense: { type: String },
|
|
|
+ prospect: { type: String },
|
|
|
+ opinion: { type: String },
|
|
|
+});
|
|
|
+brief.index({ id: 1 });
|
|
|
+
|
|
|
+
|
|
|
+const research = new Schema({
|
|
|
+ name: { type: String },
|
|
|
+ gender: { type: String },
|
|
|
+ card: { type: String },
|
|
|
+ birth: { type: String },
|
|
|
+ age: { type: String },
|
|
|
+ education: { type: String },
|
|
|
+ degree: { type: String },
|
|
|
+ major: { type: String },
|
|
|
+ zw: { type: String },
|
|
|
+ zc: { type: String },
|
|
|
+ company: { type: String },
|
|
|
+ abroad: { type: String },
|
|
|
+ work: { type: String },
|
|
|
+ devote: { type: String },
|
|
|
+ phone: { type: String },
|
|
|
+ email: { type: String },
|
|
|
+});
|
|
|
+research.index({ id: 1 });
|
|
|
+
|
|
|
+
|
|
|
+const datalist = new Schema({
|
|
|
+ work_report: { type: Object },
|
|
|
+ techol_report: { type: Object },
|
|
|
+ compare_report: { type: Object },
|
|
|
+ benefit: { type: Object },
|
|
|
+ science_report: { type: Object },
|
|
|
+ techol_detect_report: { type: Object },
|
|
|
+ user_prove: { type: Object },
|
|
|
+ patent_cert: { type: Object },
|
|
|
+ software_copyright: { type: Object },
|
|
|
+ treatise: { type: Object },
|
|
|
+ gf: { type: Object },
|
|
|
+ company_standard: { type: Object },
|
|
|
+});
|
|
|
+datalist.index({ id: 1 });
|
|
|
+
|
|
|
+
|
|
|
+const file = new Schema({
|
|
|
+ page5: { type: String },
|
|
|
+ page6: { type: String },
|
|
|
+ nameList: { type: String },
|
|
|
+});
|
|
|
+file.index({ id: 1 });
|
|
|
+
|
|
|
+
|
|
|
+const apply = {
|
|
|
+ user_id: { type: ObjectId },
|
|
|
+ status: { type: String, default: '0' },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ basic: { type: basic },
|
|
|
+ brief: { type: brief },
|
|
|
+ research: { type: [ research ] },
|
|
|
+ datalist: { type: datalist },
|
|
|
+ file: { type: file, default: {} },
|
|
|
+ remark: { type: String, maxLength: 200 },
|
|
|
+ create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
|
|
|
+};
|
|
|
+const schema = new Schema(apply, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.index({ user_id: 1 });
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Apply', schema, 'apply');
|
|
|
+};
|