|
@@ -433,7 +433,9 @@ module.exports = app => {
|
|
|
const stgId = ctx.params.stgId;
|
|
|
const rptId = ctx.params.rptId;
|
|
|
const orgUuidName = ctx.params.orgName;
|
|
|
- const fileName = orgUuidName + '.PDF';
|
|
|
+ const orgFileName = orgUuidName + '.PDF';
|
|
|
+ const newUuidName = uuidV1();
|
|
|
+ const fileName = newUuidName + '.PDF'; // 要用新的uuid!!!
|
|
|
console.log('updating fileName: ' + fileName);
|
|
|
// await ctx.helper.saveStreamFile(stream, path.join(this.app.baseDir, 'app', 'public/archive', fileName));
|
|
|
const oss_result = await ctx.app.signPdfOss.put('archive/' + fileName, stream);
|
|
@@ -443,7 +445,7 @@ module.exports = app => {
|
|
|
// 判断是否存在已签名文档,存在则删除文档并删除签名记录
|
|
|
const pdfMsg = await ctx.curl(signConst.path.oss + '/sign/' + orgUuidName + '.PDF');
|
|
|
if (pdfMsg && pdfMsg.status === 200) {
|
|
|
- const oss_reuslt = await ctx.app.signPdfOss.delete('archive/sign/' + fileName);
|
|
|
+ const oss_reuslt = await ctx.app.signPdfOss.delete('archive/sign/' + orgFileName);
|
|
|
if (oss_reuslt && oss_reuslt.res && oss_reuslt.res.status === 204) {
|
|
|
const delSign_result = await ctx.service.netcasignLog.removeSign(orgUuidName);
|
|
|
} else {
|
|
@@ -451,7 +453,6 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const newUuidName = uuidV1();
|
|
|
// const body = await this._updateArchiveCommon(ctx, prjId, stgId, rptId, orgUuidName, []);
|
|
|
const body = await this._updateArchiveCommon(ctx, prjId, stgId, rptId, newUuidName, []); // 只管用新的uuid,此方法中会自动删除最旧的那个记录及相关PDF文档
|
|
|
ctx.body = body;
|