|
@@ -319,7 +319,11 @@ export class textbookServer {
|
|
isDate ||
|
|
isDate ||
|
|
Object.prototype.toString.call(item.get(filed)).indexOf('Date') != -1
|
|
Object.prototype.toString.call(item.get(filed)).indexOf('Date') != -1
|
|
) {
|
|
) {
|
|
- arr.push(this.formatTime('YYYY-mm-dd', item.get(filed)) + '/'+ item.get('printNumber'));
|
|
|
|
|
|
+ arr.push(
|
|
|
|
+ this.formatTime('YYYY-mm-dd', item.get(filed)) +
|
|
|
|
+ '/' +
|
|
|
|
+ item.get('printNumber')
|
|
|
|
+ );
|
|
isDate = true;
|
|
isDate = true;
|
|
} else {
|
|
} else {
|
|
arr.push(item.get(filed));
|
|
arr.push(item.get(filed));
|
|
@@ -348,20 +352,20 @@ export class textbookServer {
|
|
'inviteUnit',
|
|
'inviteUnit',
|
|
'user.department',
|
|
'user.department',
|
|
'department.branch',
|
|
'department.branch',
|
|
- 'code',
|
|
|
|
|
|
+ 'code'
|
|
// 'eduProcess.profileSubmitted',
|
|
// 'eduProcess.profileSubmitted',
|
|
// 'eduProcess.profileSubmitted.email',
|
|
// 'eduProcess.profileSubmitted.email',
|
|
// 'eduProcess.profileSubmitted.user.name',
|
|
// 'eduProcess.profileSubmitted.user.name',
|
|
// 'eduProcess.profileSubmitted.user.phone'
|
|
// 'eduProcess.profileSubmitted.user.phone'
|
|
);
|
|
);
|
|
- query.containedIn('status', ['102','103', '200', '201', '400']);
|
|
|
|
|
|
+ query.containedIn('status', ['102', '103', '200', '201', '400']);
|
|
// query.containedIn('status',['400'])
|
|
// query.containedIn('status',['400'])
|
|
// query.containedIn('objectId',updateDept.list5)
|
|
// query.containedIn('objectId',updateDept.list5)
|
|
- query.ascending('createdAt')
|
|
|
|
- let count = await query.count()
|
|
|
|
|
|
+ query.ascending('createdAt');
|
|
|
|
+ let count = await query.count();
|
|
console.log(count);
|
|
console.log(count);
|
|
query.limit(2000);
|
|
query.limit(2000);
|
|
- query.skip(2000)
|
|
|
|
|
|
+ query.skip(2000);
|
|
let data = await query.find();
|
|
let data = await query.find();
|
|
let table = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
let table = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
<thead>
|
|
<thead>
|
|
@@ -377,20 +381,20 @@ export class textbookServer {
|
|
</thead>
|
|
</thead>
|
|
<tbody>
|
|
<tbody>
|
|
`;
|
|
`;
|
|
- // let table = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
|
|
- // <thead>
|
|
|
|
- // <tr>
|
|
|
|
- // <th>序号</th>
|
|
|
|
- // <th>申报教材名称</th>
|
|
|
|
- // <th>code</th>
|
|
|
|
- // <th>所属单位</th>
|
|
|
|
- // <th>单位联系人</th>
|
|
|
|
- // <th>联系人电话</th>
|
|
|
|
- // <th>联系人邮箱</th>
|
|
|
|
- // </tr>
|
|
|
|
- // </thead>
|
|
|
|
- // <tbody>
|
|
|
|
- // `;
|
|
|
|
|
|
+ // let table = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
|
|
+ // <thead>
|
|
|
|
+ // <tr>
|
|
|
|
+ // <th>序号</th>
|
|
|
|
+ // <th>申报教材名称</th>
|
|
|
|
+ // <th>code</th>
|
|
|
|
+ // <th>所属单位</th>
|
|
|
|
+ // <th>单位联系人</th>
|
|
|
|
+ // <th>联系人电话</th>
|
|
|
|
+ // <th>联系人邮箱</th>
|
|
|
|
+ // </tr>
|
|
|
|
+ // </thead>
|
|
|
|
+ // <tbody>
|
|
|
|
+ // `;
|
|
let _body = '';
|
|
let _body = '';
|
|
for (var row = 0; row < data.length; row++) {
|
|
for (var row = 0; row < data.length; row++) {
|
|
// console.log(data[row].get('user')?.get('department'));
|
|
// console.log(data[row].get('user')?.get('department'));
|
|
@@ -497,26 +501,72 @@ export class textbookServer {
|
|
document.body.removeChild(link);
|
|
document.body.removeChild(link);
|
|
}
|
|
}
|
|
|
|
|
|
- /* 获取所有未上传签名页附件教材 */
|
|
|
|
- async get_authorSignPDF_def() {
|
|
|
|
|
|
+ /* 发送出版社及教师通知短信 */
|
|
|
|
+ async sendNoticeMSG() {
|
|
|
|
+ let teacherList = new Set<string>();
|
|
|
|
+ let unitList = new Set<string>(); //单位出版社
|
|
|
|
+
|
|
let query = new Parse.Query('EduTextbook');
|
|
let query = new Parse.Query('EduTextbook');
|
|
- // let query = Parse.Query.fromJSON('EduTextbook', {
|
|
|
|
- // where: {
|
|
|
|
- // status:{$in: ['102','103','200','201','300']},
|
|
|
|
- // authorSignPDF
|
|
|
|
- // },
|
|
|
|
- // });
|
|
|
|
- let list: any = [];
|
|
|
|
|
|
+ query.equalTo('status', '400');
|
|
query.notEqualTo('isDeleted', true);
|
|
query.notEqualTo('isDeleted', true);
|
|
- query.containedIn('status', ['102', '103', '200', '201', '300']);
|
|
|
|
- query.doesNotExist('authorSignPDF.url');
|
|
|
|
- query.exists('code');
|
|
|
|
- query.select('code');
|
|
|
|
|
|
+ query.notEqualTo('discard', true);
|
|
|
|
+ query.include('user.phone', 'childrens.editionUnit');
|
|
|
|
+ query.select('user.phone', 'childrens.editionUnit')
|
|
query.limit(1000);
|
|
query.limit(1000);
|
|
- query.greaterThanOrEqualTo('createdAt', new Date('2024/8/5 00:00'));
|
|
|
|
let r = await query.find();
|
|
let r = await query.find();
|
|
- // console.log(r);
|
|
|
|
- r.forEach((item) => list.push(item.get('code')));
|
|
|
|
- console.log(list);
|
|
|
|
|
|
+ r.forEach((item) => {
|
|
|
|
+ teacherList.add(item?.get('user')?.get('phone'));
|
|
|
|
+ item
|
|
|
|
+ .get('childrens')
|
|
|
|
+ ?.forEach((child: any) => unitList.add(child?.get('editionUnit')));
|
|
|
|
+ });
|
|
|
|
+ let teacherArr = Array.from(teacherList);
|
|
|
|
+ let unitArr = Array.from(unitList);
|
|
|
|
+ console.log('教师电话:',teacherArr);
|
|
|
|
+ // console.log(unitArr);
|
|
|
|
+
|
|
|
|
+ // Parse.Cloud.run('aliSmsSend', {
|
|
|
|
+ // mobileList: [teacherArr],
|
|
|
|
+ // templateCode: 'SMS_468870790',
|
|
|
|
+ // params: {},
|
|
|
|
+ // signName: '普通高等教育教材网',
|
|
|
|
+ // });
|
|
|
|
+ let queryParams: any = {
|
|
|
|
+ where: {
|
|
|
|
+ $or: [
|
|
|
|
+ {
|
|
|
|
+ department: {
|
|
|
|
+ $inQuery: {
|
|
|
|
+ where: {
|
|
|
|
+ name: { $in: unitArr },
|
|
|
|
+ },
|
|
|
|
+ className: 'Department',
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ let queryEduProcess = Parse.Query.fromJSON('EduProcess', queryParams);
|
|
|
|
+ queryEduProcess.include('profileSubmitted.user');
|
|
|
|
+ queryEduProcess.select('profileSubmitted.user.phone')
|
|
|
|
+ query.limit(1000)
|
|
|
|
+ let list = await queryEduProcess.find();
|
|
|
|
+ // console.log(list);
|
|
|
|
+ let unitPhoneList = new Set<string>(); //出版单位联系人
|
|
|
|
+ list.map(item=> {
|
|
|
|
+ if(item?.get('profileSubmitted')?.get('user')?.get('phone')){
|
|
|
|
+ unitPhoneList.add(item?.get('profileSubmitted')?.get('user')?.get('phone'))
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ let unitPhoneArr = Array.from(unitPhoneList)
|
|
|
|
+ // Parse.Cloud.run('aliSmsSend', {
|
|
|
|
+ // mobileList: [unitPhoneArr],
|
|
|
|
+ // templateCode: 'SMS_468870790',
|
|
|
|
+ // params: {},
|
|
|
|
+ // signName: '普通高等教育教材网',
|
|
|
|
+ // });
|
|
|
|
+ console.log('出版社电话:',unitPhoneArr);
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|