49 lines
1.5 KiB
HTML
49 lines
1.5 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="sgclaw-scene-kind" content="report_collection" />
|
|
<meta name="sgclaw-target-url" content="http://south.95598.sgcc.com.cn/" />
|
|
<meta name="sgclaw-expected-domain" content="south.95598.sgcc.com.cn" />
|
|
<title>Local Document Pipeline Fixture</title>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
const sourceUrl = "http://south.95598.sgcc.com.cn/report";
|
|
|
|
async function runServiceMonthlyReport() {
|
|
const sourceRows = await BrowserAction("sgBrowerserJsAjax2", {
|
|
url: "http://localhost:13313/configServices/selectData",
|
|
callback: "selectData"
|
|
});
|
|
await $.ajax({
|
|
url: "http://localhost:13313/configServices/selectData",
|
|
type: "POST",
|
|
contentType: "application/json",
|
|
data: JSON.stringify({ tableName: "service_monthly_raw", rows: sourceRows })
|
|
});
|
|
const summary = await definedSqlQuery(
|
|
"select city, count(*) as total from service_monthly_raw group by city"
|
|
);
|
|
return docExport({
|
|
template: "95598-service-monthly.docx",
|
|
data: summary
|
|
});
|
|
}
|
|
|
|
async function definedSqlQuery(sql) {
|
|
return $.ajax({
|
|
url: "http://localhost:13313/configServices/definedSqlQuery",
|
|
type: "POST",
|
|
contentType: "application/json",
|
|
data: JSON.stringify({ sql })
|
|
});
|
|
}
|
|
|
|
function docExport(payload) {
|
|
return BrowserAction("docExport", payload);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|