|
@@ -0,0 +1,38 @@
|
|
|
+// 计算变更令,正负变更数
|
|
|
+
|
|
|
+const defaultInfo = require('../app/const/tender_info');
|
|
|
+const BaseUtil = require('./baseUtils');
|
|
|
+const querySql = BaseUtil.querySql;
|
|
|
+const ZhCalc = BaseUtil.ZhCalc;
|
|
|
+
|
|
|
+const saveJSON = async function(obj, file) {
|
|
|
+ let defineStr = JSON.stringify(obj, '', '\t');
|
|
|
+ await BaseUtil.saveBufferFile(defineStr, file);
|
|
|
+};
|
|
|
+
|
|
|
+const loadReportArchiveData = async function() {
|
|
|
+ const tid = 4417, sOrder = 2;
|
|
|
+ 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) {
|
|
|
+ ra.content = ra.content ? JSON.parse(ra.content) : [];
|
|
|
+ console.log(BaseUtil.getFileName('rptArchive.json'));
|
|
|
+ await saveJSON(ra, BaseUtil.getFileName('rptArchive.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) : [];
|
|
|
+ await saveJSON(rs, BaseUtil.getFileName('rptSign.json'));
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const doCompleteTest = async function() {
|
|
|
+ try {
|
|
|
+ await loadReportArchiveData();
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
+ BaseUtil.closePool();
|
|
|
+};
|
|
|
+
|
|
|
+doCompleteTest();
|