Browse Source

大会信访总量统计接口增加获取大会时间功能,增加职能单位仅仅导出本单位接谈记录功能;
大会事项列表查询增加获取大会时间功能,增加职能单位只显示本单位数据功能

summerGeGe 1 year ago
parent
commit
37b4e4e4f1
3 changed files with 34 additions and 8 deletions
  1. 15 3
      src/controller/meeting/person.js
  2. 19 3
      src/controller/meeting/talking.js
  3. 0 2
      src/controller/taskFlow.js

+ 15 - 3
src/controller/meeting/person.js

@@ -200,16 +200,20 @@ module.exports = class extends Base {
   // 信访总量统计
   async getActivityAction(){
     let data = this.post();
+    let userInfo = await this.getUserInfo(data.userId);
     let startTime = moment('2022-01-01').format('YYYY-MM-DD');
     let endTime = moment('2099-12-31').add(1,'day').format('YYYY-MM-DD');
-    // let startTime = moment('2021-01-25').format('YYYY-MM-DD');
-    // let endTime = moment('2021-02-01').add(1,'day').format('YYYY-MM-DD');
     if (typeof data.startTime !== 'undefined' && data.startTime !== ''){
       startTime = moment(data.startTime).format('YYYY-MM-DD HH:mm:ss');
     }
     if (typeof data.endTime !== 'undefined' && data.endTime !== ''){
       endTime = moment(data.endTime).add(1,'day').format('YYYY-MM-DD HH:mm:ss');
     }
+    let session = await this.model('meeting_session').where({'id':userInfo.meetingID}).find();
+    if (!think.isEmpty(session)) {
+      startTime = moment(session.startTime).format('YYYY-MM-DD');
+      endTime = moment(session.endTime).add(1,'day').format('YYYY-MM-DD');
+    }
     let back = [];
     // let activityWhere = {'createTime':['BETWEEN', startTime, endTime],'isMeeting':0};
     let activityWhere = {'isMeeting':0,'mainPerson':['!=',null],'createTime':['BETWEEN', startTime, endTime]};
@@ -278,7 +282,15 @@ module.exports = class extends Base {
     for (let a of activity){
       // 接谈室叫号id,表queue
       // let sql = await this.model('queue').order('createTime desc').limit(1).buildSelectSql();
-      let matter = await this.model('matter').setRelation(false).where({'matter.activityID':a.id}).select();
+      // let matter = await this.model('matter').setRelation(false).where({'matter.activityID':a.id}).select();
+      let matter;
+      if(userInfo.isRenDa !== 1){
+        //非人大单位,即为职能单位,仅查询本单位接谈情况
+        matter = await this.model('matter').setRelation(false).join('talking_handle as th on th.matterID = matter.id')
+          .where({'matter.activityID':a.id,'th.roomOrgID':userInfo.orgID}).select();
+      }else {
+        matter = await this.model('matter').setRelation(false).where({'matter.activityID':a.id}).select();
+      }
       if (think.isEmpty(matter)){
         continue;
       }

+ 19 - 3
src/controller/meeting/talking.js

@@ -241,6 +241,12 @@ module.exports = class extends Base {
     // 默认查询当天
     let startTime = moment().format('YYYY-MM-DD');
     let endTime = moment().add(1,'day').format('YYYY-MM-DD');
+    // 如果能匹配到大会届次
+    let session = await this.model('meeting_session').where({'id':userInfo.meetingID}).find();
+    if (!think.isEmpty(session)) {
+      startTime = moment(session.startTime).format('YYYY-MM-DD');
+      endTime = moment(session.endTime).add(1,'day').format('YYYY-MM-DD');
+    }
     // let startTime = moment('2022-07-05').format('YYYY-MM-DD');
     // let endTime = moment('2022-07-08').add(1,'day').format('YYYY-MM-DD');
     if (typeof data.startTime !== 'undefined' && data.startTime !== ''){
@@ -253,9 +259,19 @@ module.exports = class extends Base {
     if (data.hasOwnProperty('registerTypeID') && Array.isArray(data.registerTypeID) && data.registerTypeID.length > 0) {
       where['a.registerTypeID'] = ['IN',data.registerTypeID];// 信访形式
     }
-    let matter = await this.model('matter').alias('m').join('activity as a on a.id = m.activityID')
-      .where(where).page(data.page, data.limit).order('m.createTime DESC').field('m.*').countSelect();
-    matter = JSON.parse(JSON.stringify(matter));
+    let matter;
+    if(userInfo.isRenDa !== 1){
+      //非人大单位,即为职能单位,仅查询本单位接谈情况
+      where['th.roomOrgID'] = userInfo.orgID;
+      matter = await this.model('matter').alias('m').join('activity as a on a.id = m.activityID')
+        .join('talking_handle as th on th.matterID = m.id')
+        .where(where).page(data.page, data.limit).order('m.createTime DESC').field('m.*').countSelect();
+      matter = JSON.parse(JSON.stringify(matter));
+    }else {
+      matter = await this.model('matter').alias('m').join('activity as a on a.id = m.activityID')
+        .where(where).page(data.page, data.limit).order('m.createTime DESC').field('m.*').countSelect();
+      matter = JSON.parse(JSON.stringify(matter));
+    }
     for (let m of matter.data){
       let handle = await this.model('talking_handle').where({'matterID':m.id}).order('createTime DESC').find()
       m['handle'] = handle

+ 0 - 2
src/controller/taskFlow.js

@@ -639,7 +639,6 @@ module.exports = class extends Base {
     } else if (data.forward === 1){//后退
       // 后退流程
       nextActID = await httpRequest('post','http://localhost:8360/flow/service/taskBackward',param);
-      console.log(nextActID)
       if (nextActID.errno !== 0 ){
         return this.fail(nextActID)
       }
@@ -921,7 +920,6 @@ module.exports = class extends Base {
     let userInfo = await this.getUserInfo(data.userId);
     let matter = await this.model('matter').alias('m').setRelation(false).where({'m.id':data.matterID})
       .join('history as h on h.taskId = m.taskid').field('m.*,h.time,h.businessID').select();
-    console.log(matter)
     let xfr = await this.model('person').alias('p').setRelation(false).join('activity as a on a.mainPerson = p.id')
       .where({'a.id':matter[0].activityID}).field("p.name").find();
     let time = moment(matter[0].createTime).add(60,'days').format('YYYY年M月D日');