|
@@ -3,6 +3,7 @@ import Parse from 'parse';
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
import { updateDept } from './importDept';
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message';
|
|
|
+import { ProvierOssAli } from '../app/comp-upload/provider-oss-aliyun';
|
|
|
|
|
|
@Injectable({
|
|
|
providedIn: 'root',
|
|
@@ -11,7 +12,11 @@ export class textbookServer {
|
|
|
company: string = localStorage.getItem('company')!;
|
|
|
theme: boolean = false; //深色主题模式
|
|
|
profile: any = JSON.parse(localStorage.getItem('profile')!);
|
|
|
- constructor(private http: HttpClient) {}
|
|
|
+
|
|
|
+ ossProvider: any|{ upload: any, signatureUrl: any, download:any } | undefined;
|
|
|
+ constructor(private http: HttpClient) {
|
|
|
+ this.ossProvider = new ProvierOssAli();
|
|
|
+ }
|
|
|
authMobile(mobile: string): boolean {
|
|
|
let a = /^1[3456789]\d{9}$/;
|
|
|
if (!String(mobile).match(a)) {
|
|
@@ -236,16 +241,94 @@ export class textbookServer {
|
|
|
|
|
|
/* 获取已有联系人出版单位、未注册联系人出版单位 */
|
|
|
async getUnitList() {
|
|
|
+ let title = '未注册出版社';
|
|
|
+ let arr = [
|
|
|
+ "甘肃人民出版社",
|
|
|
+ "河南人民出版社",
|
|
|
+ "湖南人民出版社",
|
|
|
+ "江苏人民出版社",
|
|
|
+ "企业管理出版社",
|
|
|
+ "海洋出版社",
|
|
|
+ "线装书局",
|
|
|
+ "中国工人出版社",
|
|
|
+ "中国海关出版社",
|
|
|
+ "中国青年出版总社",
|
|
|
+ "中国原子能出版社",
|
|
|
+ "中国标准出版社",
|
|
|
+ "国家图书馆出版社",
|
|
|
+ "中国戏剧出版社",
|
|
|
+ "北京人民出版社",
|
|
|
+ "中国社会科学出版社",
|
|
|
+ "新星出版社",
|
|
|
+ "河北大学出版社",
|
|
|
+ "测试流程开始",
|
|
|
+ "北京科学技术出版社",
|
|
|
+ "吉林人民出版社",
|
|
|
+ "南京东南大学出版社",
|
|
|
+ "陕西师范大学出版总社",
|
|
|
+ "上海教育出版社",
|
|
|
+ "成都西南交大出版社",
|
|
|
+ "重庆西南师范大学电子音像出版社"
|
|
|
+ ]
|
|
|
let unitMap:any = {}
|
|
|
let unitList = new Set<string>(); //单位出版社
|
|
|
- let query = new Parse.Query('EduTextbook');
|
|
|
+ let queryParamsbook: any = {
|
|
|
+ where: {
|
|
|
+ $or: [
|
|
|
+ {
|
|
|
+ childrens: {
|
|
|
+ $inQuery: {
|
|
|
+ where: {
|
|
|
+ editionUnit: { $in: arr },
|
|
|
+ },
|
|
|
+ className: 'EduTextbookVolume',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ };
|
|
|
+ let query = Parse.Query.fromJSON('EduTextbook', queryParamsbook);
|
|
|
query.equalTo('status', '400');
|
|
|
query.notEqualTo('isDeleted', true);
|
|
|
query.notEqualTo('discard', true);
|
|
|
- query.include('user.phone', 'childrens.editionUnit');
|
|
|
- query.select('user.phone', 'childrens.editionUnit')
|
|
|
+ query.include('user.phone', 'user.name','childrens.editionUnit');
|
|
|
+ query.select('user.phone', 'user.name','childrens.editionUnit')
|
|
|
query.limit(10000);
|
|
|
let r = await query.find();
|
|
|
+ let tb = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>手机号</th>
|
|
|
+ <th>姓名</th>
|
|
|
+ <th>关联出版社</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ `;
|
|
|
+
|
|
|
+ let _body = '';
|
|
|
+ for (var row = 0; row < r.length; row++) {
|
|
|
+ _body += '<tr>';
|
|
|
+ _body += '<td>';
|
|
|
+ _body += ` ${r[row]?.get('user')?.get('phone') || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
+ _body += '<td>';
|
|
|
+ _body += `${r[row]?.get('user')?.get('name') || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
+ _body += '<td>';
|
|
|
+ _body += ` ${this.fromatFiled(r[row]?.get('childrens'), 'editionUnit') || ''}`;
|
|
|
+ _body += '</td>';
|
|
|
+
|
|
|
+ _body += '</tr>';
|
|
|
+ }
|
|
|
+ tb += _body;
|
|
|
+ tb += '</tbody>';
|
|
|
+ tb += '</table>';
|
|
|
+ this.excel(tb, `${title}.xls`);
|
|
|
+ return
|
|
|
r.forEach((item) => {
|
|
|
item
|
|
|
.get('childrens')
|
|
@@ -280,6 +363,7 @@ export class textbookServer {
|
|
|
let queryEduProcess = Parse.Query.fromJSON('EduProcess', queryParams);
|
|
|
queryEduProcess.include('profileSubmitted.user');
|
|
|
queryEduProcess.select('profileSubmitted.user.phone','name')
|
|
|
+ queryEduProcess.notEqualTo('isDeleted',true)
|
|
|
queryEduProcess.limit(1000)
|
|
|
let list = await queryEduProcess.find();
|
|
|
// console.log(list);
|
|
@@ -296,45 +380,45 @@ export class textbookServer {
|
|
|
let a = Array.from(unitPhoneList), b = Array.from(notUnitPhoneList)
|
|
|
console.log('已注册联系:', Array.from(unitPhoneList));
|
|
|
console.log('未注册联系:',Array.from(notUnitPhoneList));
|
|
|
- let len = a.length > b.length ? a.length : b.length
|
|
|
- let table = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>已注册</th>
|
|
|
- <th>教材数量</th>
|
|
|
- <th>未注册</th>
|
|
|
- <th>教材数量</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- `;
|
|
|
-
|
|
|
- let _body = '';
|
|
|
- for (var row = 0; row < len; row++) {
|
|
|
- _body += '<tr>';
|
|
|
- _body += '<td>';
|
|
|
- _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;
|
|
|
- table += '</tbody>';
|
|
|
- table += '</table>';
|
|
|
- let title = '出版社';
|
|
|
- this.excel(table, `${title}.xls`);
|
|
|
+ return
|
|
|
+ // let len = a.length > b.length ? a.length : b.length
|
|
|
+ // let table = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
|
+ // <thead>
|
|
|
+ // <tr>
|
|
|
+ // <th>已注册</th>
|
|
|
+ // <th>教材数量</th>
|
|
|
+ // <th>未注册</th>
|
|
|
+ // <th>教材数量</th>
|
|
|
+ // </tr>
|
|
|
+ // </thead>
|
|
|
+ // <tbody>
|
|
|
+ // `;
|
|
|
+
|
|
|
+ // let _body = '';
|
|
|
+ // for (var row = 0; row < len; row++) {
|
|
|
+ // _body += '<tr>';
|
|
|
+ // _body += '<td>';
|
|
|
+ // _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;
|
|
|
+ // table += '</tbody>';
|
|
|
+ // table += '</table>';
|
|
|
+ // this.excel(table, `${title}.xls`);
|
|
|
}
|
|
|
|
|
|
/* 获取高等教育出版社教材 */
|
|
@@ -700,13 +784,48 @@ export class textbookServer {
|
|
|
let unitPhoneArr = Array.from(unitPhoneList)
|
|
|
unitPhoneArr.push(...['13581837652','13407973043','18510409671'])
|
|
|
|
|
|
- Parse.Cloud.run('aliSmsSend', {
|
|
|
- mobileList: [unitPhoneArr],
|
|
|
- templateCode: 'SMS_474290139',
|
|
|
- params: {end_date:'2024-10-20 16:00'},
|
|
|
- signName: '普通高等教育教材网',
|
|
|
- });
|
|
|
+ // Parse.Cloud.run('aliSmsSend', {
|
|
|
+ // mobileList: [unitPhoneArr],
|
|
|
+ // templateCode: 'SMS_474290139',
|
|
|
+ // params: {end_date:'2024-10-20 16:00'},
|
|
|
+ // signName: '普通高等教育教材网',
|
|
|
+ // });
|
|
|
console.log('出版社电话:',unitPhoneArr);
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 获取10月9号之前上传的教材文件转私有 */
|
|
|
+ async getEtxVolCollect(){
|
|
|
+ let queryParams: any = {
|
|
|
+ where: {
|
|
|
+ $or: [
|
|
|
+ {
|
|
|
+ collectFiles: {$exists: true},
|
|
|
+ collectDigitFiles: {$exists: true},
|
|
|
+
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ };
|
|
|
+ let query = Parse.Query.fromJSON('EduTextbookVolume', queryParams);
|
|
|
+ query.lessThan('updatedAt',new Date('2024-10-10 18:00'))
|
|
|
+ query.select('collectFiles','collectDigitFiles')
|
|
|
+ query.limit(2000)
|
|
|
+ let r = await query.find()
|
|
|
+ let urlList:Array<string> = []
|
|
|
+ r.forEach(item=>{
|
|
|
+ item?.get('collectFiles')?.forEach((f:any)=>{
|
|
|
+ urlList.push(f?.url)
|
|
|
+ })
|
|
|
+ item?.get('collectDigitFiles')?.forEach((d:any)=>{
|
|
|
+ urlList.push(d?.url)
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log(urlList);
|
|
|
+ for (let index = 0; index < urlList.length; index++) {
|
|
|
+ const u = urlList[index];
|
|
|
+ console.log(u);
|
|
|
+ // await this.ossProvider?.setACLPrivate(u)
|
|
|
+ }
|
|
|
}
|
|
|
}
|