浏览代码

Merge branch 'master' of http://git.cc-lotus.info/live/service-live

ruifeng_liu 3 年之前
父节点
当前提交
0fa56e5ce2

+ 5 - 1
app/controller/patent/.patentchat.js

@@ -5,7 +5,9 @@ module.exports = {
       "sender_name",
       "!receiver_id",
       "receiver_name",
-      "!content",
+      "type",
+      "content",
+      "file",
     ],
   },
   destroy: {
@@ -19,7 +21,9 @@ module.exports = {
       "sender_name",
       "receiver_id",
       "receiver_name",
+      "type",
       "content",
+      "file",
       "is_read",
     ],
   },

+ 1 - 1
app/controller/patent/patentanalysis.js

@@ -3,7 +3,7 @@ const meta = require('./.patentanalysis.js');
 const Controller = require('egg').Controller;
 const { CrudController } = require('naf-framework-mongoose/lib/controller');
 
-// 专利分析-交底书
+// 查新检索-交底书
 class patentanalysisController extends Controller {
   constructor(ctx) {
     super(ctx);

+ 1 - 1
app/controller/patent/patentassess.js

@@ -3,7 +3,7 @@ const meta = require('./.patentassess.js');
 const Controller = require('egg').Controller;
 const { CrudController } = require('naf-framework-mongoose/lib/controller');
 
-// 专利评估表
+// 价值评估表
 class PatentassessController extends Controller {
   constructor(ctx) {
     super(ctx);

+ 1 - 1
app/model/patent/patentanalysis.js

@@ -3,7 +3,7 @@ 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 patentanalysis = {
   user_id: { type: ObjectId }, // 用户id
   admin_id: { type: ObjectId }, // 管理员id

+ 1 - 1
app/model/patent/patentapply.js

@@ -15,7 +15,7 @@ const patentapply = {
   name: { type: String }, // 发明名称
   apply_name: { type: String }, // 申请人
   type: { type: String }, // 申请类型
-  inventer: { type: Array }, // 发明人
+  inventor: { type: Array }, // 发明人
   contact: { type: Array }, // 联系人
   phone: { type: String }, // 联系人电话
   email: { type: String }, // 联系人邮箱

+ 1 - 1
app/model/patent/patentassess.js

@@ -3,7 +3,7 @@ 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 patentassess = {
   user_id: { type: ObjectId }, // 用户id
   admin_id: { type: ObjectId }, // 管理员id

+ 3 - 1
app/model/patent/patentchat.js

@@ -11,7 +11,9 @@ const patentchat = {
   sender_name: { type: String, required: false }, // 发送人名字
   receiver_id: { type: ObjectId, required: true }, // 接收人id
   receiver_name: { type: String, required: false }, // 接收人名字
-  content: { type: String, required: true }, // 内容
+  type: { type: String, required: false }, // 内容類型:1:内容,2:文件
+  content: { type: String, required: false }, // 内容
+  file: { type: Array }, // 文件
   is_read: { type: Boolean, default: false }, // 是否已读
   send_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
 };

+ 1 - 1
app/model/patent/patentinfo.js

@@ -10,7 +10,7 @@ const patentinfo = {
   success_number: { type: String, required: false }, // 公开(公告)号
   success_date: { type: String, required: false }, //  公开(公告)日
   name: { type: String, required: false }, // 标题
-  inventor: { type: String, required: false }, // 发明人
+  inventor: { type: Array }, // 发明人
   address: { type: String, required: false }, // 发明人地址
   apply_personal: { type: String, required: false }, // 申请人
   term: { type: String, required: false }, // 专利有效性

+ 2 - 2
app/router.js

@@ -83,8 +83,8 @@ module.exports = app => {
   require('./router/patent/patentnotice')(app); // 通知表
   require('./router/patent/patentapply')(app); // 专利申请表-审批单
   require('./router/patent/patentwarning')(app); // 专利申请预警表
-  require('./router/patent/patentanalysis')(app); // 专利分析表-交底单
-  require('./router/patent/patentassess')(app); // 专利评估表
+  require('./router/patent/patentanalysis')(app); // 查新检索表-交底单
+  require('./router/patent/patentassess')(app); // 价值评估表
   require('./router/patent/patentinfo')(app); // 专利信息表
   require('./router/patent/patentearly')(app); // 专利信息已授权专利预警表
   require('./router/patent/patenttrans')(app); // 专利交易表

+ 1 - 1
app/service/patent/patentanalysis.js

@@ -10,7 +10,7 @@ const Excel = require('exceljs');
 const { sep } = require('path');
 const fs = require('fs');
 
-// 专利分析表-交底单
+// 查新检索表-交底单
 class PatentanalysisService extends CrudService {
   constructor(ctx) {
     super(ctx, 'patentanalysis');

+ 6 - 6
app/service/patent/patentassess.js

@@ -10,7 +10,7 @@ const Excel = require('exceljs');
 const { sep } = require('path');
 const fs = require('fs');
 
-// 专利评估表
+// 价值评估表
 class PatentassessService extends CrudService {
   constructor(ctx) {
     super(ctx, 'patentassess');
@@ -18,7 +18,7 @@ class PatentassessService extends CrudService {
     this.notice = this.ctx.model.Patent.Patentexamine;
   }
   /**
-   * 专利分析审核
+   * 查新检索审核
    * @param {body} body 参数
    * @property id 数据id
    * @property status 交底书要改变成的状态
@@ -76,23 +76,23 @@ class PatentassessService extends CrudService {
     let to = '';
     switch (code) {
       case 'create':
-        content = `${patent_name}提交了专利评估的申报,请及时前往申请管理进行处理`;
+        content = `${patent_name}提交了价值评估的申报,请及时前往申请管理进行处理`;
         if (status === '0') {
           to = admin_id;
         }
         break;
       case 'update':
-        content = `${patent_name}重新提交了专利评估的申报,请及时前往申请管理进行处理`;
+        content = `${patent_name}重新提交了价值评估的申报,请及时前往申请管理进行处理`;
         if (status === '0') {
           to = admin_id;
         }
         break;
       case '-1':
-        content = `您的提交的专利评估【${patent_name}】未通过管理员的审核,请您及时修改,重新申请`;
+        content = `您的提交的价值评估【${patent_name}】未通过管理员的审核,请您及时修改,重新申请`;
         to = user_id;
         break;
       case '1':
-        content = `您的提交的专利评估【${patent_name}】通过了管理员的审核`;
+        content = `您的提交的价值评估【${patent_name}】通过了管理员的审核,系统管理员会在3-5个工作日发出价值评估报告,以供用户下载`;
         to = user_id;
         break;
       default:

+ 5 - 5
app/service/patent/patentinfo.js

@@ -58,17 +58,17 @@ class PatentinfoService extends CrudService {
       ];
       delete newquery.type;
     }
-    const { code, user_id } = newquery;
+    const { code, inventor } = newquery;
     let ids = [];
     if (code) {
       const plist = await this.personalModel.find({ code });
       ids = plist.map(i => i._id);
       if (ids.length > 0) {
-        newquery.user_id = { $elemMatch: { $in: ids } };
+        newquery.inventor = { $elemMatch: { $in: ids } };
         delete newquery.code;
       }
-    } else if (user_id) {
-      newquery.user_id = { $elemMatch: { $in: [ ObjectId(user_id) ] } };
+    } else if (inventor) {
+      newquery.inventor = { $elemMatch: { $in: [ ObjectId(inventor) ] } };
     }
 
     return newquery;
@@ -79,7 +79,7 @@ class PatentinfoService extends CrudService {
     let pids = await this.personalModel.find({ code }, { _id: 1 });
     if (pids.length <= 0) return { data: [], total: 0 };
     pids = pids.map(i => i._id);
-    const query = { user_id: { $elemMatch: { $in: pids } } };
+    const query = { inventor: { $elemMatch: { $in: pids } } };
     if (status) query.status = status;
     if (term) query.term = term;
     const data = await this.model

+ 1 - 1
app/service/patent/patentwarning.js

@@ -206,7 +206,7 @@ class PatentwarningService extends CrudService {
     if (_.get(patent, 'id'))object.patent_id = _.get(patent, 'id');
     if (_.get(patent, 'name'))object.patent_name = _.get(patent, 'name');
     // 找人的信息
-    let userIds = _.get(patent, 'user_id', _.get(patent, 'inventer'));
+    let userIds = _.get(patent, 'user_id', _.get(patent, 'inventor'));
     if (!userIds) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到专利的发明人');
     if (!_.isArray(userIds)) userIds = [ userIds ];
     userIds = userIds.map(i => ObjectId(i));