101 lines
3.3 KiB
HTML
101 lines
3.3 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://yx.gs.sgcc.com.cn/" />
|
|
<meta name="sgclaw-expected-domain" content="yx.gs.sgcc.com.cn" />
|
|
<title>Light Enrichment Expansion Fixture</title>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
const sourceUrl = "http://yx.gs.sgcc.com.cn/report";
|
|
const headers = { "Content-Type": "application/json" };
|
|
const workUrl =
|
|
"http://yx.gs.sgcc.com.cn/report/customerApply/getWkorderAll";
|
|
|
|
async function reportExpansion() {
|
|
const mode = "month";
|
|
const month = "04";
|
|
const reportType = "asset";
|
|
const groupedData = {};
|
|
|
|
const mainResponse = await axios.post(
|
|
workUrl,
|
|
window.encrypt_old({
|
|
wkOrderNo: "",
|
|
countyCodeName: "",
|
|
pageNo: 1,
|
|
pageSize: 500
|
|
}),
|
|
{ headers }
|
|
);
|
|
|
|
const queryMeterInfoApi = async (data) => {
|
|
const url =
|
|
"http://yx.gscc.com.cn/report/customerApply/queryMeterInfo";
|
|
const response = await axios.post(
|
|
url,
|
|
window.encrypt_old({
|
|
appNo: data.wkOrderNo,
|
|
countyCodeName: data.countyCodeName
|
|
}),
|
|
{ headers }
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
const queryTransformerInfoApi = async (item) => {
|
|
const url =
|
|
"http://yx.gscc.com.cn/report/customerApply/queryTransformerInfo";
|
|
const response = await axios.post(
|
|
url,
|
|
window.encrypt_old({
|
|
appNo: item.wkOrderNo
|
|
}),
|
|
{ headers }
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
const rows = mainResponse.data || [];
|
|
for (const item of rows) {
|
|
const { countyCodeName } = item;
|
|
if (!groupedData[countyCodeName]) {
|
|
groupedData[countyCodeName] = {
|
|
countyCodeName,
|
|
meterTotalThisMonth: 0,
|
|
meterCapacityThisMonth: 0,
|
|
transformerTotalThisMonth: 0,
|
|
transformerCapacityThisMonth: 0,
|
|
thisMonthShare: 0
|
|
};
|
|
}
|
|
}
|
|
|
|
for (const item of rows) {
|
|
const meterInfo = await queryMeterInfoApi(item);
|
|
const transformerInfo = await queryTransformerInfoApi(item);
|
|
if (meterInfo && meterInfo.status === 200 && mode === "month" && reportType) {
|
|
groupedData[item.countyCodeName].month = month;
|
|
}
|
|
await com(meterInfo, item.countyCodeName, "meterCapacityThisMonth", "meterTotalThisMonth");
|
|
await com(transformerInfo, item.countyCodeName, "transformerCapacityThisMonth", "transformerTotalThisMonth");
|
|
}
|
|
|
|
const titleList = [
|
|
["index", "Index", ""],
|
|
["countyCodeName", "Org", ""],
|
|
["meterTotalThisMonth", "This Month", "Meter Count"],
|
|
["meterCapacityThisMonth", "This Month", "Meter Capacity"],
|
|
["transformerTotalThisMonth", "This Month", "Transformer Count"],
|
|
["transformerCapacityThisMonth", "This Month", "Transformer Capacity"],
|
|
["thisMonthShare", "This Month", "Capacity Share"]
|
|
];
|
|
|
|
return { groupedData, titleList };
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|