|
@@ -30,7 +30,7 @@ module.exports = app => {
|
|
|
* @returns {Promise<*>} - ledger_change下所有数据,并关联 project_account(读取提交人名称、单位、公司)
|
|
|
*/
|
|
|
async getReviseList (tid) {
|
|
|
- const sql = 'SELECT lc.id, lc.tid, lc.corder, lc.in_time, lc.uid, lc.begin_time, lc.end_time, lc.times, lc.status, lc.valid, lc.content,' +
|
|
|
+ const sql = 'SELECT lc.id, lc.tid, lc.corder, lc.in_time, lc.uid, lc.begin_time, lc.end_time, lc.times, lc.status, lc.valid, lc.content, lc.bills_file,' +
|
|
|
' pa.name As user_name, pa.role As user_role, pa.company As user_company' +
|
|
|
' FROM ' + this.tableName + ' As lc' +
|
|
|
' INNER JOIN ' + this.ctx.service.projectAccount.tableName + ' As pa ON lc.uid = pa.id' +
|
|
@@ -158,13 +158,13 @@ module.exports = app => {
|
|
|
async backupReviseHistoryFile(revise) {
|
|
|
const timestamp = (new Date()).getTime();
|
|
|
|
|
|
- const billsHis = '/revise/bills' + timestamp + '.json';
|
|
|
+ const billsHis = `${this.ctx.session.sessionProject.id}/${this.ctx.tender.id}/bills${timestamp}.json`;
|
|
|
const bills = await this.ctx.service.reviseBills.getData(revise.tid);
|
|
|
- await this.ctx.helper.saveBufferFile(JSON.stringify(bills), this.ctx.app.config.filePath + billsHis);
|
|
|
+ await this.ctx.app.hisOss.put(this.ctx.app.config.hisOssPath + billsHis, Buffer.from(JSON.stringify(bills), 'utf8'));
|
|
|
|
|
|
- const posHis = '/revise/pos' + timestamp + '.json';
|
|
|
+ const posHis = `${this.ctx.session.sessionProject.id}/${this.ctx.tender.id}/pos${timestamp}.json`;
|
|
|
const pos = await this.ctx.service.revisePos.getData(revise.tid);
|
|
|
- await this.ctx.helper.saveBufferFile(JSON.stringify(pos), this.ctx.app.config.filePath + posHis);
|
|
|
+ await this.ctx.app.hisOss.put(this.ctx.app.config.hisOssPath + posHis, Buffer.from(JSON.stringify(pos), 'utf8'));
|
|
|
|
|
|
return [billsHis, posHis];
|
|
|
}
|