|
@@ -275,133 +275,17 @@ export class textbookServer {
|
|
|
// }
|
|
|
// }
|
|
|
// console.log(count);
|
|
|
-
|
|
|
- /* 开始时间 */
|
|
|
- // let query = new Parse.Query('EduTextbook')
|
|
|
- // // query.equalTo('num',null)
|
|
|
- // query.notEqualTo('isDeleted',true)
|
|
|
- // query.notEqualTo('user','6lcsp7jrYP')
|
|
|
- // // query.select('name','num')
|
|
|
+ // let query = new Parse.Query('EduProcess');
|
|
|
// query.limit(2000)
|
|
|
- // query.select('objectId')
|
|
|
- // let res = await query.find()
|
|
|
- // console.log(res);
|
|
|
- // for (let index = 0; index < res.length; index++) {
|
|
|
- // const item = res[index]
|
|
|
- // // item?.set('startDate', new Date('2024-08-05 8:00'));
|
|
|
- // // item?.set('deadline', new Date('2024-09-30 23:59'));
|
|
|
- // item.set('isDeleted',true)
|
|
|
- // await item.save()
|
|
|
- // console.log(count);
|
|
|
- // }
|
|
|
-
|
|
|
- /* 修改更新部门名称 */
|
|
|
- // let list = updateDept.list2
|
|
|
- // for (let index = 0; index < list.length; index++) {
|
|
|
- // const item = list[index]
|
|
|
- // let queryPareet = new Parse.Query('Department')
|
|
|
- // queryPareet.equalTo('code', item.code)
|
|
|
- // queryPareet.select('name')
|
|
|
- // let r = await queryPareet.first()
|
|
|
- // if(r?.id){
|
|
|
- // if(r.get('name') != item.new){
|
|
|
- // r.set('name',item.new)
|
|
|
- // await r.save()
|
|
|
- // let queryEdupro = new Parse.Query('EduProcess')
|
|
|
- // queryEdupro.equalTo('department', r.id)
|
|
|
- // queryEdupro.select('objectId')
|
|
|
- // let eduProcess = await queryEdupro.first()
|
|
|
- // eduProcess?.set('name', item.new);
|
|
|
- // eduProcess?.set('desc', item.new + '流程');
|
|
|
- // await eduProcess?.save()
|
|
|
- // count++
|
|
|
- // console.log('已修改:',item.old,item.new,count);
|
|
|
- // }
|
|
|
- // }else{
|
|
|
- // console.log('未找到code:',item);
|
|
|
- // }
|
|
|
+ // query.select('deadline')
|
|
|
+ // let eduProcess = await query.find()
|
|
|
+ // for (let index = 0; index < eduProcess.length; index++) {
|
|
|
+ // const item = eduProcess[index];
|
|
|
+ // item?.set('deadline', new Date('2024-09-30 16:00'));
|
|
|
+ // await item?.save()
|
|
|
+ // count++
|
|
|
+ // console.log(count);
|
|
|
// }
|
|
|
-
|
|
|
- /* 批量导入部门 */
|
|
|
- // let list = updateDept.list3
|
|
|
- // for (let index = 0; index < list.length; index++) {
|
|
|
- // const item = list[index];
|
|
|
- // let queryPareet = new Parse.Query('Department')
|
|
|
- // queryPareet.equalTo('name', item.name)
|
|
|
- // let dep = await queryPareet.first()
|
|
|
- // console.log(dep?.get('name'));
|
|
|
-
|
|
|
- // // for (let index = 0; index < prents.length; index++) {
|
|
|
- // // let item = prents[index];
|
|
|
- // let query = new Parse.Query('EduProcess')
|
|
|
- // query.equalTo('department',dep?.id)
|
|
|
- // query.notEqualTo('isDeleted',true)
|
|
|
- // let eduProcess = await query.first()
|
|
|
- // if(!eduProcess?.id){
|
|
|
- // console.log('不存在,新建'+dep?.get('name'),addCount);
|
|
|
- // let obj = Parse.Object.extend('EduProcess');
|
|
|
- // eduProcess = new obj()
|
|
|
- // }
|
|
|
- // eduProcess?.set('company', {
|
|
|
- // __type: 'Pointer',
|
|
|
- // className: 'Company',
|
|
|
- // objectId: 'RbIKpmuaMC',
|
|
|
- // });
|
|
|
- // eduProcess?.set('branch', {
|
|
|
- // __type: 'Pointer',
|
|
|
- // className: 'Department',
|
|
|
- // objectId:dep?.get('parent')?.id,
|
|
|
- // });
|
|
|
- // eduProcess?.set('department', {
|
|
|
- // __type: 'Pointer',
|
|
|
- // className: 'Department',
|
|
|
- // objectId: dep?.id,
|
|
|
- // });
|
|
|
- // eduProcess?.set('name', dep?.get('name'));
|
|
|
- // eduProcess?.set('desc',item.desc ? item.desc : dep?.get('name') + '流程');
|
|
|
- // eduProcess?.set('code', dep?.get('code') || dep?.id);
|
|
|
- // if(dep?.get('branch') == '出版单位') {
|
|
|
- // eduProcess?.set('startDate', new Date('2024-07-20 18:00'));
|
|
|
- // eduProcess?.set('deadline', new Date('2024-09-20 18:00'));
|
|
|
- // }
|
|
|
- // eduProcess?.set('num',item.num)
|
|
|
- // eduProcess?.set('status', '200');
|
|
|
- // await eduProcess?.save();
|
|
|
- // count ++
|
|
|
- // console.log('已完成'+dep?.get('name')+'流程');
|
|
|
- // console.log(count);
|
|
|
-
|
|
|
- // // }
|
|
|
- // }
|
|
|
-
|
|
|
- /* 去重出版单位 */
|
|
|
- let list = updateDept.list4;
|
|
|
- for (let index = 0; index < list.length; index++) {
|
|
|
- const item = list[index];
|
|
|
- let queryPareet = new Parse.Query('Department');
|
|
|
- queryPareet.equalTo('name', item);
|
|
|
- queryPareet.descending('createdAt');
|
|
|
- let dep = await queryPareet.find();
|
|
|
- for (let j = 0; j < dep.length; j++) {
|
|
|
- const e = dep[j];
|
|
|
- let queryEdupro = new Parse.Query('EduProcess');
|
|
|
- queryEdupro.equalTo('department', e.id);
|
|
|
- queryEdupro.select('objectId', 'profileSubmitted');
|
|
|
- queryEdupro.descending('createdAt');
|
|
|
- let eps = await queryEdupro.find();
|
|
|
- console.log(eps);
|
|
|
- if (eps.length > 1) {
|
|
|
- eps[0].set('isDeleted', true);
|
|
|
- await eps[0].save();
|
|
|
- }
|
|
|
- if (!eps || eps.length == 0) {
|
|
|
- e.set('isDeleted', true);
|
|
|
- await e.save();
|
|
|
- count++;
|
|
|
- }
|
|
|
- }
|
|
|
- console.log(count);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/* 获取所有未上传签名页附件教材 */
|