123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- $(function () {
- "use strict";
- if (_.isUndefined(BWA.Chart) || _.isUndefined(BWA.Chart.FormulaGet)) {
- throw new Error('need chart.get.helper.js');
- return;
- }
- var FormulaGet = BWA.Chart.FormulaGet;
- function EnergyUsageStatusGet(siteId) {
- this.base = FormulaGet;
- this.base(siteId);
- }
- EnergyUsageStatusGet.prototype = FormulaGet.prototype;
- EnergyUsageStatusGet.prototype.constructor = EnergyUsageStatusGet;
- var searchConditions = EnergyUsageStatusGet.SearchConditions = {};
- var CODE = $Code,
- FuelType = CODE.FuelType,
- FT = CODE.FacilityType,
- FC = CODE.FacilityCode,
- F = CODE.Formula;
- searchConditions[FuelType.ELECTRICITY] = {
- FacilityTypeId: FT.ELECTRICITY,
- FacilityCode: FC.ELECTRICITY,
- FormulaId: F[FT.ELECTRICITY].TOTAL_ELECTRICITY_AMOUNT,
- };
- searchConditions[FuelType.GAS] = {
- FacilityTypeId: FT.GAS,
- FacilityCode: FC.GAS,
- FormulaId: F[FT.GAS].TOTAL_GAS_AMOUNT,
- };
- searchConditions[FuelType.WATER] = {
- FacilityTypeId: FT.WATER,
- FacilityCode: FC.WATER,
- FormulaId: F[FT.WATER].TOTAL_WATER_AMOUNT,
- };
- EnergyUsageStatusGet.prototype.requestGetForUsgaeStatus = function (fuelTypeId, timeIntervalType) {
- //alert('requestGetForUsgaeStatus'); // hcLee
- var self = this;
- return function (startDate, endDate) {
- var parameters = _.extend(searchConditions[fuelTypeId], {
- TimeIntervalType: timeIntervalType,
- StartDate: startDate,
- EndDate: endDate
- });
- return self.apiGet(parameters);
- }
- };
- BWA.Chart.EnergyUsageStatusGet = EnergyUsageStatusGet;
- });
|