Browse Source

新增流程状态的教材收集状态

warrior 4 months ago
parent
commit
bc9c35fff1

+ 8 - 2
projects/textbook/src/modules/nav-admin/page-process/process-list/process-list.component.html

@@ -14,7 +14,7 @@
           *nzSpaceItem
           nz-button
           nzType="primary"
-          (click)="tbookSer.exportEduTextbook()"
+          (click)="shellSer.exportEduTextbook()"
         >
           出版社Excel
         </button>
@@ -149,6 +149,7 @@
             <th nzEllipsis nzWidth="120px">流程描述</th>
             <th nzEllipsis nzWidth="80px">申报限额</th>
             <th nzEllipsis nzWidth="120px">流程联系人</th>
+            <th nzEllipsis nzWidth="80px">教材收集</th>
             <th nzEllipsis nzWidth="80px">流程状态</th>
             <th nzEllipsis nzWidth="50px" nzRight>操作</th>
           </tr>
@@ -196,6 +197,11 @@
                 data?.get("profileSubmitted")?.get("user").get("name") || "-"
               }}
             </td>
+            <td nzEllipsis>
+              <nz-tag [nzColor]="statusFileMap[data.id].color">
+                {{ statusFileMap[data.id].title }}</nz-tag
+              >
+            </td>
             <td nzEllipsis>
               <nz-tag [nzColor]="statusMap[data.id].color">
                 {{ statusMap[data.id].title }}</nz-tag
@@ -244,7 +250,7 @@
                       >暂停流程
                     </button>
                   </li>
-                  }@if (statusMap[data.id].collect){
+                  }@if (statusFileMap[data.id]?.collect || statusMap[data.id].collect){
                   <li nz-menu-item>
                     <button
                       nz-button

+ 67 - 24
projects/textbook/src/modules/nav-admin/page-process/process-list/process-list.component.ts

@@ -29,6 +29,8 @@ import { NzPopoverModule } from 'ng-zorro-antd/popover';
 import { setHours } from 'date-fns';
 import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
 import { textbookServer } from '../../../../services/textbook';
+import { shellServer } from '../../../../services/shell';
+
 interface nodes {
   title: string;
   key: string;
@@ -84,6 +86,7 @@ export class ProcessListComponent implements OnInit {
 
   eduProcessList: Array<Parse.Object> = [];
   statusMap: any = {};
+  statusFileMap: any = {};
   eduProcessLength: number = 0;
   pageSize: number = 10;
   pageIndex: number = 1;
@@ -119,29 +122,29 @@ export class ProcessListComponent implements OnInit {
         del: false,
       };
     }
-    if(e?.get('collectStartData') && new Date() < new Date(e?.get('collectStartData'))){
-      return {
-        title: '待收集',
-        color: 'default',
-        strat: false,
-        stop: false,
-        end: false,
-        del: false,
-        collect:true
-      };
-    }
-    if(e?.get('collectStartData') && new Date() > new Date(e?.get('collectStartData')) 
-    && new Date() < e?.get('collectEndData')){
-      return {
-        title: '收集中',
-        color: 'orange',
-        strat: false,
-        stop: false,
-        end: false,
-        del: false,
-        collect:true
-      };
-    }
+    // if(e?.get('collectStartData') && new Date() < new Date(e?.get('collectStartData'))){
+    //   return {
+    //     title: '未开始',
+    //     color: 'default',
+    //     strat: false,
+    //     stop: false,
+    //     end: false,
+    //     del: false,
+    //     collect:true
+    //   };
+    // }
+    // if(e?.get('collectStartData') && new Date() > new Date(e?.get('collectStartData')) 
+    // && new Date() < e?.get('collectEndData')){
+    //   return {
+    //     title: '收集中',
+    //     color: 'orange',
+    //     strat: false,
+    //     stop: false,
+    //     end: false,
+    //     del: false,
+    //     collect:true
+    //   };
+    // }
     if (
       e?.get('deadline') &&
       new Date() > new Date(e?.get('deadline')) &&
@@ -224,6 +227,44 @@ export class ProcessListComponent implements OnInit {
     }
     return;
   };
+
+  formatFileStatus = (e: any) => {
+    if(!e?.get('collectStartData') || new Date() < new Date(e?.get('collectStartData'))){
+      return {
+        title: '未开始',
+        color: 'default',
+        strat: false,
+        stop: false,
+        end: false,
+        del: false,
+        collect:true
+      };
+    }
+    if(e?.get('collectStartData') && new Date() > new Date(e?.get('collectStartData')) 
+    && new Date() < e?.get('collectEndData')){
+      return {
+        title: '收集中',
+        color: 'orange',
+        strat: false,
+        stop: false,
+        end: false,
+        del: false,
+        collect:true
+      };
+    }
+    if(e?.get('collectEndData') && new Date() > e?.get('collectEndData')){
+      return {
+        title: '已结束',
+        color: 'orange',
+        strat: false,
+        stop: false,
+        end: false,
+        del: false,
+        collect:true
+      };
+    }
+    return;
+  }
   /* 新建组织 */
   branchObj: any = {
     name: '',
@@ -238,6 +279,7 @@ export class ProcessListComponent implements OnInit {
 
   constructor(
     public tbookSer: textbookServer,
+    public shellSer:shellServer,
     private route: Router,
     private activeRoute: ActivatedRoute,
     private nzContextMenuService: NzContextMenuService,
@@ -334,6 +376,7 @@ export class ProcessListComponent implements OnInit {
       // _item['checked'] = false;
       // _item['state'] = this.formatStatus(_item);
       this.statusMap[item.id] = this.formatStatus(item);
+      this.statusFileMap[item.id] = this.formatFileStatus(item);
     });
     this.eduProcessList = r;
     this.loading = false;
@@ -585,7 +628,7 @@ export class ProcessListComponent implements OnInit {
       nzOkType: 'primary',
       nzOkDanger: true,
       nzOnOk: () => {
-        this.tbookSer.sendNoticeMSG()
+        this.shellSer.sendNoticeMSG()
         this.message.success('已发送')
       },
       nzCancelText: '取消',

+ 94 - 204
projects/textbook/src/services/importDept.ts

@@ -2376,210 +2376,100 @@ export const updateDept = {
     '中译出版社',
     '宗教文化出版社',
   ],
+  /* 变更教材字段 */
   list5: [
-    'AaZfRQ9mS5',
-    'uzJ8yHa73w',
-    'Ugl3cY2yDP',
-    '5q6dtnYpUp',
-    'HXT0e8zbRr',
-    'Ah2E7eUT9K',
-    'iMrvndtzvA',
-    'GuNqXq0SFt',
-    '3ZGme3l42o',
-    '1XudfGXRs3',
-    'WUkUbmauKi',
-    'FUSr9Pdyyc',
-    '0EKf2AsizZ',
-    '78BZUtoKGY',
-    'Fbjg3SRu2T',
-    'UEe6Zjlh7w',
-    'YjGH8MB8tb',
-    '28dA1ASLVw',
-    'iwD7cw7mEH',
-    'uJAtMwNZkM',
-    'haLlKXZSqP',
-    'D4ECINOr02',
-    'IIcMHw4MNj',
-    'gNnZVCAgxW',
-    '3Keo5jz7Mv',
-    'VjgukphqMv',
-    'rbPgEmHU3F',
-    'jzjQgx3GdJ',
-    'T8QyKa2iXB',
-    'pbjWsqK0iA',
-    'XkfxebQBne',
-    'BFMiYKzXdN',
-    'x5WpBN0p22',
-    'VtPkfTvYq8',
-    'K29fXWm4D9',
-    'LmHHnZU73F',
-    'x2jay7lWx5',
-    '5EDNA70Y34',
-    'DjfjHvEdgp',
-    'YMjOpauufo',
-    '3VRBH7yuBn',
-    '7PO1ekch4S',
-    'dIccBh5CBD',
-    'Yrp4gPSlf2',
-    'uvmtqWdMlM',
-    'svLOtr0xpk',
-    'euZ208EKUR',
-    'Vq8F29Ql0F',
-    'IBG26K8hFJ',
-    'ygRSeq29K1',
-    's97Xz6DlLw',
-    '87xq6abnSi',
-    'goqdaNcoPI',
-    'TRGJX0epCj',
-    'W6dRROJHFc',
-    'Yddzb2vC0T',
-    '7OXltuAH9N',
-    'MEjChwitSl',
-    'SULzQJ2s5e',
-    'FEjgrqsQrw',
-    'Y98xKVFbSl',
-    'Tq0W74PeGF',
-    '8LfsnglGwv',
-    'krKToc2hYP',
-    'eafUB3zCxH',
-    'qywYUC6wce',
-    'JjGXuBUruC',
-    'jJESK9CvpE',
-    'kmHecKMGHC',
-    'e3VhgxKjRQ',
-    'SBi6tOourO',
-    'p2yRFyBdvQ',
-    '0yFWbONeNF',
-    'yooSA5OWzk',
-    'ny9uWkIiQZ',
-    'Gttpcu9HSk',
-    'MqiTer5lMD',
-    's8tHRHblN2',
-    'TL1le1UN3R',
-    'utgydDhvjq',
-    'YluD9m9GIA',
-    'AYtKO9zOYQ',
-    'o7mY4jRyDz',
-    '9sBDFYBMJx',
-    '9qXdLgBPHL',
-    '3VwAl4mP6I',
-    'JnQS6aLztC',
-    'WldHELAhtD',
-    'Mty5QqSbts',
-    'NJ6FevK9Ds',
-    'wcVjc1xa4d',
-    '4WysFgHFvp',
-    'qSBkFFgIWC',
-    'ETvwP4PgiQ',
-    'Avcg6Gbkrz',
-    '7U6W8uoOTg',
-    'c8rBhFMISt',
-    'pBA8ATjfTK',
-    'ihkpUKTFNv',
-    'pCRZXYSIsj',
-    'wij4jpmj8x',
-    'cIcWNiGBse',
-    'HdZ74oXL0Q',
-    'zpT33PL0aw',
-    'ZTCxG9rawx',
-    'rCkm0o8zdZ',
-    '0udz7h5oXF',
-    'lSHLDJ4bZN',
-    'QoMzcPWGuY',
-    'fyMoeGRTi4',
-    'h1RpOoVzrY',
-    'YnyTqewNKV',
-    'yt0LXtdmXH',
-    'EfpgjanCFT',
-    'GkmmDwB4Mz',
-    'jqqkLotzGJ',
-    'aJW4BAbcga',
-    'UpLvOn9Ml5',
-    'mjSzl0j2Mf',
-    'hnZbPUdUnr',
-    'Ou4FVESeEa',
-    'Js6GHI0gcl',
-    'zPZWDjSDxB',
-    'aWV73QlJq3',
-    'VsqVzXNaoX',
-    'x2xxXs65rn',
-    'SD0NCAdscz',
-    'hBzLFskknf',
-    'YookEq7IOV',
-    'j71DgohGZB',
-    'PlrlJDzaFE',
-    'cn4nPhxLPq',
-    'oXWGbiDDHe',
-    'JTIWaAHYDK',
-    'BC0ZanM0dx',
-    'n6UBnDIDVB',
-    'Ty1FUHnhEx',
-    '4pU8DM1VXS',
-    'XBGEEu3Qai',
-    '0Ewdmf4cze',
-    '0xmDdjXDpm',
-    'amZSpB4l2S',
-    'OC8i0F8AOS',
-    'beCtpv695l',
-    'rTUPofCSrM',
-    'Ia7v2WQrDB',
-    'VN2JJcPtVA',
-    '8SQBGUrXXG',
-    'LdnIXnATXD',
-    'zpHU2dgaxw',
-    '25HIZlksPb',
-    '9pAIGJgoxq',
-    '65PFGUjwXG',
-    'NXjn2mSH2S',
-    'n7y8dbYMrx',
-    '3gdmLKMW1f',
-    'b9sU5QCxdw',
-    'sEWHdvJLA0',
-    'W93T5AktEZ',
-    'bgHaFQLbvG',
-    'onztZEPyan',
-    'go8REx26U2',
-    'qCeLyXsGbs',
-    'e2MbwJ6xeU',
-    'rjxLzmpWMX',
-    'qDhoBGNwl2',
-    'DBATRKwqF5',
-    'x4WfVjCmlW',
-    'Icttqb0yyW',
-    'ZT5MDmIaHP',
-    'pH0TByeGNe',
-    '9bBfhvTCTM',
-    'bCX20FRhei',
-    'fc5ACxqMuH',
-    'M0dJLYDGum',
-    'wHmnUnPTSo',
-    'LeuvTW01zM',
-    'LHbsHkyBM8',
-    'PPJzNzvOHJ',
-    'ZEvrOGE8WM',
-    'ICltVLWREX',
-    'uVDry9Y0OV',
-    'ZBVf7DSHME',
-    'hiicBHEG4K',
-    'NmDlzXO1u8',
-    'GKOBuNZrBg',
-    '1EiVGhwe1A',
-    'J0DepSNmjE',
-    'gPm5QBFXKo',
-    'yvTWRkU3qk',
-    'ASMJWN4BUf',
-    'IVVCVJrmXM',
-    'zrxHX3zQZ9',
-    '51GRrIDLv2',
-    'D565SVNHBX',
-    'GyDPQCcYww',
-    'DT2BOSQBgQ',
-    'MjdM2vEACP',
-    'vEx3MW3ADe',
-    'GwXy48Y7BK',
-    'fju0DVvkop',
-    'EPvjAsAqYr',
-    'BGDxy5IIms',
-    'QbPaSeAHgC',
+    { code: '202409250291', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409280903482000', isbn: '无', type: '纸质教材' },
+    { code: '202409258725', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409068093', isbn: '无', type: '纸质教材' },
+    { code: '202409227813', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409270923248000', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408214103', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409204072', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409141335', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409121004', isbn: '9787501964468', type: '无' },
+    { code: '202409262205', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409223435', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409209341', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409205775', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408304673', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409172287', isbn: '无', type: '纸质教材' },
+    { code: '202409196326', isbn: '无', type: '纸质教材' },
+    { code: '202409186954', isbn: '无', type: '纸质教材' },
+    { code: '202409213092', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409228892', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409140247', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409220175', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409107091', isbn: '9787565733307', type: '无' },
+    { code: '202408260926', isbn: '9787040608311', type: '无' },
+    { code: '202409148827', isbn: '无', type: '纸质教材' },
+    { code: '202409233839', isbn: '无', type: '纸质教材' },
+    { code: '202409230486', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409231138', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408261694', isbn: '无', type: '纸质教材' },
+    { code: '202409262104498000', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409217803', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409120625', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409271244552000', isbn: '9787111375173', type: '无' },
+    { code: '202409111879', isbn: '978568941006', type: '无' },
+    { code: '202408305828', isbn: '9787030792297', type: '无' },
+    { code: '202409271024525000', isbn: '9787040618433', type: '无' },
+    { code: '202409229577', isbn: '无', type: '纸质教材' },
+    { code: '202409244316', isbn: '9787030565228', type: '无' },
+    { code: '202409145947', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409202315', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409234227', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408200468', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409254937', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409201312', isbn: '9787502476939', type: '无' },
+    { code: '202408288227', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409111807', isbn: '9787040525380', type: '无' },
+    { code: '202409263391', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409022555', isbn: '9767040621792', type: '无' },
+    { code: '202409258725', isbn: '9877040318845', type: '无' },
+    { code: '202409207176', isbn: '9787030641298', type: '无' },
+    { code: '202409182262', isbn: '无', type: '纸质教材' },
+    { code: '202409119633', isbn: '9787030487650', type: '无' },
+    { code: '202408305828', isbn: '9787030792297', type: '无' },
+    { code: '202409244316', isbn: '9787030565228', type: '无' },
+    { code: '202409061314', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409256608', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409240908', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409230544', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409157319', isbn: '无', type: '纸质教材' },
+    { code: '202409250026', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409253611', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408263404', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409261631', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409280903482185', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409201179', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408261694', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409096077', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408285257', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409238641', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408292195', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408214103', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409190831', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409264495', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409038422', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409233839', isbn: '无', type: '纸质教材' },
+    { code: '202409111517', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408302045', isbn: '9787030768902', type: '无' },
+    { code: '202409257293', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409270933058134', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202408247973', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409228987', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409027491', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409145094', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409252876', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409271209322331', isbn: '9787030691682', type: '无' },
+    { code: '202409280609496498', isbn: '9787895051737', type: '无' },
+    { code: '202408301306', isbn: '无', type: '纸质教材' },
+    { code: '202409188418', isbn: '9787117226516', type: '无' },
+    { code: '202409188418', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409141501', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409163979', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409143867', isbn: '无', type: '纸质教材附带数字资源' },
+    { code: '202409111807', isbn: '9787040525380', type: '无' },
   ],
 };

+ 667 - 0
projects/textbook/src/services/shell.ts

@@ -0,0 +1,667 @@
+import { Injectable } from '@angular/core';
+import Parse from 'parse';
+import { HttpClient } from '@angular/common/http';
+import { updateDept } from './importDept';
+import { ProvierOssAli } from '../app/comp-upload/provider-oss-aliyun';
+import { textbookServer } from './textbook';
+
+@Injectable({
+  providedIn: 'root',
+})
+export class shellServer {
+  ossProvider:
+    | any
+    | { upload: any; signatureUrl: any; download: any }
+    | undefined;
+
+  constructor(private http: HttpClient, private tbookSer: textbookServer) {
+    this.ossProvider = new ProvierOssAli();
+  }
+  //格式化链
+  async formatNode(id: string): Promise<Array<any>> {
+    if (!id) return [];
+    let query = new Parse.Query('Department');
+    query.select('name', 'parent.name', 'branch');
+    let r = await query.get(id);
+    let arr = [
+      {
+        title: r.get('name'),
+        key: r.id,
+        // hasChildren: r.get('hasChildren'), //是否是最下级
+        // type: r.get('type'),
+        branch: r?.get('branch'),
+        parent: r?.get('parent')?.id, //上级
+      },
+    ];
+    if (r?.get('parent')) {
+      arr.unshift(...(await this.formatNode(r?.get('parent').id)));
+    }
+    return arr;
+  }
+  /* 获取已有联系人出版单位、未注册联系人出版单位 */
+  async getUnitList() {
+    let title = '未注册出版社';
+    let arr = [
+      '甘肃人民出版社',
+      '河南人民出版社',
+      '湖南人民出版社',
+      '江苏人民出版社',
+      '企业管理出版社',
+      '海洋出版社',
+      '线装书局',
+      '中国工人出版社',
+      '中国海关出版社',
+      '中国青年出版总社',
+      '中国原子能出版社',
+      '中国标准出版社',
+      '国家图书馆出版社',
+      '中国戏剧出版社',
+      '北京人民出版社',
+      '中国社会科学出版社',
+      '新星出版社',
+      '河北大学出版社',
+      '测试流程开始',
+      '北京科学技术出版社',
+      '吉林人民出版社',
+      '南京东南大学出版社',
+      '陕西师范大学出版总社',
+      '上海教育出版社',
+      '成都西南交大出版社',
+      '重庆西南师范大学电子音像出版社',
+    ];
+    let unitMap: any = {};
+    let unitList = new Set<string>(); //单位出版社
+    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', '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 += `&nbsp;${r[row]?.get('user')?.get('phone') || ''}`;
+      _body += '</td>';
+
+      _body += '<td>';
+      _body += `${r[row]?.get('user')?.get('name') || ''}`;
+      _body += '</td>';
+
+      _body += '<td>';
+      _body += ` &nbsp;${
+        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')?.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: [
+          {
+            department: {
+              $inQuery: {
+                where: {
+                  name: { $in: unitArr },
+                },
+                className: 'Department',
+              },
+            },
+          },
+        ],
+      },
+    };
+    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);
+    let unitPhoneList = new Set<string>(); //出版单位联系人
+    let notUnitPhoneList = new Set<string>(); //出版单位联系人
+    list.map((item) => {
+      if (item?.get('profileSubmitted')?.get('user')?.get('phone')) {
+        // unitPhoneList.add(item?.get('profileSubmitted')?.get('user')?.get('phone'))
+        unitPhoneList.add(item?.get('name'));
+      } else {
+        notUnitPhoneList.add(item?.get('name'));
+      }
+    });
+    let a = Array.from(unitPhoneList),
+      b = Array.from(notUnitPhoneList);
+    console.log('已注册联系:', Array.from(unitPhoneList));
+    console.log('未注册联系:', Array.from(notUnitPhoneList));
+    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 += ` &nbsp;${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`);
+  }
+
+  /* 获取高等教育出版社教材 */
+  async getGdjy() {
+    let queryParams: any = {
+      where: {
+        $or: [
+          {
+            childrens: {
+              $inQuery: {
+                where: {
+                  editionUnit: '高等教育出版社',
+                },
+                className: 'EduTextbookVolume',
+              },
+            },
+          },
+        ],
+      },
+    };
+    let query = Parse.Query.fromJSON('EduTextbook', queryParams);
+    query.equalTo('status', '400');
+    query.notEqualTo('isDeleted', true);
+    query.notEqualTo('discard', true);
+    query.include('user');
+    query.limit(2000);
+    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 += `&nbsp;${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> = [];
+    let isDate = false;
+    // 监测空值
+    list?.forEach((item: Parse.Object) => {
+      if (
+        isDate ||
+        Object.prototype.toString.call(item.get(filed)).indexOf('Date') != -1
+      ) {
+        arr.push(
+          this.tbookSer.formatTime('YYYY-mm-dd', item.get(filed)) +
+            '/' +
+            item.get('printNumber')
+        );
+        isDate = true;
+      } else {
+        arr.push(item.get(filed));
+      }
+    });
+    let j = Array.from(arr).join(',');
+    if (!isDate) {
+      j = Array.from(new Set(arr)).join(' ');
+    }
+    return j || '-';
+  }
+  //导出表格
+  async exportEduTextbook() {
+    let unitName = '科学出版社';
+    try {
+      let queryParams: any = {
+        where: {
+          $or: [
+            {
+              childrens: {
+                $inQuery: {
+                  where: {
+                    editionUnit: unitName,
+                  },
+                  className: 'EduTextbookVolume',
+                },
+              },
+            },
+          ],
+        },
+      };
+      let query = Parse.Query.fromJSON('EduTextbook', queryParams);
+      // let query = new Parse.Query('EduTextbook');
+      query.notEqualTo('isDeleted', true);
+      query.notEqualTo('discard', true);
+      query.equalTo('render', true);
+      query.select(
+        'title',
+        'childrens.ISBN',
+        'childrens.author',
+        'childrens.printDate',
+        'childrens.printNumber',
+        'childrens.editionUnit',
+        'childrens.carrierShape',
+        'inviteUnit',
+        'user.department',
+        'department.branch',
+        'code'
+        // 'eduProcess.profileSubmitted',
+        // 'eduProcess.profileSubmitted.email',
+        // 'eduProcess.profileSubmitted.user.name',
+        // 'eduProcess.profileSubmitted.user.phone'
+      );
+      // query.containedIn('status', ['102', '103', '200', '201', '400']);
+      query.containedIn('status', ['400']);
+      // query.containedIn('objectId',updateDept.list5)
+      query.ascending('createdAt');
+      let count = await query.count();
+      console.log(count);
+      query.limit(2000);
+      query.skip(0);
+      let data = await query.find();
+      let table = `<table border="1px" cellspacing="0" cellpadding="0">
+        <thead>
+          <tr>
+            <th>序号</th>
+            <th>申报教材名称</th>
+            <th>第一主编/作者</th>
+            <th>ISBN</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 = '';
+      for (var row = 0; row < data.length; row++) {
+        // console.log(data[row].get('user')?.get('department'));
+        let inviteUnit = data[row]?.get('inviteUnit');
+        if (
+          data[row]?.get('department')?.get('branch') == '省级教育行政部门' ||
+          data[row]?.get('department')?.get('branch') ==
+            '有关部门(单位)教育司(局)'
+        ) {
+          let parentMap = await this.formatNode(
+            data[row].get('user')?.get('department')?.id
+          );
+          inviteUnit = parentMap[2]?.title;
+        }
+        _body += '<tr>';
+        _body += '<td>';
+        _body += `${row}`;
+        _body += '</td>';
+
+        _body += '<td>';
+        _body += ` &nbsp;${data[row].get('title') || '-'}`;
+        _body += '</td>';
+
+        // _body += '<td>';
+        // _body += `&nbsp;${data[row].get('code') || ''}`;
+        // _body += '</td>';
+
+        // _body += '<td>';
+        // _body += `&nbsp;${data[row].get('inviteUnit') || ''}`;
+        // _body += '</td>';
+
+        // _body += '<td>';
+        // _body += `&nbsp;${data[row]?.get('eduProcess')?.get('profileSubmitted')?.get('user')?.get('name') || ''}`;
+        // _body += '</td>';
+
+        // _body += '<td>';
+        // _body += `&nbsp;${data[row]?.get('eduProcess')?.get('profileSubmitted')?.get('user')?.get('phone') || ''}`;
+        // _body += '</td>';
+
+        // _body += '<td>';
+        // _body += `&nbsp;${data[row]?.get('eduProcess')?.get('profileSubmitted')?.get('email') || ''}`;
+        // _body += '</td>';
+
+        _body += '<td>';
+        _body += `${this.fromatFiled(data[row]?.get('childrens'), 'author')}`;
+        _body += '</td>';
+
+        _body += '<td>';
+        _body += `&nbsp;${this.fromatFiled(
+          data[row]?.get('childrens'),
+          'ISBN'
+        )}`;
+        _body += '</td>';
+
+        _body += '<td>';
+        _body += `${this.fromatFiled(
+          data[row]?.get('childrens'),
+          'editionUnit'
+        )}`;
+        _body += '</td>';
+
+        _body += '<td>';
+        _body += `${inviteUnit}`;
+        _body += '</td>';
+
+        _body += '<td>';
+        _body += `${this.fromatFiled(
+          data[row]?.get('childrens'),
+          'printDate'
+        )}`;
+        _body += '</td>';
+
+        _body += '<td>';
+        _body += `${this.fromatFiled(
+          data[row]?.get('childrens'),
+          'carrierShape'
+        )}`;
+        _body += '</td>';
+
+        _body += '</tr>';
+      }
+      table += _body;
+      table += '</tbody>';
+      table += '</table>';
+      // let title = '已提交教材';
+      this.excel(table, `${unitName}.xls`);
+    } catch (err) {
+      console.log(err);
+    }
+  }
+  excel(data: any, filename: string) {
+    let html =
+      "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>";
+    html +=
+      '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">';
+    html += '<meta http-equiv="content-type" content="application/vnd.ms-excel';
+    html += '; charset=UTF-8">';
+    html += '<head>';
+    html += '</head>';
+    html += '<body>';
+    html += data;
+    html += '</body>';
+    html += '</html>';
+    let uri =
+      'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(html);
+    let link = document.createElement('a');
+    link.href = uri;
+    link.download = `${filename}`;
+    document.body.appendChild(link);
+    link.click();
+    document.body.removeChild(link);
+  }
+
+  /* 发送出版社及教师通知短信 */
+  async sendNoticeMSG() {
+    let teacherList = new Set<string>();
+    let unitList = new Set<string>(); //单位出版社
+
+    let query = new Parse.Query('EduTextbook');
+    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.limit(10000);
+    let r = await query.find();
+    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);
+    let last = teacherArr.slice(5000, 5999);
+    last.push(...['13581837652', '13407973043', '18510409671']);
+    console.log(last);
+
+    let arr: any = [
+      // teacherArr.slice(0,999),
+      // teacherArr.slice(1000,1999),
+      // teacherArr.slice(2000,2999),
+      // teacherArr.slice(3000,3999),
+      // teacherArr.slice(4000,4999),
+      last,
+    ];
+    // arr.forEach((list:any)=> {
+    //   Parse.Cloud.run('aliSmsSend', {
+    //     mobileList: [list],
+    //     templateCode: 'SMS_474205136',
+    //     params: {},
+    //     signName: '普通高等教育教材网',
+    //   });
+    // })
+
+    // return
+    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');
+    queryEduProcess.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);
+    unitPhoneArr.push(...['13581837652', '13407973043', '18510409671']);
+
+    // 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)
+    }
+  }
+
+  /* 更新教材个别字段 */
+  async updateTextbook() {
+    let arr = []
+    let list = updateDept.list5
+    for (let index = 0; index < list.length; index++) {
+      const item = list[index];
+      let query = new Parse.Query('EduTextbook')
+      query.equalTo('code',item.code)
+      query.notEqualTo('isDeleted',true)
+      query.include('childrens')
+      query.select('childrens')
+      let r = await query.find()
+      if(r.length <1 || r.length > 1 || r[0]?.get('childrens').length > 1){
+        arr.push(item.code)
+        continue
+      }
+      let eduTextbookVolume = r[0]?.get('childrens')[0]
+      item.type.trim() != '无' && eduTextbookVolume?.set('carrierShape',item.type.trim())
+      item.isbn.trim() != '无' && eduTextbookVolume?.set('ISBN',item.isbn.trim())
+      await eduTextbookVolume?.save()
+      console.log('update=>',item);
+    }
+    console.log('update over');
+    console.log(arr);
+  }
+}

+ 5 - 599
projects/textbook/src/services/textbook.ts

@@ -1,9 +1,8 @@
 import { Injectable } from '@angular/core';
 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';
+// import { ProvierOssAli } from '../app/comp-upload/provider-oss-aliyun';
 
 @Injectable({
   providedIn: 'root',
@@ -13,10 +12,7 @@ export class textbookServer {
   theme: boolean = false; //深色主题模式
   profile: any = JSON.parse(localStorage.getItem('profile')!);
 
-  ossProvider: any|{ upload: any, signatureUrl: any, download:any } | undefined;
-  constructor(private http: HttpClient) {
-    this.ossProvider = new ProvierOssAli();
-  }
+  constructor(private http: HttpClient) { }
   authMobile(mobile: string): boolean {
     let a = /^1[3456789]\d{9}$/;
     if (!String(mobile).match(a)) {
@@ -65,14 +61,14 @@ export class textbookServer {
   async formatNode(id: string): Promise<Array<any>> {
     if (!id) return [];
     let query = new Parse.Query('Department');
-    query.select('name', 'parent.name', 'branch');
+    query.select('name', 'parent.name', 'branch', 'hasChildren','type');
     let r = await query.get(id);
     let arr = [
       {
         title: r.get('name'),
         key: r.id,
-        // hasChildren: r.get('hasChildren'), //是否是最下级
-        // type: r.get('type'),
+        hasChildren: r.get('hasChildren'), //是否是最下级
+        type: r.get('type'),
         branch: r?.get('branch'),
         parent: r?.get('parent')?.id, //上级
       },
@@ -238,594 +234,4 @@ export class textbookServer {
     }
     return false;
   }
-
-  /* 获取已有联系人出版单位、未注册联系人出版单位 */
-  async getUnitList() {
-    let title = '未注册出版社';
-    let arr = [
-      "甘肃人民出版社",
-      "河南人民出版社",
-      "湖南人民出版社",
-      "江苏人民出版社",
-      "企业管理出版社",
-      "海洋出版社",
-      "线装书局",
-      "中国工人出版社",
-      "中国海关出版社",
-      "中国青年出版总社",
-      "中国原子能出版社",
-      "中国标准出版社",
-      "国家图书馆出版社",
-      "中国戏剧出版社",
-      "北京人民出版社",
-      "中国社会科学出版社",
-      "新星出版社",
-      "河北大学出版社",
-      "测试流程开始",
-      "北京科学技术出版社",
-      "吉林人民出版社",
-      "南京东南大学出版社",
-      "陕西师范大学出版总社",
-      "上海教育出版社",
-      "成都西南交大出版社",
-      "重庆西南师范大学电子音像出版社"
-  ]
-    let unitMap:any = {}
-    let unitList = new Set<string>(); //单位出版社
-    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', '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 += `&nbsp;${r[row]?.get('user')?.get('phone') || ''}`;
-      _body += '</td>';
-
-      _body += '<td>';
-      _body += `${r[row]?.get('user')?.get('name') || ''}`;
-      _body += '</td>';
-
-      _body += '<td>';
-      _body += ` &nbsp;${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')
-        ?.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: [
-          {
-            department: {
-              $inQuery: {
-                where: {
-                  name: { $in: unitArr },
-                },
-                className: 'Department',
-              }
-            },
-          },
-        ],
-      },
-    };
-    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);
-    let unitPhoneList = new Set<string>(); //出版单位联系人
-    let notUnitPhoneList = new Set<string>(); //出版单位联系人
-    list.map(item=> {
-      if(item?.get('profileSubmitted')?.get('user')?.get('phone')){
-        // unitPhoneList.add(item?.get('profileSubmitted')?.get('user')?.get('phone'))
-        unitPhoneList.add(item?.get('name'))
-      }else{
-        notUnitPhoneList.add(item?.get('name'))
-      }
-    })
-    let a = Array.from(unitPhoneList), b = Array.from(notUnitPhoneList)
-    console.log('已注册联系:', Array.from(unitPhoneList));
-    console.log('未注册联系:',Array.from(notUnitPhoneList));
-    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 += ` &nbsp;${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`);
-  }
-
-  /* 获取高等教育出版社教材 */
-  async getGdjy(){
-    let queryParams: any = {
-      where: {
-        $or: [
-          {
-            childrens: {
-              $inQuery: {
-                where: {
-                  "editionUnit": '高等教育出版社',
-                },
-                className: 'EduTextbookVolume',
-              }
-            },
-          },
-        ],
-      },
-    };
-    let query = Parse.Query.fromJSON('EduTextbook', queryParams);
-    query.equalTo('status', '400');
-    query.notEqualTo('isDeleted', true);
-    query.notEqualTo('discard', true);
-    query.include('user');
-    query.limit(2000);
-    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 += `&nbsp;${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> = [];
-    let isDate = false;
-    // 监测空值
-    list?.forEach((item: Parse.Object) => {
-      if (
-        isDate ||
-        Object.prototype.toString.call(item.get(filed)).indexOf('Date') != -1
-      ) {
-        arr.push(
-          this.formatTime('YYYY-mm-dd', item.get(filed)) +
-            '/' +
-            item.get('printNumber')
-        );
-        isDate = true;
-      } else {
-        arr.push(item.get(filed));
-      }
-    });
-    let j = Array.from(arr).join(',');
-    if (!isDate) {
-      j = Array.from(new Set(arr)).join(' ');
-    }
-    return j || '-';
-  }
-  //导出表格
-  async exportEduTextbook() {
-    let unitName = '科学出版社'
-    try {
-      let queryParams: any = {
-        where: {
-          $or: [
-            {
-              childrens: {
-                $inQuery: {
-                  where: {
-                    "editionUnit": unitName,
-                  },
-                  className: 'EduTextbookVolume',
-                }
-              },
-            },
-          ],
-        },
-      };
-      let query = Parse.Query.fromJSON('EduTextbook', queryParams);
-      // let query = new Parse.Query('EduTextbook');
-      query.notEqualTo('isDeleted', true);
-      query.notEqualTo('discard', true);
-      query.equalTo('render', true);
-      query.select(
-        'title',
-        'childrens.ISBN',
-        'childrens.author',
-        'childrens.printDate',
-        'childrens.printNumber',
-        'childrens.editionUnit',
-        'childrens.carrierShape',
-        'inviteUnit',
-        'user.department',
-        'department.branch',
-        'code'
-        // 'eduProcess.profileSubmitted',
-        // 'eduProcess.profileSubmitted.email',
-        // 'eduProcess.profileSubmitted.user.name',
-        // 'eduProcess.profileSubmitted.user.phone'
-      );
-      // query.containedIn('status', ['102', '103', '200', '201', '400']);
-      query.containedIn('status',['400'])
-      // query.containedIn('objectId',updateDept.list5)
-      query.ascending('createdAt');
-      let count = await query.count();
-      console.log(count);
-      query.limit(2000);
-      query.skip(0);
-      let data = await query.find();
-      let table = `<table border="1px" cellspacing="0" cellpadding="0">
-          <thead>
-            <tr>
-              <th>序号</th>
-              <th>申报教材名称</th>
-              <th>第一主编/作者</th>
-              <th>ISBN</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 = '';
-      for (var row = 0; row < data.length; row++) {
-        // console.log(data[row].get('user')?.get('department'));
-        let inviteUnit = data[row]?.get('inviteUnit');
-        if (
-          data[row]?.get('department')?.get('branch') == '省级教育行政部门' ||
-          data[row]?.get('department')?.get('branch') ==
-            '有关部门(单位)教育司(局)'
-        ) {
-          let parentMap = await this.formatNode(
-            data[row].get('user')?.get('department')?.id
-          );
-          inviteUnit = parentMap[2]?.title;
-        }
-        _body += '<tr>';
-        _body += '<td>';
-        _body += `${row}`;
-        _body += '</td>';
-
-        _body += '<td>';
-        _body += ` &nbsp;${data[row].get('title') || '-'}`;
-        _body += '</td>';
-
-        // _body += '<td>';
-        // _body += `&nbsp;${data[row].get('code') || ''}`;
-        // _body += '</td>';
-
-        // _body += '<td>';
-        // _body += `&nbsp;${data[row].get('inviteUnit') || ''}`;
-        // _body += '</td>';
-
-        // _body += '<td>';
-        // _body += `&nbsp;${data[row]?.get('eduProcess')?.get('profileSubmitted')?.get('user')?.get('name') || ''}`;
-        // _body += '</td>';
-
-        // _body += '<td>';
-        // _body += `&nbsp;${data[row]?.get('eduProcess')?.get('profileSubmitted')?.get('user')?.get('phone') || ''}`;
-        // _body += '</td>';
-
-        // _body += '<td>';
-        // _body += `&nbsp;${data[row]?.get('eduProcess')?.get('profileSubmitted')?.get('email') || ''}`;
-        // _body += '</td>';
-
-        _body += '<td>';
-        _body += `${this.fromatFiled(data[row]?.get('childrens'), 'author')}`;
-        _body += '</td>';
-
-        _body += '<td>';
-        _body += `&nbsp;${this.fromatFiled(
-          data[row]?.get('childrens'),
-          'ISBN'
-        )}`;
-        _body += '</td>';
-
-        _body += '<td>';
-        _body += `${this.fromatFiled(
-          data[row]?.get('childrens'),
-          'editionUnit'
-        )}`;
-        _body += '</td>';
-
-        _body += '<td>';
-        _body += `${inviteUnit}`;
-        _body += '</td>';
-
-        _body += '<td>';
-        _body += `${this.fromatFiled(
-          data[row]?.get('childrens'),
-          'printDate'
-        )}`;
-        _body += '</td>';
-
-        _body += '<td>';
-        _body += `${this.fromatFiled(data[row]?.get('childrens'), 'carrierShape')}`;
-        _body += '</td>';
-
-        _body += '</tr>';
-      }
-      table += _body;
-      table += '</tbody>';
-      table += '</table>';
-      // let title = '已提交教材';
-      this.excel(table, `${unitName}.xls`);
-    } catch (err) {
-      console.log(err);
-    }
-  }
-  excel(data: any, filename: string) {
-    let html =
-      "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>";
-    html +=
-      '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">';
-    html += '<meta http-equiv="content-type" content="application/vnd.ms-excel';
-    html += '; charset=UTF-8">';
-    html += '<head>';
-    html += '</head>';
-    html += '<body>';
-    html += data;
-    html += '</body>';
-    html += '</html>';
-    let uri =
-      'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(html);
-    let link = document.createElement('a');
-    link.href = uri;
-    link.download = `${filename}`;
-    document.body.appendChild(link);
-    link.click();
-    document.body.removeChild(link);
-  }
-
-  /* 发送出版社及教师通知短信 */
-  async sendNoticeMSG() {
-    let teacherList = new Set<string>();
-    let unitList = new Set<string>(); //单位出版社
-
-    let query = new Parse.Query('EduTextbook');
-    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.limit(10000);
-    let r = await query.find();
-    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);
-    let last = teacherArr.slice(5000,5999)
-    last.push(...['13581837652','13407973043','18510409671'])
-    console.log(last);
-
-    let arr:any = [
-      // teacherArr.slice(0,999), 
-      // teacherArr.slice(1000,1999),
-      // teacherArr.slice(2000,2999),
-      // teacherArr.slice(3000,3999),
-      // teacherArr.slice(4000,4999),
-      last
-    ]
-    // arr.forEach((list:any)=> {
-    //   Parse.Cloud.run('aliSmsSend', {
-    //     mobileList: [list],
-    //     templateCode: 'SMS_474205136',
-    //     params: {},
-    //     signName: '普通高等教育教材网',
-    //   });
-    // })
-
-    // return
-    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')
-    queryEduProcess.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)
-    unitPhoneArr.push(...['13581837652','13407973043','18510409671'])
-    
-    // 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)
-    }
-  }
 }