浏览代码

专利检索

guhongwei 3 年之前
父节点
当前提交
2adada1968
共有 3 个文件被更改,包括 27 次插入29 次删除
  1. 8 12
      app/controller/patent/.patentanalysis.js
  2. 5 10
      app/model/patent/patentanalysis.js
  3. 14 7
      app/service/patent/patentanalysis.js

+ 8 - 12
app/controller/patent/.patentanalysis.js

@@ -2,10 +2,9 @@ module.exports = {
   create: {
     requestBody: [
       "user_id",
+      "user_name",
       "admin_id",
-      "is_mech",
-      "mechanism_id",
-      "mechanism_name",
+      "admin_name",
       "name",
       "apply_name",
       "type",
@@ -14,8 +13,8 @@ module.exports = {
       "phone",
       "email",
       "questions",
-      "status",
       "file",
+      "status",
     ],
   },
   destroy: {
@@ -26,10 +25,9 @@ module.exports = {
     params: ["!id"],
     requestBody: [
       "user_id",
+      "user_name",
       "admin_id",
-      "is_mech",
-      "mechanism_id",
-      "mechanism_name",
+      "admin_name",
       "name",
       "apply_name",
       "type",
@@ -38,8 +36,8 @@ module.exports = {
       "phone",
       "email",
       "questions",
-      "status",
       "file",
+      "status",
     ],
   },
   show: {
@@ -52,12 +50,10 @@ module.exports = {
     parameters: {
       query: {
         user_id: "user_id",
+        user_name: "%user_name%",
         admin_id: "admin_id",
-        is_mech: "is_mech",
-        mechanism_id: "mechanism_id",
-        mechanism_name: "mechanism_name",
+        admin_name: "%admin_name%",
         name: "name",
-        apply_name: "apply_name",
         type: "type",
         status: "status",
         "create_time@start": "create_time@start",

+ 5 - 10
app/model/patent/patentanalysis.js

@@ -6,32 +6,27 @@ const { ObjectId } = require('mongoose').Types;
 // 查新检索-交底单
 const patentanalysis = {
   user_id: { type: ObjectId }, // 用户id
+  user_name: { type: ObjectId }, // 用户id
   admin_id: { type: ObjectId }, // 管理员id
-  is_mech: { type: String }, // 是否需要机构
-  mechanism_id: { type: ObjectId }, // 机构id
-  mechanism_name: { type: String }, // 机构名称
+  admin_name: { type: ObjectId }, // 管理员id
   name: { type: String }, // 发明名称
   apply_name: { type: String }, // 申请人
-  type: { type: String }, // 申请类型
+  type: { type: String }, // 专利类型
   inventor: { type: String }, // 发明人
   contact: { type: String }, // 联系人
   phone: { type: String }, // 联系人电话
   email: { type: String }, // 联系人邮箱
-  questions: { type: Object }, // 问题
+  questions: { type: Object, default: {} }, // 问题
   file: { type: Array }, // 报告文件
-  record: { type: Array }, // 记录
   status: { type: String, default: '0' }, // 状态
+  record: { type: Array }, // 记录
   remark: { type: String },
 };
 const schema = new Schema(patentanalysis, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ user_id: 1 });
 schema.index({ admin_id: 1 });
-schema.index({ is_mech: 1 });
-schema.index({ mechanism_id: 1 });
-schema.index({ mechanism_name: 1 });
 schema.index({ name: 1 });
-schema.index({ apply_name: 1 });
 schema.index({ status: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.plugin(metaPlugin);

+ 14 - 7
app/service/patent/patentanalysis.js

@@ -40,13 +40,16 @@ class PatentanalysisService extends CrudService {
         word = '修改';
         break;
       case '0':
-        word = '管理员审核';
+        word = '系统管理员审核';
         break;
       case '1':
-        word = '管理员审核通过';
+        word = '系统管理员审核通过';
         break;
       case '-1':
-        word = '管理员审核未通过';
+        word = '系统管理员审核未通过';
+        break;
+      case '2':
+        word = '报告文件已发放';
         break;
       default:
         word = '未知状态';
@@ -78,19 +81,23 @@ class PatentanalysisService extends CrudService {
     let to = '';
     switch (code) {
       case 'create':
-        content = `${apply_name}提交了专利申请书【${name}】的申报,请及时前往申请管理进行处理`;
+        content = `${apply_name}提交了【${name}】的专利检索申报,请及时前往相应功能管理进行处理`;
         to = admin_id;
         break;
       case 'update':
-        content = `${apply_name}重新提交了专利申请书【${name}】的申报,请及时前往申请管理进行处理`;
+        content = `${apply_name}重新提交了【${name}】的专利检索申报,请及时前往相应功能管理进行处理`;
         to = admin_id;
         break;
       case '-1':
-        content = `您的专利申请书【${name}】未通过管理员的审核,请您及时修改,重新申请`;
+        content = `您的【${name}】的专利检索未通过系统管理员的审核`;
         to = user_id;
         break;
       case '1':
-        content = `您的专利申请书【${name}】已通过管理员的审核,请您耐心等待管理员发放报告文件`;
+        content = `您的【${name}】的专利检索通过了系统管理员的审核,请您耐心等待系统管理员发放报告文件`;
+        to = user_id;
+        break;
+      case '2':
+        content = `您的【${name}】的专利检索的报告已发放,请及时查看`;
         to = user_id;
         break;
       default: