|
@@ -79,18 +79,14 @@ class StudentService extends CrudService {
|
|
}
|
|
}
|
|
let data = await this.model
|
|
let data = await this.model
|
|
.find(query)
|
|
.find(query)
|
|
- .populate([
|
|
|
|
- {
|
|
|
|
- path: 'classid',
|
|
|
|
- model: 'Class',
|
|
|
|
- select: 'name',
|
|
|
|
- },
|
|
|
|
- ])
|
|
|
|
.skip(parseInt(skip))
|
|
.skip(parseInt(skip))
|
|
.limit(parseInt(limit));
|
|
.limit(parseInt(limit));
|
|
const planids = _.uniq(data.map(i => ObjectId(i.planid)));
|
|
const planids = _.uniq(data.map(i => ObjectId(i.planid)));
|
|
const plan = await this.ctx.model.Trainplan.find({ _id: planids });
|
|
const plan = await this.ctx.model.Trainplan.find({ _id: planids });
|
|
data = JSON.parse(JSON.stringify(data));
|
|
data = JSON.parse(JSON.stringify(data));
|
|
|
|
+ for (const i of data) {
|
|
|
|
+ if (i.classid) { i.classid = await this.clamodel.findById(i.classid).lean(); }
|
|
|
|
+ }
|
|
data = data.map(i => {
|
|
data = data.map(i => {
|
|
if (i.classid && _.isObject(i.classid)) {
|
|
if (i.classid && _.isObject(i.classid)) {
|
|
i.classname = _.get(i.classid, 'name');
|
|
i.classname = _.get(i.classid, 'name');
|
|
@@ -98,13 +94,18 @@ class StudentService extends CrudService {
|
|
}
|
|
}
|
|
const p = plan.find(f => ObjectId(f._id).equals(i.planid));
|
|
const p = plan.find(f => ObjectId(f._id).equals(i.planid));
|
|
if (p) {
|
|
if (p) {
|
|
- const { termnum } = p;
|
|
|
|
|
|
+ const { termnum, title } = p;
|
|
|
|
+ i.plantitle = title;
|
|
const tr = termnum.id(i.termid);
|
|
const tr = termnum.id(i.termid);
|
|
if (tr) {
|
|
if (tr) {
|
|
i.termname = _.get(tr, 'term');
|
|
i.termname = _.get(tr, 'term');
|
|
const br = tr.batchnum.id(i.batchid);
|
|
const br = tr.batchnum.id(i.batchid);
|
|
if (br) {
|
|
if (br) {
|
|
i.batchname = _.get(br, 'batch');
|
|
i.batchname = _.get(br, 'batch');
|
|
|
|
+ const startDate = _.get(br, 'startdate');
|
|
|
|
+ if (startDate) {
|
|
|
|
+ i.insurance = moment(startDate).add(1, 'd').format('YYYY-MM-DD');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -485,55 +486,11 @@ class StudentService extends CrudService {
|
|
}
|
|
}
|
|
// 建立导出学生名单的任务
|
|
// 建立导出学生名单的任务
|
|
async toExport(body) {
|
|
async toExport(body) {
|
|
- const { planid, termid, batchid, classid } = body;
|
|
|
|
- const trainPlan = await this.ctx.model.Trainplan.findById(planid);
|
|
|
|
- let fn = '学生名单';
|
|
|
|
- if (termid && termid.length > 0) {
|
|
|
|
- if (classid) {
|
|
|
|
- const cla = await this.ctx.model.Class.findById(classid);
|
|
|
|
- if (cla) {
|
|
|
|
- const { name } = cla;
|
|
|
|
- if (name) {
|
|
|
|
- fn = `${name.includes('班') ? name : `${name}班`}${fn}`;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (termid.length === 1) {
|
|
|
|
- const tid = _.head(termid);
|
|
|
|
- const { termnum } = trainPlan;
|
|
|
|
- const t = termnum.id(tid);
|
|
|
|
- if (t) {
|
|
|
|
- const { term, batchnum } = t;
|
|
|
|
- if (batchid) {
|
|
|
|
- const b = batchnum.id(batchid);
|
|
|
|
- if (b) {
|
|
|
|
- const { batch } = b;
|
|
|
|
- if (b) fn = `第${batch}批${fn}`;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (term) fn = `第${term}期${fn}`;
|
|
|
|
- }
|
|
|
|
- } else if (termid.length > 1) {
|
|
|
|
- const { termnum } = trainPlan;
|
|
|
|
- let str = '第';
|
|
|
|
- for (const tid of termid) {
|
|
|
|
- const t = termnum.id(tid);
|
|
|
|
- if (t) {
|
|
|
|
- const { term } = t;
|
|
|
|
- str = `${str}${term} `;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- fn = `${str}期${fn}`;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- const { title } = trainPlan;
|
|
|
|
- fn = `${title}${fn}`;
|
|
|
|
- }
|
|
|
|
|
|
+ const fn = await this.toGetFn(body);
|
|
const data = {
|
|
const data = {
|
|
title: fn,
|
|
title: fn,
|
|
params: {
|
|
params: {
|
|
project: 'center',
|
|
project: 'center',
|
|
- // router: '/api/train/mission/student/export',
|
|
|
|
service: 'student',
|
|
service: 'student',
|
|
method: 'exportStudent',
|
|
method: 'exportStudent',
|
|
body,
|
|
body,
|
|
@@ -558,182 +515,216 @@ class StudentService extends CrudService {
|
|
}
|
|
}
|
|
// 导出学生
|
|
// 导出学生
|
|
async exportStudent(body) {
|
|
async exportStudent(body) {
|
|
- let { missionid, model, ...data } = body;
|
|
|
|
|
|
+ const limit = 50;
|
|
|
|
+ const { missionid, model, ...data } = body;
|
|
assert(missionid, '缺少任务信息,无法执行任务');
|
|
assert(missionid, '缺少任务信息,无法执行任务');
|
|
try {
|
|
try {
|
|
- // 整理model
|
|
|
|
- model = model.map(i => {
|
|
|
|
- const { zh, model } = i;
|
|
|
|
- if (zh && model) {
|
|
|
|
- const obj = {};
|
|
|
|
- obj.header = zh;
|
|
|
|
- if (model === 'termid') obj.key = 'termname';
|
|
|
|
- else if (model === 'batchid') obj.key = 'batchname';
|
|
|
|
- else if (model === 'classid') obj.key = 'classname';
|
|
|
|
- else obj.key = model;
|
|
|
|
- obj.width = 20;
|
|
|
|
|
|
+ // 整理表头+生成excel
|
|
|
|
+ const head = model.map(i => i.zh);
|
|
|
|
+ let fn = await this.toGetFn(data, missionid);
|
|
|
|
+ let dp = null;
|
|
|
|
+ const { downloadPath, fn: nfn } = await this.ctx.service.util.toAsyncExcel([ head ], fn, dp);
|
|
|
|
+ dp = downloadPath;
|
|
|
|
+ fn = nfn;
|
|
|
|
+ // 整理数据(分页循环)+写入excel
|
|
|
|
+ let skip = 0;
|
|
|
|
+ const { planid, termid = [], batchid = [], classid = [], isComming } = data;
|
|
|
|
+ const query = {};
|
|
|
|
+ if (classid.length > 0) query.classid = classid;
|
|
|
|
+ else if (batchid.length > 0) query.batchid = batchid;
|
|
|
|
+ else if (termid.length > 0) query.termid = termid;
|
|
|
|
+ else if (planid) query.planid = planid;
|
|
|
|
+ if (isComming === '0') query.isComming = '0';
|
|
|
|
+ else if (isComming !== '0')query.isComming = { $ne: '0' };
|
|
|
|
+ const total = await this.exportToGetTotal(query);
|
|
|
|
+ const times = Math.ceil(total / limit);
|
|
|
|
+ for (let i = 0; i < times; i++) {
|
|
|
|
+ let data = await this.query(query, { skip, limit });
|
|
|
|
+ if (data.length <= 0) break;
|
|
|
|
+ skip = skip + limit;
|
|
|
|
+ data = await this.exportDealData(data);
|
|
|
|
+ const dataList = data.map(i => {
|
|
|
|
+ const obj = [];
|
|
|
|
+ for (const m of model) {
|
|
|
|
+ obj.push(i[m.model]);
|
|
|
|
+ }
|
|
return obj;
|
|
return obj;
|
|
- }
|
|
|
|
- });
|
|
|
|
- model = _.compact(model);
|
|
|
|
- // 请求数据
|
|
|
|
- // 修改条件,termid变成数组了,需要一个一个查出来
|
|
|
|
- const { planid, termid, batchid, classid, isComming } = data;
|
|
|
|
- const queryObject = {};
|
|
|
|
- if (planid) queryObject.planid = planid;
|
|
|
|
- if (batchid) queryObject.batchid = batchid;
|
|
|
|
- if (classid) queryObject.classid = classid;
|
|
|
|
- if (isComming) {
|
|
|
|
- // 因为isComming有3种,0=>没来;1=>来了;2=>来了又退了.而已参培的类型应该是不为0,而不是单纯的1,只管来没来,不管走没走,毕竟吃饭了,得交钱
|
|
|
|
- if (isComming !== '0') queryObject.isComming = { $ne: '0' };
|
|
|
|
- else queryObject.isComming = isComming;
|
|
|
|
- }
|
|
|
|
- let studentList = [];
|
|
|
|
- console.log(queryObject);
|
|
|
|
- if (termid && termid.length > 0) {
|
|
|
|
- for (const t of termid) {
|
|
|
|
- queryObject.termid = t;
|
|
|
|
- const stuList = await this.query(queryObject);
|
|
|
|
- studentList.push(...stuList);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- studentList = await this.query(queryObject);
|
|
|
|
|
|
+ });
|
|
|
|
+ await this.ctx.service.util.toAsyncExcel(dataList, fn, dp);
|
|
|
|
+ const per = Math.ceil(((i + 1) / times) * 100);
|
|
|
|
+ this.ctx.service.util.updateProcess(missionid, per);
|
|
}
|
|
}
|
|
- console.log(studentList.length);
|
|
|
|
- // 获取学生,4分之1
|
|
|
|
- this.ctx.service.util.updateProcess(missionid, '25');
|
|
|
|
- console.log('学生导出=>25%');
|
|
|
|
- studentList = JSON.parse(JSON.stringify(studentList));
|
|
|
|
- let ids = studentList.map(i => i.classid);
|
|
|
|
- ids = _.uniq(ids);
|
|
|
|
- ids = _.compact(ids);
|
|
|
|
- ids = ids.map(i => ObjectId(i));
|
|
|
|
- const classList = await this.ctx.model.Class.find({
|
|
|
|
- _id: { $in: ids },
|
|
|
|
|
|
+ this.ctx.service.util.updateProcess(missionid, '100', '2', {
|
|
|
|
+ uri: dp,
|
|
});
|
|
});
|
|
- for (const stu of studentList) {
|
|
|
|
- // 转换是否参培
|
|
|
|
- const { classid, isComming } = stu;
|
|
|
|
- if (!classid) continue;
|
|
|
|
- const cla = await this.ctx.service.class.fetch({ id: classid });
|
|
|
|
- if (!cla) continue;
|
|
|
|
- const { startdate } = cla;
|
|
|
|
- if (!startdate) continue;
|
|
|
|
- stu.insurance = moment(startdate).add(1, 'd').format('YYYY-MM-DD');
|
|
|
|
- if (isComming) {
|
|
|
|
- if (isComming === '0') stu.isComming = '否';
|
|
|
|
- else if (isComming === '1') stu.isComming = '是';
|
|
|
|
- else if (isComming === '2') stu.isComming = '退出';
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 整理完数据,4分之2
|
|
|
|
- this.ctx.service.util.updateProcess(missionid, '50');
|
|
|
|
- console.log('学生导出=>50%');
|
|
|
|
- let fn = '学生名单';
|
|
|
|
- // 因为是递进下来, batchid和classid并列,并非递进
|
|
|
|
- // 获取fn
|
|
|
|
- if (classid) {
|
|
|
|
- // 文件名称: 期, 班
|
|
|
|
- // 班级名上面有直接拽来
|
|
|
|
- const cla = classList.find(f => ObjectId(classid).equals(f._id));
|
|
|
|
- if (cla) {
|
|
|
|
- const { name, termid } = cla;
|
|
|
|
- if (name) fn = `${name.includes('班') ? name : `${name}班`}${fn}`;
|
|
|
|
- if (termid) {
|
|
|
|
- const obj = await this.toGetFn(termid);
|
|
|
|
- if (obj) {
|
|
|
|
- const { term } = obj;
|
|
|
|
- fn = `第${term}期${fn}`;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else if (batchid) {
|
|
|
|
- // 文件名称,期,批
|
|
|
|
- const tid = _.head(termid);
|
|
|
|
- const obj = await this.toGetFn(tid, batchid);
|
|
|
|
- if (obj) {
|
|
|
|
- const { term, batch } = obj;
|
|
|
|
- if (batch) fn = `第${batch}批${fn}`;
|
|
|
|
- if (term) fn = `第${term}期${fn}`;
|
|
|
|
- }
|
|
|
|
- } else if (termid) {
|
|
|
|
- // 文件名称: 期
|
|
|
|
- if (termid.length === 1) {
|
|
|
|
- const obj = await this.toGetFn(_.head(termid));
|
|
|
|
- if (obj) {
|
|
|
|
- const { term } = obj;
|
|
|
|
- if (term) fn = `第${term}期${fn}`;
|
|
|
|
- }
|
|
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
|
|
+ this.ctx.service.util.updateProcess(missionid, undefined, '3');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 处理数据
|
|
|
|
+ async exportDealData(data) {
|
|
|
|
+ const changeList = [
|
|
|
|
+ {
|
|
|
|
+ model: 'is_fine',
|
|
|
|
+ options: [
|
|
|
|
+ { value: '0', to: '否' },
|
|
|
|
+ { value: '1', to: '是' },
|
|
|
|
+ { value: '2', to: '无资格' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'isComming',
|
|
|
|
+ options: [
|
|
|
|
+ { value: '0', to: '未报到' },
|
|
|
|
+ { value: '1', to: '已报到' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'family_is_hard',
|
|
|
|
+ options: [
|
|
|
|
+ { value: '0', to: '否' },
|
|
|
|
+ { value: '1', to: '是' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'have_grant',
|
|
|
|
+ options: [
|
|
|
|
+ { value: '0', to: '否' },
|
|
|
|
+ { value: '1', to: '是' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'type',
|
|
|
|
+ options: [
|
|
|
|
+ { value: '0', to: '正常' },
|
|
|
|
+ { value: '1', to: '特殊' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'status',
|
|
|
|
+ options: [
|
|
|
|
+ { value: '0', to: '待确定' },
|
|
|
|
+ { value: '1', to: '确定' },
|
|
|
|
+ { value: '2', to: '失败' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'cert',
|
|
|
|
+ options: [
|
|
|
|
+ { value: '0', to: '未打印' },
|
|
|
|
+ { value: '1', to: '已打印' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'schid',
|
|
|
|
+ type: 'get',
|
|
|
|
+ format: i => i.school_name,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'termid',
|
|
|
|
+ type: 'get',
|
|
|
|
+ format: i => i.termname,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'batchid',
|
|
|
|
+ type: 'get',
|
|
|
|
+ format: i => i.batchname,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'classid',
|
|
|
|
+ type: 'get',
|
|
|
|
+ format: i => i.classname,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ model: 'bedroomid',
|
|
|
|
+ type: 'get',
|
|
|
|
+ format: i => i.bedroom,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ // 需要请求的数据, 学校数据
|
|
|
|
+ for (const i of data) {
|
|
|
|
+ for (const m of changeList) {
|
|
|
|
+ const { model, options, type, format } = m;
|
|
|
|
+ if (type === 'get') {
|
|
|
|
+ // 请求转换
|
|
|
|
+ i[model] = format(i);
|
|
} else {
|
|
} else {
|
|
- let tStr = '';
|
|
|
|
- for (let i = 0; i < termid.length; i++) {
|
|
|
|
- const tid = termid[i];
|
|
|
|
- const obj = await this.toGetFn(tid);
|
|
|
|
- if (obj) {
|
|
|
|
- const { term } = obj;
|
|
|
|
- if (term) {
|
|
|
|
- if (i === 0) {
|
|
|
|
- tStr += `${term}期`;
|
|
|
|
- } else {
|
|
|
|
- tStr += `,${term}期`;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // 字典转换
|
|
|
|
+ const v = _.get(i, model);
|
|
|
|
+ if (!v) {
|
|
|
|
+ // 没有默认第一个
|
|
|
|
+ const option = _.head(options);
|
|
|
|
+ i[model] = option.to;
|
|
|
|
+ } else {
|
|
|
|
+ const option = options.find(f => f.value === v);
|
|
|
|
+ if (option) i[model] = option.to;
|
|
|
|
+ else {
|
|
|
|
+ // 没有默认第一个
|
|
|
|
+ const option = _.head(options);
|
|
|
|
+ i[model] = option.to;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- fn = `${tStr}${fn}`;
|
|
|
|
- }
|
|
|
|
- } else if (planid) {
|
|
|
|
- // 文件名称:该计划标题
|
|
|
|
- const trainPlan = await this.ctx.model.Trainplan.findById(planid);
|
|
|
|
- if (trainPlan) {
|
|
|
|
- const { title } = trainPlan;
|
|
|
|
- if (title) fn = `${title}${fn}`;
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
- // 获取文件名,60%
|
|
|
|
- this.ctx.service.util.updateProcess(missionid, '60');
|
|
|
|
- console.log('学生导出=>60%');
|
|
|
|
- const res = await this.ctx.service.util.toExcel(studentList, model, fn);
|
|
|
|
- if (!res) {
|
|
|
|
- console.error(
|
|
|
|
- `${moment().format('YYYY-MM-DD HH:SS:mm')} ${fn} 导出失败`
|
|
|
|
- );
|
|
|
|
- throw new BusinessError(ErrorCode.SERVICE_FAULT, `${fn}导出失败`);
|
|
|
|
- }
|
|
|
|
- this.ctx.service.util.updateProcess(missionid, '100', '2', {
|
|
|
|
- uri: res,
|
|
|
|
- });
|
|
|
|
- console.log('学生导出=>100%');
|
|
|
|
- } catch (error) {
|
|
|
|
- this.ctx.service.util.updateProcess(missionid, undefined, '3');
|
|
|
|
}
|
|
}
|
|
|
|
+ return data;
|
|
}
|
|
}
|
|
|
|
+ // 导出,获取总数,分页处理
|
|
|
|
+ async exportToGetTotal(query) {
|
|
|
|
+ const total = await this.model.count(query);
|
|
|
|
+ // const { planid, termid = [], batchid = [], classid = [], isComming } = data;
|
|
|
|
+ // if (classid.length > 0) total = await this.model.count({ classid });
|
|
|
|
+ // else if (batchid.length > 0) total = await this.model.count({ batchid });
|
|
|
|
+ // else if (termid.length > 0) total = await this.model.count({ termid });
|
|
|
|
+ // else if (planid) total = await this.model.count({ planid });
|
|
|
|
|
|
- async toGetFn(termid, batchid) {
|
|
|
|
- const trainPlan = await this.ctx.model.Trainplan.findOne({
|
|
|
|
- 'termnum._id': ObjectId(termid),
|
|
|
|
- });
|
|
|
|
- if (!trainPlan) {
|
|
|
|
- throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到年度计划信息');
|
|
|
|
- }
|
|
|
|
- const { termnum } = trainPlan;
|
|
|
|
- if (!termnum) {
|
|
|
|
- throw new BusinessError(
|
|
|
|
- ErrorCode.DATA_NOT_EXIST,
|
|
|
|
- '未找到年度计划的期信息'
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- const obj = {};
|
|
|
|
- if (termid) {
|
|
|
|
- const term = termnum.id(termid);
|
|
|
|
- if (term) obj.term = term.term;
|
|
|
|
- if (batchid) {
|
|
|
|
- const { batchnum } = term;
|
|
|
|
- const batch = batchnum.id(batchid);
|
|
|
|
- if (batch) obj.batch = batch.batch;
|
|
|
|
|
|
+ return total;
|
|
|
|
+ }
|
|
|
|
+ // 导出,获取文件名
|
|
|
|
+ async toGetFn(data, missionid) {
|
|
|
|
+ const { planid, termid = [], batchid = [], classid = [] } = data;
|
|
|
|
+ let fn = '学生名单';
|
|
|
|
+ const fnList = [];
|
|
|
|
+ // 如果有班级id,直接用班级id查,然后拼接导出文件名;第x期-第x批-第x班;第x期-第x批-第x班...学生名单
|
|
|
|
+ if (classid.length > 0) {
|
|
|
|
+ for (const cid of classid) {
|
|
|
|
+ const cla = await this.ctx.service.class.fetch({ id: cid });
|
|
|
|
+ if (cla) fnList.push(`第${cla.term}期-第${cla.batch}批-${cla.name}班`);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 如果没有年度计划id,那就是全库学生导出
|
|
|
|
+ if (!planid) return fn;
|
|
|
|
+ const trainPlan = await this.ctx.model.Trainplan.findById(planid);
|
|
|
|
+ if (!trainPlan) {
|
|
|
|
+ if (missionid) this.ctx.service.util.updateProcess(missionid, '0', '3');
|
|
|
|
+ throw new BusinessError(ErrorCode.SERVICE_FAULT, '学生导出,查询计划失败');
|
|
|
|
+ }
|
|
|
|
+ if (termid.length > 0) {
|
|
|
|
+ for (const tid of termid) {
|
|
|
|
+ const { termnum = [] } = trainPlan;
|
|
|
|
+ const term = termnum.id(tid);
|
|
|
|
+ if (!term) continue;
|
|
|
|
+ if (batchid.length > 0) {
|
|
|
|
+ // 先看批次: 第x期-第x批;第x期-第x批....学生名单
|
|
|
|
+ const { batchnum = [] } = term;
|
|
|
|
+ for (const bid of batchid) {
|
|
|
|
+ const batch = batchnum.id(bid);
|
|
|
|
+ if (batch) fnList.push(`第${term.term}期-第${batch.batch}批`);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 只有期:第x期;第x期...学生名单
|
|
|
|
+ fnList.push(`第${term.term}期`);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 只有计划id: xxx计划学生名单
|
|
|
|
+ fnList.push(trainPlan.title);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return obj;
|
|
|
|
|
|
+ fn = `${fnList.join(';')}${fn}`;
|
|
|
|
+ return fn;
|
|
}
|
|
}
|
|
|
|
|
|
// 确认学生打印证书
|
|
// 确认学生打印证书
|
|
@@ -754,18 +745,6 @@ class StudentService extends CrudService {
|
|
]);
|
|
]);
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
-
|
|
|
|
- // excel导出表头设置
|
|
|
|
- metaBx(type) {
|
|
|
|
- const header = [
|
|
|
|
- {
|
|
|
|
- header: '姓名',
|
|
|
|
- key: 'name',
|
|
|
|
- width: 20,
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
- return header;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
module.exports = StudentService;
|
|
module.exports = StudentService;
|