|
@@ -54,7 +54,13 @@ const querySql = async function(sql, sqlParam) {
|
|
};
|
|
};
|
|
|
|
|
|
const loadLedgerDataFromOss = async function(url) {
|
|
const loadLedgerDataFromOss = async function(url) {
|
|
- const File = await ossClient.get(options.hisOssPath + url);
|
|
|
|
|
|
+ let File;
|
|
|
|
+ try {
|
|
|
|
+ File = await ossClient.get(options.hisOssPath + url);
|
|
|
|
+ } catch(err) {
|
|
|
|
+ if (err.status === 404) return 0;
|
|
|
|
+ throw err;
|
|
|
|
+ }
|
|
if (File.res.status !== 200) return '获取修订台账有误';
|
|
if (File.res.status !== 200) return '获取修订台账有误';
|
|
const result = JSON.parse(File.content);
|
|
const result = JSON.parse(File.content);
|
|
return result.length;
|
|
return result.length;
|
|
@@ -69,6 +75,7 @@ const doCompleteLedgerHis = async function(l) {
|
|
|
|
|
|
const doComplete = async function() {
|
|
const doComplete = async function() {
|
|
try {
|
|
try {
|
|
|
|
+ //const ledgerHis = await querySql('Select * From zh_ledger_history where bills_count = 0 order by id asc');
|
|
const ledgerHis = await querySql('Select * From zh_ledger_history');
|
|
const ledgerHis = await querySql('Select * From zh_ledger_history');
|
|
for (const l of ledgerHis) {
|
|
for (const l of ledgerHis) {
|
|
await doCompleteLedgerHis(l);
|
|
await doCompleteLedgerHis(l);
|