49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
|
|
const fs = require('fs');
|
|||
|
|
const data = JSON.parse(fs.readFileSync('src/data/financeCalendar.json'));
|
|||
|
|
|
|||
|
|
// 查找同一天有多个相同类型课程的日期
|
|||
|
|
const dateMap = {};
|
|||
|
|
|
|||
|
|
data.forEach(course => {
|
|||
|
|
const date = course['日期'];
|
|||
|
|
const type = course['课程阶段(公共课)'];
|
|||
|
|
|
|||
|
|
if (type === '终生学习系统' || type === '营销能力课') {
|
|||
|
|
if (!dateMap[date]) {
|
|||
|
|
dateMap[date] = [];
|
|||
|
|
}
|
|||
|
|
dateMap[date].push({
|
|||
|
|
name: course['公共课'],
|
|||
|
|
type: type,
|
|||
|
|
time: course['上课时间']
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
// 找出有重复的日期
|
|||
|
|
console.log('检查AI课程和营销能力课是否有重复:\n');
|
|||
|
|
let hasDuplicate = false;
|
|||
|
|
|
|||
|
|
Object.keys(dateMap).forEach(date => {
|
|||
|
|
const courses = dateMap[date];
|
|||
|
|
if (courses.length > 1) {
|
|||
|
|
hasDuplicate = true;
|
|||
|
|
console.log('日期: ' + date);
|
|||
|
|
courses.forEach(c => {
|
|||
|
|
console.log(' - ' + c.type + ': ' + c.name + ' (' + c.time + ')');
|
|||
|
|
});
|
|||
|
|
console.log('');
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
if (!hasDuplicate) {
|
|||
|
|
console.log('没有发现同一天有多个AI课程或营销能力课');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 统计总数
|
|||
|
|
const aiCourses = data.filter(c => c['课程阶段(公共课)'] === '终生学习系统');
|
|||
|
|
const marketingCourses = data.filter(c => c['课程阶段(公共课)'] === '营销能力课');
|
|||
|
|
|
|||
|
|
console.log('\n统计信息:');
|
|||
|
|
console.log('AI课程(终生学习系统)总数:', aiCourses.length);
|
|||
|
|
console.log('营销能力课总数:', marketingCourses.length);
|