|
@@ -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 }, // 经济效益税收
|
|
|
+ // 2021-04-13添加
|
|
|
+ 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 }, // 参加单位1——名称
|
|
|
+ oneCom_szd: { type: String }, // 参加单位1——所在地
|
|
|
+ twoCom_name: { type: String }, // 参加单位2——名称
|
|
|
+ twoCom_szd: { type: String }, // 参加单位2——所在地
|
|
|
+
|
|
|
+ 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' }, // 状态
|
|
|
+ // 1=>初审通过(待评分);-1=>初审失败
|
|
|
+ // 2=>评分通过(待缴费);-2=>评分失败
|
|
|
+ // 3=>已缴费(状态)
|
|
|
+ // 4=>补充资料
|
|
|
+ // 5=>会审通过;-5=>会审失败(不能改了,没机会了)
|
|
|
+ // 6=>证书发放
|
|
|
+ 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');
|
|
|
+};
|