|
@@ -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;
|
|
|
}
|