|
@@ -12,7 +12,8 @@ const saveJSON = async function(obj, file) {
|
|
|
|
|
|
const loadReportArchiveData = async function() {
|
|
|
//const tid = 4417, sOrder = 2;
|
|
|
- const tid = 3698, sOrder = 7;
|
|
|
+ // const tid = 3698, sOrder = 7;
|
|
|
+ const tid = 5161, sOrder = 8;
|
|
|
const stage = await querySql('SELECT * FROM zh_stage where tid = ? and `order` = ?', [tid, sOrder]);
|
|
|
const rptArchive = await querySql('SELECT * FROM zh_rpt_archive where stage_id = ?', [stage[0].id]);
|
|
|
for (const ra of rptArchive) {
|
|
@@ -20,16 +21,22 @@ const loadReportArchiveData = async function() {
|
|
|
console.log(BaseUtil.getFileName('rptArchive.json'));
|
|
|
await saveJSON(ra, BaseUtil.getFileName('rptArchive.json'));
|
|
|
|
|
|
- const roleContent = [];
|
|
|
- for (const c of ra.content) {
|
|
|
- console.log(c.rpt_id, stage[0].id);
|
|
|
- const rptRole = await querySql('SELECT * FROM zh_role_rpt_rel WHERE sid = ? and rpt_id = ?', [stage[0].id, c.rpt_id]);
|
|
|
- if (rptRole.length > 0) {
|
|
|
- if (rptRole[0].rel_content) roleContent.push(JSON.stringify(rptRole[0].rel_content));
|
|
|
- }
|
|
|
- }
|
|
|
- await saveJSON(roleContent, BaseUtil.getFileName('roleContent.json'));
|
|
|
+ // for (const c of ra.content) {
|
|
|
+ // console.log(c.rpt_id, stage[0].id);
|
|
|
+ // const rptRole = await querySql('SELECT * FROM zh_role_rpt_rel WHERE sid = ? and rpt_id = ?', [stage[0].id, c.rpt_id]);
|
|
|
+ // if (rptRole.length > 0) {
|
|
|
+ // if (rptRole[0].rel_content) roleContent.push(JSON.parse(rptRole[0].rel_content));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // await saveJSON(roleContent, BaseUtil.getFileName('roleContent.json'));
|
|
|
+ }
|
|
|
+ const roleContent = [];
|
|
|
+ const rptRole = await querySql('SELECT * FROM zh_role_rpt_rel WHERE sid = ?', [stage[0].id]);
|
|
|
+ for (const rp of rptRole) {
|
|
|
+ if (rp.rel_content) roleContent.push(JSON.parse(rp.rel_content));
|
|
|
}
|
|
|
+ await saveJSON(roleContent, BaseUtil.getFileName('roleContent.json'));
|
|
|
+
|
|
|
const rptSign = await querySql('SELECT * FROM zh_rpt_archive_encryption where stage_id = ?', [stage[0].id]);
|
|
|
for (const rs of rptSign) {
|
|
|
rs.content = rs.content ? JSON.parse(rs.content) : [];
|
|
@@ -50,7 +57,7 @@ const findRole = async function() {
|
|
|
|
|
|
const doCompleteTest = async function() {
|
|
|
try {
|
|
|
- // await loadReportArchiveData();
|
|
|
+ await loadReportArchiveData();
|
|
|
// await findRole();
|
|
|
} catch (err) {
|
|
|
console.log(err);
|