projectSolic.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
  5. const { ObjectId } = require('mongoose').Types;
  6. // 项目征集表
  7. const projectsolic = {
  8. name: { type: String, required: false, maxLength: 500 }, // 项目名称
  9. pro_user: { type: String, required: true, maxLength: 500 }, // 项目负责人
  10. pro_phone: { type: String, required: true, maxLength: 500 }, // 项目负责人电话
  11. field: { type: String, required: false, maxLength: 500 }, // 领域分类
  12. scale: { type: String, required: false, maxLength: 500 }, // 市场预估
  13. techol_stage: { type: String, required: false, maxLength: 500 }, // 技术阶段
  14. techol_level: { type: String, required: false, maxLength: 500 }, // 技术水平
  15. proposal_company: { type: String, required: false, maxLength: 500 }, // 建议单位名称
  16. proposal_user: { type: String, required: false, maxLength: 500 }, // 建议单位联系人
  17. proposal_phone: { type: String, required: false, maxLength: 500 }, // 建议单位联系电话
  18. coopera_company: { type: String, required: false, maxLength: 500 }, // 合作单位名称
  19. coopera_user: { type: String, required: false, maxLength: 500 }, // 合作单位联系人
  20. coopera_phone: { type: String, required: false, maxLength: 500 }, // 合作单位联系电话
  21. project_back: { type: String, required: false, maxLength: 500 }, // 项目背景
  22. sign: { type: String, required: false, maxLength: 500 }, // 立项意义
  23. work_basics: { type: String, required: false, maxLength: 500 }, // 前期基础
  24. content: { type: String, required: false, maxLength: 500 }, // 研究内容
  25. route: { type: String, required: false, maxLength: 500 }, // 技术路线
  26. quota: { type: String, required: false, maxLength: 500 }, // 核心指标
  27. influence: { type: String, required: false, maxLength: 500 }, // 经济效益
  28. question_id: { type: ObjectId, required: true, maxLength: 500 }, // 调研调查表id
  29. user_id: { type: ObjectId, required: true, maxLength: 500 }, // 用户id
  30. remark: { type: String, maxLength: 200 },
  31. status: { type: String, default: '0' }, // 0-可修改;1-不可修改
  32. create_time: {
  33. type: String,
  34. },
  35. };
  36. const schema = new Schema(projectsolic, { toJSON: { virtuals: true } });
  37. schema.index({ id: 1 });
  38. schema.index({ question_id: 1 });
  39. schema.index({ user_id: 1 });
  40. schema.index({ pro_user: 1 });
  41. schema.index({ 'meta.createdAt': 1 });
  42. schema.plugin(metaPlugin);
  43. module.exports = app => {
  44. const { mongoose } = app;
  45. return mongoose.model('ProjectSolic', schema, 'projectSolic');
  46. };