|
@@ -326,7 +326,7 @@ export class shellServer {
|
|
|
}
|
|
|
//导出表格
|
|
|
async exportEduTextbook() {
|
|
|
- let unitName = '科学出版社';
|
|
|
+ let unitName = '未提交';
|
|
|
try {
|
|
|
let queryParams: any = {
|
|
|
where: {
|
|
@@ -335,7 +335,8 @@ export class shellServer {
|
|
|
childrens: {
|
|
|
$inQuery: {
|
|
|
where: {
|
|
|
- editionUnit: unitName,
|
|
|
+ // editionUnit: unitName,
|
|
|
+ collectStatus:{$ne: '200'}
|
|
|
},
|
|
|
className: 'EduTextbookVolume',
|
|
|
},
|
|
@@ -378,7 +379,7 @@ export class shellServer {
|
|
|
let table = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
- <th>序号</th>
|
|
|
+ <th>申报编号</th>
|
|
|
<th>申报教材名称</th>
|
|
|
<th>第一主编/作者</th>
|
|
|
<th>ISBN</th>
|
|
@@ -393,9 +394,8 @@ export class shellServer {
|
|
|
// let table = `<table border="1px" cellspacing="0" cellpadding="0">
|
|
|
// <thead>
|
|
|
// <tr>
|
|
|
- // <th>序号</th>
|
|
|
+ // <th>申报编号</th>
|
|
|
// <th>申报教材名称</th>
|
|
|
- // <th>code</th>
|
|
|
// <th>所属单位</th>
|
|
|
// <th>单位联系人</th>
|
|
|
// <th>联系人电话</th>
|
|
@@ -420,17 +420,13 @@ export class shellServer {
|
|
|
}
|
|
|
_body += '<tr>';
|
|
|
_body += '<td>';
|
|
|
- _body += `${row}`;
|
|
|
+ _body += ` ${data[row].get('code') || ''}`;
|
|
|
_body += '</td>';
|
|
|
|
|
|
_body += '<td>';
|
|
|
_body += ` ${data[row].get('title') || '-'}`;
|
|
|
_body += '</td>';
|
|
|
|
|
|
- // _body += '<td>';
|
|
|
- // _body += ` ${data[row].get('code') || ''}`;
|
|
|
- // _body += '</td>';
|
|
|
-
|
|
|
// _body += '<td>';
|
|
|
// _body += ` ${data[row].get('inviteUnit') || ''}`;
|
|
|
// _body += '</td>';
|
|
@@ -642,28 +638,28 @@ export class shellServer {
|
|
|
/* 更新教材个别字段 */
|
|
|
async updateTextbook() {
|
|
|
let arr = []
|
|
|
- let list = updateDept.list5
|
|
|
+ let list = updateDept.list6
|
|
|
for (let index = 0; index < list.length; index++) {
|
|
|
const item = list[index];
|
|
|
- let oldc=item.code.substring(0,item.code.length-1)
|
|
|
- console.log(oldc);
|
|
|
+ // let oldc=item.code.substring(0,item.code.length-1)
|
|
|
+ // console.log(oldc);
|
|
|
let query = new Parse.Query('EduTextbook')
|
|
|
- query.equalTo('code',oldc)
|
|
|
- query.equalTo('title',item.title)
|
|
|
+ query.equalTo('code',item.code)
|
|
|
query.notEqualTo('isDeleted',true)
|
|
|
- // query.include('childrens')
|
|
|
- // query.select('childrens')
|
|
|
+ // query.equalTo('title',item.title)
|
|
|
+ query.include('childrens')
|
|
|
+ query.select('childrens')
|
|
|
let r = await query.find()
|
|
|
- // if(r.length <1 || r.length > 1 || r[0]?.get('childrens').length > 1){
|
|
|
- if(r.length !== 1){
|
|
|
+ if(r.length <1 || r.length > 1 || r[0]?.get('childrens').length > 1){
|
|
|
+ // if(r.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()
|
|
|
- r[0]?.set('code',item.code)
|
|
|
+ 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()
|
|
|
+ // r[0]?.set('code',item.code)
|
|
|
r[0]?.set('exportPDF',null)
|
|
|
await r[0]?.save()
|
|
|
console.log('update=>',item);
|