浏览代码

价值评估

guhongwei 3 年之前
父节点
当前提交
dd372631ea
共有 2 个文件被更改,包括 34 次插入19 次删除
  1. 16 9
      app/controller/patent/.patentassess.js
  2. 18 10
      app/model/patent/patentassess.js

+ 16 - 9
app/controller/patent/.patentassess.js

@@ -1,10 +1,11 @@
 module.exports = {
   create: {
     requestBody: [
-      "admin_id",
       "user_id",
+      "user_name",
+      "admin_id",
+      "admin_name",
       "patent_id",
-      "create_number",
       "patent_name",
       "inventor",
       "type",
@@ -14,8 +15,10 @@ module.exports = {
       "abstract",
       "field",
       "explain",
+      "shared_value",
+      "techol_stable",
+      "techol_advanced",
       "is_money",
-      "report",
       "status",
     ],
   },
@@ -26,10 +29,11 @@ module.exports = {
   update: {
     params: ["!id"],
     requestBody: [
-      "admin_id",
       "user_id",
+      "user_name",
+      "admin_id",
+      "admin_name",
       "patent_id",
-      "create_number",
       "patent_name",
       "inventor",
       "type",
@@ -39,9 +43,10 @@ module.exports = {
       "abstract",
       "field",
       "explain",
+      "shared_value",
+      "techol_stable",
+      "techol_advanced",
       "is_money",
-      "report",
-      "record",
       "status",
     ],
   },
@@ -54,11 +59,13 @@ module.exports = {
   index: {
     parameters: {
       query: {
-        admin_id: "admin_id",
         user_id: "user_id",
+        user_name: "%user_name%",
+        admin_id: "admin_id",
+        admin_name: "%admin_name%",
         patent_id: "patent_id",
         create_number: "create_number",
-        patent_name: "patent_name",
+        patent_name: "%patent_name%",
         type: "type",
         status: "status",
         is_money: "is_money",

+ 18 - 10
app/model/patent/patentassess.js

@@ -5,33 +5,41 @@ const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 const { ObjectId } = require('mongoose').Types;
 // 价值评估表
 const patentassess = {
-  admin_id: { type: ObjectId }, // 管理员id
-  user_id: { type: ObjectId }, // 用户id
+  user_id: { type: ObjectId, required: false }, // 用户id
+  user_name: { type: String, required: false }, // 用户姓名
+  admin_id: { type: ObjectId, required: false }, // 管理员id
+  admin_name: { type: String, required: false }, // 管理员姓名
   patent_id: { type: ObjectId }, // 专利id
-  create_number: { type: String }, // 申请号
-  patent_name: { type: String }, // 专利名称
-  inventor: { type: Array }, // 发明人
+  create_number: { type: String, required: false }, // 申请号
+  patent_name: { type: String, required: false }, // 专利名称
+  inventor: { type: Array, required: false }, // 发明人
   type: { type: String, required: false }, // 专利类型
-  contact: { type: String }, // 联系人
-  phone: { type: String }, // 联系人电话
-  email: { type: String }, // 联系人邮箱
+  contact: { type: String, required: false }, // 联系人
+  phone: { type: String, required: false }, // 联系人电话
+  email: { type: String, required: false }, // 联系人邮箱
   abstract: { type: String, required: false }, // 摘要
   field: { type: String, required: false }, // 应用领域
   explain: { type: String, required: false }, // 技术说明
+  shared_value: { type: String, required: false }, // 合享价值度
+  techol_stable: { type: String, required: false }, // 技术稳定性
+  techol_advanced: { type: String, required: false }, // 技术先进性
   is_money: { type: Boolean, default: false }, // 是否缴费
+  status: { type: String, default: '0' }, // 状态
   report: { type: Array }, // 评估报告
   record: { type: Array }, // 记录
-  status: { type: String, default: '0' }, // 状态
+
   remark: { type: String },
 };
 const schema = new Schema(patentassess, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });
-schema.index({ admin_id: 1 });
 schema.index({ user_id: 1 });
+schema.index({ admin_id: 1 });
 schema.index({ patent_id: 1 });
 schema.index({ create_number: 1 });
+schema.index({ patent_name: 1 });
 schema.index({ type: 1 });
 schema.index({ is_money: 1 });
+schema.index({ status: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.plugin(metaPlugin);
 module.exports = app => {