|
@@ -236,6 +236,7 @@ export class textbookServer {
|
|
|
|
|
|
|
|
|
async getUnitList() {
|
|
|
+ let unitMap:any = {}
|
|
|
let unitList = new Set<string>();
|
|
|
let query = new Parse.Query('EduTextbook');
|
|
|
query.equalTo('status', '400');
|
|
@@ -243,15 +244,23 @@ export class textbookServer {
|
|
|
query.notEqualTo('discard', true);
|
|
|
query.include('user.phone', 'childrens.editionUnit');
|
|
|
query.select('user.phone', 'childrens.editionUnit')
|
|
|
- query.limit(1000);
|
|
|
+ query.limit(10000);
|
|
|
let r = await query.find();
|
|
|
r.forEach((item) => {
|
|
|
item
|
|
|
.get('childrens')
|
|
|
- ?.forEach((child: any) => unitList.add(child?.get('editionUnit')));
|
|
|
+ ?.forEach((child: any) =>{
|
|
|
+ if(!child?.get('editionUnit')){
|
|
|
+ console.log(item);
|
|
|
+ }
|
|
|
+ unitList.add(child?.get('editionUnit'))
|
|
|
+ unitMap[child?.get('editionUnit')] = unitMap[child?.get('editionUnit')] ? unitMap[child?.get('editionUnit')]+1 : 1
|
|
|
+ });
|
|
|
});
|
|
|
let unitArr = Array.from(unitList);
|
|
|
console.log('已被选择的申报单位:',unitArr);
|
|
|
+ console.log(unitMap);
|
|
|
+
|
|
|
let queryParams: any = {
|
|
|
where: {
|
|
|
$or: [
|
|
@@ -271,7 +280,7 @@ export class textbookServer {
|
|
|
let queryEduProcess = Parse.Query.fromJSON('EduProcess', queryParams);
|
|
|
queryEduProcess.include('profileSubmitted.user');
|
|
|
queryEduProcess.select('profileSubmitted.user.phone','name')
|
|
|
- query.limit(1000)
|
|
|
+ queryEduProcess.limit(1000)
|
|
|
let list = await queryEduProcess.find();
|
|
|
|
|
|
let unitPhoneList = new Set<string>();
|
|
@@ -292,7 +301,9 @@ export class textbookServer {
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>已注册</th>
|
|
|
+ <th>教材数量</th>
|
|
|
<th>未注册</th>
|
|
|
+ <th>教材数量</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
@@ -305,10 +316,18 @@ export class textbookServer {
|
|
|
_body += `${a[row] || ''}`;
|
|
|
_body += '</td>';
|
|
|
|
|
|
+ _body += '<td>';
|
|
|
+ _body += `${unitMap[a[row]] || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
_body += '<td>';
|
|
|
_body += ` ${b[row] || ''}`;
|
|
|
_body += '</td>';
|
|
|
|
|
|
+ _body += '<td>';
|
|
|
+ _body += `${unitMap[b[row]] || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
_body += '</tr>';
|
|
|
}
|
|
|
table += _body;
|
|
@@ -317,6 +336,64 @@ export class textbookServer {
|
|
|
let title = '出版社';
|
|
|
this.excel(table, `${title}.xls`);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ async getGdjy(){
|
|
|
+ let query = new Parse.Query('EduTextbook');
|
|
|
+ query.equalTo('status', '400');
|
|
|
+ query.notEqualTo('isDeleted', true);
|
|
|
+ query.notEqualTo('discard', true);
|
|
|
+ query.include('user');
|
|
|
+
|
|
|
+ query.limit(2000);
|
|
|
+ query.equalTo('title','高等教育出版社')
|
|
|
+ let data = await query.find()
|
|
|
+ console.log(data);
|
|
|
+ let table = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>教材名称</th>
|
|
|
+ <th>申报编号</th>
|
|
|
+ <th>用户名</th>
|
|
|
+ <th>手机号</th>
|
|
|
+ <th>专业类</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ `;
|
|
|
+
|
|
|
+ let _body = '';
|
|
|
+ for (var row = 0; row < data.length; row++) {
|
|
|
+ _body += '<tr>';
|
|
|
+ _body += '<td>';
|
|
|
+ _body += `${data[row]?.get('title') || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
+ _body += '<td>';
|
|
|
+ _body += `${data[row]?.get('code') || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
+ _body += '<td>';
|
|
|
+ _body += `${data[row]?.get('user')?.get('name') || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
+ _body += '<td>';
|
|
|
+ _body += `${data[row]?.get('user')?.get('phone') || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
+ _body += '<td>';
|
|
|
+ _body += `${(data[row]?.get('discipline')?.code + '/'+ data[row]?.get('discipline')?.name) || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
+ _body += '</tr>';
|
|
|
+ }
|
|
|
+ table += _body;
|
|
|
+ table += '</tbody>';
|
|
|
+ table += '</table>';
|
|
|
+ let title = '高等教育出版社';
|
|
|
+ this.excel(table, `${title}.xls`);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
fromatFiled(list: Array<Parse.Object>, filed: string): string {
|
|
|
let arr: Array<string | null> = [];
|
|
@@ -520,7 +597,7 @@ export class textbookServer {
|
|
|
query.notEqualTo('discard', true);
|
|
|
query.include('user.phone', 'childrens.editionUnit');
|
|
|
query.select('user.phone', 'childrens.editionUnit')
|
|
|
- query.limit(1000);
|
|
|
+ query.limit(10000);
|
|
|
let r = await query.find();
|
|
|
r.forEach((item) => {
|
|
|
teacherList.add(item?.get('user')?.get('phone'));
|
|
@@ -532,13 +609,28 @@ export class textbookServer {
|
|
|
let unitArr = Array.from(unitList);
|
|
|
console.log('教师电话:',teacherArr);
|
|
|
|
|
|
+ let last = teacherArr.slice(5000,5999)
|
|
|
+ last.push(...['13581837652','13407973043','18510409671'])
|
|
|
+ console.log(last);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ let arr:any = [
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ last
|
|
|
+ ]
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return
|
|
|
let queryParams: any = {
|
|
|
where: {
|
|
|
$or: [
|
|
@@ -558,7 +650,7 @@ export class textbookServer {
|
|
|
let queryEduProcess = Parse.Query.fromJSON('EduProcess', queryParams);
|
|
|
queryEduProcess.include('profileSubmitted.user');
|
|
|
queryEduProcess.select('profileSubmitted.user.phone')
|
|
|
- query.limit(1000)
|
|
|
+ queryEduProcess.limit(1000)
|
|
|
let list = await queryEduProcess.find();
|
|
|
|
|
|
let unitPhoneList = new Set<string>();
|