|
@@ -134,7 +134,10 @@ class IndexService extends CrudService {
|
|
|
value: organization,
|
|
|
});
|
|
|
// TODO:如果需要专家和个人用户区分开,则is_expert:false, 混查则不需要is_expert条件
|
|
|
- const user = await this.personalModel.count({ status: '1', is_expert: false });
|
|
|
+ const user = await this.personalModel.count({
|
|
|
+ status: '1',
|
|
|
+ is_expert: false,
|
|
|
+ });
|
|
|
arr.push({
|
|
|
name: '个人注册数量',
|
|
|
value: user,
|
|
@@ -165,20 +168,31 @@ class IndexService extends CrudService {
|
|
|
]);
|
|
|
arr.push({
|
|
|
name: '正在洽谈',
|
|
|
- value: _.get(trans.find(f => f._id === '0'), 'value', 0),
|
|
|
+ value: _.get(
|
|
|
+ trans.find(f => f._id === '0'),
|
|
|
+ 'value',
|
|
|
+ 0
|
|
|
+ ),
|
|
|
});
|
|
|
arr.push({
|
|
|
name: '达成意向',
|
|
|
- value: _.get(trans.find(f => f._id === '1'), 'value', 0),
|
|
|
+ value: _.get(
|
|
|
+ trans.find(f => f._id === '1'),
|
|
|
+ 'value',
|
|
|
+ 0
|
|
|
+ ),
|
|
|
});
|
|
|
arr.push({
|
|
|
name: '对接完成',
|
|
|
- value: _.get(trans.find(f => f._id === '3'), 'value', 0),
|
|
|
+ value: _.get(
|
|
|
+ trans.find(f => f._id === '3'),
|
|
|
+ 'value',
|
|
|
+ 0
|
|
|
+ ),
|
|
|
});
|
|
|
return arr;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 专家列表
|
|
|
*/
|
|
@@ -230,12 +244,29 @@ class IndexService extends CrudService {
|
|
|
},
|
|
|
},
|
|
|
]);
|
|
|
- const qthz = _.get(trans.find(f => f._id === '0'), 'value', 0);
|
|
|
- const dcyx = _.get(trans.find(f => f._id === '1'), 'value', 0);
|
|
|
- const jywc = _.get(trans.find(f => f._id === '3'), 'value', 0);
|
|
|
+ const qthz = _.get(
|
|
|
+ trans.find(f => f._id === '0'),
|
|
|
+ 'value',
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ const dcyx = _.get(
|
|
|
+ trans.find(f => f._id === '1'),
|
|
|
+ 'value',
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ const jywc = _.get(
|
|
|
+ trans.find(f => f._id === '3'),
|
|
|
+ 'value',
|
|
|
+ 0
|
|
|
+ );
|
|
|
// 参展项目
|
|
|
- const res = await this.dockUser.aggregate()
|
|
|
- .match({ dock_id: ObjectId(dock_id), 'goodsList.type': '1', 'goodsList.dockStatus': '1' })
|
|
|
+ const res = await this.dockUser
|
|
|
+ .aggregate()
|
|
|
+ .match({
|
|
|
+ dock_id: ObjectId(dock_id),
|
|
|
+ 'goodsList.type': '1',
|
|
|
+ 'goodsList.dockStatus': '1',
|
|
|
+ })
|
|
|
.unwind('$goodsList')
|
|
|
.group({
|
|
|
_id: '$dock_id',
|
|
@@ -251,42 +282,38 @@ class IndexService extends CrudService {
|
|
|
{ name: '参展项目', num: czxm, unit: '项' },
|
|
|
];
|
|
|
return arr;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 高企服务政策申请统计
|
|
|
+ * 创新券订单/研发补贴,奖励兑现订单, 兑付成功(status=='1')
|
|
|
*/
|
|
|
async pac() {
|
|
|
- const res = await this.ctx.model.PolicyApply.aggregate([
|
|
|
+ // 创新券兑付成功的数量
|
|
|
+ const cres = await this.ctx.model.Cashing.count({ status: '1' });
|
|
|
+ // 研发/奖励
|
|
|
+ const rres = await this.ctx.model.RewardOrder.aggregate([
|
|
|
+ { $match: { status: '1' } },
|
|
|
{
|
|
|
- $lookup: {
|
|
|
- from: 'policy',
|
|
|
- localField: 'policy_id',
|
|
|
- foreignField: '_id',
|
|
|
- as: 'policy',
|
|
|
+ $group: {
|
|
|
+ _id: '$type',
|
|
|
+ count: { $sum: 1 },
|
|
|
},
|
|
|
},
|
|
|
- { $unwind: '$policy' },
|
|
|
- { $group: {
|
|
|
- _id: '$policy.type',
|
|
|
- count: { $sum: 1 },
|
|
|
- } },
|
|
|
]);
|
|
|
const arr = [
|
|
|
{ key: '奖励兑现', name: '奖励兑现' },
|
|
|
- { key: '创新券', name: '创新券' },
|
|
|
{ key: '研发补贴', name: '研发补贴' },
|
|
|
];
|
|
|
- const obj = this.setData(res, arr);
|
|
|
+ const obj = this.setData(rres, arr);
|
|
|
+ obj.push({ name: '创新券', value: cres });
|
|
|
return obj;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 高企申报个步骤统计
|
|
|
*/
|
|
|
- async ticket() {
|
|
|
- const res = await this.ctx.model.Ticket.aggregate([
|
|
|
+ async declare() {
|
|
|
+ const res = await this.ctx.model.Declare.aggregate([
|
|
|
{ $group: {
|
|
|
_id: '$status',
|
|
|
count: { $sum: 1 },
|
|
@@ -297,6 +324,7 @@ class IndexService extends CrudService {
|
|
|
{ key: '1', name: '企业信息审核成功' },
|
|
|
{ key: '-1', name: '企业信息审核失败' },
|
|
|
{ key: '2', name: '高企申报成功' },
|
|
|
+ { key: '-2', name: '高企申报失败' },
|
|
|
];
|
|
|
const obj = this.setData(res, arr);
|
|
|
return obj;
|