|
|
@@ -381,8 +381,8 @@ export class StatisticsService {
|
|
|
}> {
|
|
|
const { year, month } = query;
|
|
|
const now = new Date();
|
|
|
- const _targetYear = year ?? now.getFullYear();
|
|
|
- const _targetMonth = month ?? now.getMonth() + 1;
|
|
|
+ const targetYear = year ?? now.getFullYear();
|
|
|
+ const targetMonth = month ?? now.getMonth() + 1;
|
|
|
|
|
|
// 计算上个月
|
|
|
const previousDate = new Date(targetYear, targetMonth - 2, 1);
|
|
|
@@ -394,8 +394,8 @@ export class StatisticsService {
|
|
|
const _endDate = new Date(targetYear, targetMonth, 0, 23, 59, 59);
|
|
|
|
|
|
// 构建日期范围(上月)
|
|
|
- const _previousStartDate = new Date(previousYear, previousMonth - 1, 1);
|
|
|
- const _previousEndDate = new Date(previousYear, previousMonth, 0, 23, 59, 59);
|
|
|
+ const _previousStartDate = new Date(_previousYear, _previousMonth - 1, 1);
|
|
|
+ const _previousEndDate = new Date(_previousYear, _previousMonth, 0, 23, 59, 59);
|
|
|
|
|
|
// 获取在职人员(jobStatus = 1)
|
|
|
const personIds = await this.getCompanyDisabledPersonIds(companyId);
|
|
|
@@ -441,8 +441,8 @@ export class StatisticsService {
|
|
|
}> {
|
|
|
const { year, month } = query;
|
|
|
const now = new Date();
|
|
|
- const _targetYear = year ?? now.getFullYear();
|
|
|
- const _targetMonth = month ?? now.getMonth() + 1;
|
|
|
+ const targetYear = year ?? now.getFullYear();
|
|
|
+ const targetMonth = month ?? now.getMonth() + 1;
|
|
|
|
|
|
// 计算上个月
|
|
|
const previousDate = new Date(targetYear, targetMonth - 2, 1);
|
|
|
@@ -551,8 +551,8 @@ export class StatisticsService {
|
|
|
}> {
|
|
|
const { year, month } = query;
|
|
|
const now = new Date();
|
|
|
- const _targetYear = year ?? now.getFullYear();
|
|
|
- const _targetMonth = month ?? now.getMonth() + 1;
|
|
|
+ const targetYear = year ?? now.getFullYear();
|
|
|
+ const targetMonth = month ?? now.getMonth() + 1;
|
|
|
|
|
|
// 计算上个月
|
|
|
const previousDate = new Date(targetYear, targetMonth - 2, 1);
|
|
|
@@ -560,12 +560,12 @@ export class StatisticsService {
|
|
|
const _previousMonth = previousDate.getMonth() + 1;
|
|
|
|
|
|
// 构建日期范围(当月)
|
|
|
- const _startDate = new Date(targetYear, targetMonth - 1, 1);
|
|
|
- const _endDate = new Date(targetYear, targetMonth, 0, 23, 59, 59);
|
|
|
+ const startDate = new Date(targetYear, targetMonth - 1, 1);
|
|
|
+ const endDate = new Date(targetYear, targetMonth, 0, 23, 59, 59);
|
|
|
|
|
|
// 构建日期范围(上月)
|
|
|
- const _previousStartDate = new Date(previousYear, previousMonth - 1, 1);
|
|
|
- const _previousEndDate = new Date(previousYear, previousMonth, 0, 23, 59, 59);
|
|
|
+ const previousStartDate = new Date(_previousYear, _previousMonth - 1, 1);
|
|
|
+ const previousEndDate = new Date(_previousYear, _previousMonth, 0, 23, 59, 59);
|
|
|
|
|
|
// 获取当月新增人数(通过订单创建时间)
|
|
|
const currentCount = await this.employmentOrderRepository
|