patentinfo.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 patentinfo = {
  8. create_number: { type: String, required: false }, // 申请号
  9. create_date: { type: String, required: false }, // 申请日
  10. success_number: { type: String, required: false }, // 公开(公告)号
  11. success_date: { type: String, required: false }, // 公开(公告)日
  12. name: { type: String, required: false }, // 标题
  13. inventor: { type: String, required: false }, // 发明人
  14. address: { type: String, required: false }, // 发明人地址
  15. apply_personal: { type: String, required: false }, // 申请人
  16. term: { type: String, required: false }, // 专利有效性
  17. type: { type: String, required: false }, // 专利类型
  18. agent_personal: { type: String, required: false }, // 代理人
  19. agent: { type: String, required: false }, // 代理机构
  20. abstract: { type: String, required: false }, // 摘要
  21. img_url: { type: Array }, // 图片
  22. origin: { type: String }, // 数据来源(手写的)
  23. user_id: { type: [ ObjectId ] },
  24. status: { type: String, required: false, default: '0' }, // 状态
  25. trans_status: { type: String, required: false, default: '0' }, // 交易状态
  26. // 数据新增属性2021-09-06
  27. nationality: { type: String }, // 公开国别
  28. ipc_type: { type: String }, // ipc主分类
  29. onlegal_status: { type: String }, // 当前法律状态
  30. legal_status: { type: String }, // 法律状态
  31. law_date: { type: String }, // 法律文书日期
  32. on_obligee: { type: String }, // 当前权利人
  33. apply_address: { type: String }, // 申请人地址(其他)
  34. apply_other: { type: String }, // 申请人(其他)
  35. law_num: { type: String }, // 法律文书编号
  36. first_opendate: { type: String }, // 首次公开日
  37. empower_date: { type: String }, // 授权公告日
  38. lose_date: { type: String }, // 失效日
  39. examine_date: { type: String }, // 实际审查失效日
  40. invention_design: { type: String }, // 发明人(设计)其他
  41. };
  42. const schema = new Schema(patentinfo, { toJSON: { virtuals: true } });
  43. schema.index({ id: 1 });
  44. schema.index({ create_number: 1 });
  45. schema.index({ create_date: 1 });
  46. schema.index({ success_number: 1 });
  47. schema.index({ success_date: 1 });
  48. schema.index({ name: 1 });
  49. schema.index({ inventor: 1 });
  50. schema.index({ address: 1 });
  51. schema.index({ apply_personal: 1 });
  52. schema.index({ term: 1 });
  53. schema.index({ type: 1 });
  54. schema.index({ agent_personal: 1 });
  55. schema.index({ agent: 1 });
  56. schema.index({ abstract: 1 });
  57. schema.index({ origin: 1 });
  58. schema.index({ status: 1 });
  59. schema.index({ trans_status: 1 });
  60. schema.index({ nationality: 1 });
  61. schema.index({ ipc_type: 1 });
  62. schema.index({ onlegal_status: 1 });
  63. schema.index({ legal_status: 1 });
  64. schema.index({ law_date: 1 });
  65. schema.index({ on_obligee: 1 });
  66. schema.index({ apply_address: 1 });
  67. schema.index({ apply_other: 1 });
  68. schema.index({ law_num: 1 });
  69. schema.index({ first_opendate: 1 });
  70. schema.index({ empower_date: 1 });
  71. schema.index({ lose_date: 1 });
  72. schema.index({ examine_date: 1 });
  73. schema.index({ invention_design: 1 });
  74. schema.index({ 'meta.createdAt': 1 });
  75. schema.plugin(metaPlugin);
  76. module.exports = app => {
  77. const { mongoose } = app;
  78. return mongoose.model('Patentinfo', schema, 'patent_info');
  79. };