12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const moment = require('moment');
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const { ObjectId } = require('mongoose').Types;
- // 专利交易表
- const patenttrans = {
- user_id: { type: ObjectId }, // 用户id
- user_name: { type: String }, // 用户姓名
- mech_id: { type: ObjectId }, // 机构id
- mech_name: { type: String }, // 机构姓名
- patent_id: { type: ObjectId }, // 专利id
- patent_name: { type: String }, // 专利名称
- create_number: { type: String }, // 专利号
- on_obligee: { type: String }, // 当前权利人(变更前专利权人)
- contact: { type: String }, // 联系人
- phone: { type: String }, // 联系电话
- email: { type: String }, // 电子邮箱
- budget: { type: String }, // 投资预算
- type: { type: String }, // 交易类型(转让,许可,免费许可,招商,质押)
- promise_file: { type: Object }, // 交易类型为免费许可时,需填写免费许可承诺书
- is_report: { type: Boolean, default: false }, // 评估报告
- report: { type: Array }, // 评估报告
- requirementdesc: { type: String }, // 技术说明
- expect: { type: String }, // 商业预期
- condition: { type: String }, // 合作条件及要求
- abstract: { type: String }, // 摘要
- on_afterobligee: { type: String }, // 变更后专利权人
- transfer_date: { type: String }, // 专利权转移日期
- is_contract: { type: String }, // 0:线下合同,1:线上合同
- contract: { type: Object }, // 线上合同
- offine_contract: { type: Array }, // 线下合同
- status: { type: String, default: '0' }, // 状态,0:待审,1:通过,-1:拒绝,2:合同审核,3:合同通过,-3:合同拒绝,4:用户确认,5:归档交易完成
- record: { type: Array }, // 记录
- remark: { type: String },
- isdel: { type: String, required: false, default: '0' }, // 0=>未删除;1=>已撤回
- };
- const schema = new Schema(patenttrans, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ user_id: 1 });
- schema.index({ mech_id: 1 });
- schema.index({ patent_id: 1 });
- schema.index({ create_number: 1 });
- schema.index({ type: 1 });
- schema.index({ transfer_date: 1 });
- schema.index({ status: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Patenttrans', schema, 'patent_trans');
- };
|