achieve_apply.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  5. const { ObjectId } = require('mongoose').Types;
  6. // 基本信息
  7. const basic = new Schema({
  8. achieve_name: { type: String }, // 成果名称
  9. achieve_type: { type: Array }, // 成果类别
  10. achieve_num: { type: String }, // 成果编号
  11. achieve_date: { type: String }, // 成果取得时间
  12. achieve_form: { type: String }, // 成果形式
  13. apply_personal: { type: String }, // 申请人
  14. apply_phone: { type: String }, // 申请人
  15. apply_company: { type: String }, // 申请单位
  16. address: { type: String }, // 地址
  17. apply_nature: { type: String }, // 申请单位/申请人属性
  18. contacts: { type: String }, // 联系人
  19. phone: { type: String }, // 联系电话
  20. email: { type: String }, // 邮箱
  21. fax: { type: String }, // 传真
  22. objective: { type: String }, // 评价目的
  23. stage: { type: String }, // 成果所处阶段
  24. output: { type: String }, // 经济效益产值
  25. profit: { type: String }, // 经济效益利润
  26. revenue: { type: String }, // 经济效益税收
  27. // 2021-04-13添加
  28. cert_jfh: { type: String }, // 吉发号
  29. cert_num: { type: String }, // 第几号
  30. cert_sign: { type: String }, // 签字
  31. szd: { type: String }, // 所在地
  32. yb: { type: String }, // 邮编
  33. ls: { type: String }, // 隶属
  34. oneCom_name: { type: String }, // 参加单位1——名称
  35. oneCom_szd: { type: String }, // 参加单位1——所在地
  36. twoCom_name: { type: String }, // 参加单位2——名称
  37. twoCom_szd: { type: String }, // 参加单位2——所在地
  38. shxy: { type: String }, // 社会效益
  39. // 国家奖励
  40. gjjl_num: { type: String }, // 国家奖励项
  41. gjjl_name: { type: String }, // 国家奖励名称
  42. gjjl_grade: { type: String }, // 国家奖励等级
  43. sjjl_num: { type: String }, // 省级奖励项
  44. sjjl_name: { type: String }, // 省级奖励名称
  45. sjjl_grade: { type: String }, // 省级奖励等级
  46. // 计划支持
  47. gjjh_num: { type: String }, // 国家计划项
  48. gjjh_money: { type: String }, // 国家计划经费
  49. sjjh_num: { type: String }, // 省级计划项
  50. sjjh_money: { type: String }, // 省级计划经费
  51. achieve_influence: { type: String }, // 成果的影响及作用
  52. });
  53. basic.index({ id: 1 });
  54. basic.index({ achieve_num: 1 });
  55. // 内容简介
  56. const brief = new Schema({
  57. achieve_brief: { type: String }, // 成果简介
  58. field: { type: String }, // 应用领域和技术原理
  59. kpi_index: { type: String }, // 性能指标
  60. compare: { type: String }, // 与国内外同类技术比较
  61. advanced: { type: String }, // 成果的创造性,先进性
  62. sense: { type: String }, // 作用意义
  63. prospect: { type: String }, // 推广应用的范围,条件和前景
  64. opinion: { type: String }, // 存在的问题和改进意见
  65. });
  66. brief.index({ id: 1 });
  67. // 主研人员名单
  68. const research = new Schema({
  69. research_name: { type: String }, // 姓名
  70. card: { type: String }, // 证件号码
  71. gender: { type: String }, // 性别
  72. position: { type: String }, // 技术职称
  73. education: { type: String }, // 文化程度
  74. degree: { type: String }, // 学位
  75. abroad: { type: String }, // 是否留学归国
  76. research_company: { type: String }, // 工作单位
  77. devote: { type: String }, // 对成果创造性贡献
  78. birth: { type: String }, // 出生
  79. zw: { type: String }, // 职务
  80. phone: { type: String }, // 电话
  81. email: { type: String }, // 邮箱
  82. });
  83. research.index({ id: 1 });
  84. // 委托方提供资料清单
  85. const datalist = new Schema({
  86. work_report: { type: Object }, // 工作报告(必备)
  87. techol_report: { type: Object }, // 技术报告(必备)
  88. compare_report: { type: Object }, // 国内外对比报告(必备)
  89. benefit: { type: Object }, // 经济效益分析(必备)
  90. science_report: { type: Object }, // 科技查新报告(必备)
  91. techol_detect_report: { type: Object }, // 技术检测报告
  92. user_prove: { type: Object }, // 用户证明
  93. patent_cert: { type: Object }, // 专利证书
  94. software_copyright: { type: Object }, // 软著
  95. treatise: { type: Object }, // 论文
  96. gf: { type: Object }, // 工法
  97. company_standard: { type: Object }, // 企业标准等证明材料
  98. });
  99. datalist.index({ id: 1 });
  100. // 成果评价申请表
  101. const achieve_apply = {
  102. user_id: { type: ObjectId }, // 关联用户
  103. status: { type: String, default: '0' }, // 状态
  104. // 1=>初审通过(待评分);-1=>初审失败
  105. // 2=>评分通过(待缴费);-2=>评分失败
  106. // 3=>已缴费(状态)
  107. // 4=>补充资料
  108. // 5=>会审通过;-5=>会审失败(不能改了,没机会了)
  109. // 6=>证书发放
  110. basic: { type: basic },
  111. brief: { type: brief },
  112. research: { type: [ research ] },
  113. datalist: { type: datalist },
  114. file: { type: Object }, // 上传文件
  115. remark: { type: String, maxLength: 200 },
  116. create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
  117. };
  118. const schema = new Schema(achieve_apply, { toJSON: { virtuals: true } });
  119. schema.index({ id: 1 });
  120. schema.index({ 'meta.createdAt': 1 });
  121. schema.plugin(metaPlugin);
  122. module.exports = app => {
  123. const { mongoose } = app;
  124. return mongoose.model('Achieve_apply', schema, 'achieve_apply');
  125. };