|
@@ -173,8 +173,37 @@ module.exports = app => {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- async _updateReportArchiveEncryption(prjId, stgId, rptId, ttlPgs, uuid, content) {
|
|
|
- //
|
|
|
+ async _updateReportArchiveAdhocInfo(ctx, params) {
|
|
|
+ const userId = ctx.session.sessionUser.accountId;
|
|
|
+ const prjId = params.prjId;
|
|
|
+ const stgId = params.stgId;
|
|
|
+ const rptId = params.rptId;
|
|
|
+ const ttlPgs = params.ttlPgs;
|
|
|
+ const uuid = params.uuid;
|
|
|
+ const reportName = params.reportName;
|
|
|
+ const reportAreas = params.signatureAreas;
|
|
|
+ // 这里要更新zh_rpt_archive表的相关数据
|
|
|
+ const orgArchiveList = await ctx.service.rptArchive.getPrjStgArchive(prjId, stgId);
|
|
|
+ if (orgArchiveList.length > 0) {
|
|
|
+ const contentArr = JSON.parse(orgArchiveList[0].content);
|
|
|
+ for (const item of contentArr) {
|
|
|
+ if (parseInt(item.rpt_id) === parseInt(rptId)) {
|
|
|
+ for (const rptItem of item.items) {
|
|
|
+ if (rptItem.uuid === uuid) {
|
|
|
+ rptItem.uid = userId;
|
|
|
+ rptItem.reportName = reportName;
|
|
|
+ rptItem.ttl_pages = ttlPgs;
|
|
|
+ rptItem.signature_area = reportAreas;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const updatedRst = await ctx.service.rptArchive.updateArchive(orgArchiveList[0].id, prjId, stgId, contentArr);
|
|
|
+ } else {
|
|
|
+ // 正常情况下不可能的分支
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
async addReportArchiveEncryption(ctx) {
|