中化加油站项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

163 lines
4.9 KiB

import { Type } from "class-transformer";
import { ConfigManager } from "src/app/babylon/controller/config-manager";
import { TsTool } from "src/app/babylon/tool/ts-tool";
import { FacilityType } from "../../model-data/model-data-facility";
import { FacilityDatasByType } from "../../model-data/model-edit-data";
import { PropertyData_JYJ } from "../facility/property-data/in/property-data-jyj";
import { PropertyData_SYGX } from "../facility/property-data/in/property-data-sygx";
import { PropertyData_YG } from "../facility/property-data/in/property-data-yg";
import { PropertyData_YQHSGX } from "../facility/property-data/in/property-data-yqhsgx";
/**
* 需要导出的数据
*/
export class ExportData {
// @Type(() => ExportData_JYJ)
加油机: ExportData_JYJ[] = [];
// @Type(() => ExportData_YG)
油罐: ExportData_YG[] = [];
// @Type(() => ExportData_SYGX)
输油管线: ExportData_SYGX[] = [];
// @Type(() => ExportData_YQHS)
油气回收: ExportData_YQHS[] = [];
// @Type(() => ExportData_XFSB)
消防设备: ExportData_XFSB[] = [];
constructor(facilityByTypes: FacilityDatasByType[]) {
for (let i = 0; i < facilityByTypes.length; i++) {
let facilities = facilityByTypes[i].facilities;
if (facilities == null) {
continue;
}
let type = facilityByTypes[i].facilityType;
if (TsTool.stringContain(type, "XF_")) {
if (facilityByTypes[i].facilities.length > 0) {
this..push(new ExportData_XFSB(facilityByTypes[i]));
}
}
for (let j = 0; j < facilities.length; j++) {
switch (type) {
case FacilityType.JY_JYJ: this.加油机.push(new ExportData_JYJ(facilities[j].propertyData as PropertyData_JYJ));
break;
case FacilityType.JY_YG: this.油罐.push(new ExportData_YG(facilities[j].propertyData as PropertyData_YG));
break;
case FacilityType.JY_SYGX: this.输油管线.push(new ExportData_SYGX(facilities[j].propertyData as PropertyData_SYGX));
break;
case FacilityType.JY_YQHSGX: this.油气回收.push(new ExportData_YQHS(facilities[j].propertyData as PropertyData_YQHSGX));
break;
}
}
}
}
}
/**
* 加油机信息
*/
export class ExportData_JYJ {
名称: string;
品牌: string;
油枪数量: string;
油品品号: string;
油枪编号: string;
油泵类型: string;
流量: string;
功率: string;
constructor(jyj_property: PropertyData_JYJ) {
this. = jyj_property.name;
this. = jyj_property.brand;
this. = jyj_property.oilGunNum;
this. = jyj_property.oilProductNo;
this. = jyj_property.oilGunNo;
this. = jyj_property.oilPumpType;
this. = jyj_property.flow;
this. = jyj_property.power;
}
}
/**
* 油罐信息
*/
export class ExportData_YG {
名称: string;
油品品号: string;
油枪编号: string;
油罐容积: string;
安全容积: string;
罐区: string;
油罐类型: string;
constructor(yg_property: PropertyData_YG) {
this. = yg_property.name;
this. = yg_property.oilProductNo;
this. = yg_property.oilGunNo;
this. = yg_property.oilTankVolume;
this. = yg_property.safeVolume;
this. = yg_property.tankFarm;
this. = yg_property.oilTankType;
}
}
/**
* 输油管线
*/
export class ExportData_SYGX {
名称: string;
连接的加油机: string;
连接的油罐: string;
constructor(sygx_property: PropertyData_SYGX) {
this. = sygx_property.name;
this. = sygx_property.linkJYJ;
this. = sygx_property.linkYG;
}
}
/**
* 油气回收
*/
export class ExportData_YQHS {
名称: string;
油气回收系统类型: string;
油气回收泵类型: string;
constructor(yqhs_property: PropertyData_YQHSGX) {
this. = yqhs_property.name;
this. = yqhs_property.VRUType;
this. = yqhs_property.VRUPumpType;
}
}
/**
* 导出的消防设备信息
*/
export class ExportData_XFSB {
名称: string;
数目: string;
constructor(facByType: FacilityDatasByType) {
this. = ConfigManager.getFacilityTypeName(facByType.facilityType);
this. = "0";
if (facByType.facilities != null) {
this. = facByType.facilities.length.toString();
}
this. += ConfigManager.getFacilityNumUnit(facByType.facilityType);
}
}