|
@@ -4,6 +4,10 @@ import com.zksy.WaterSupply.WaterPlantInfo.domain.WaterPlantInfo;
|
|
|
import com.zksy.WaterSupply.WaterPlantInfo.service.IWaterPlantInfoService;
|
|
import com.zksy.WaterSupply.WaterPlantInfo.service.IWaterPlantInfoService;
|
|
|
import com.zksy.WaterSupply.PumpStationInfo.domain.PumpStationInfo;
|
|
import com.zksy.WaterSupply.PumpStationInfo.domain.PumpStationInfo;
|
|
|
import com.zksy.WaterSupply.PumpStationInfo.service.IPumpStationInfoService;
|
|
import com.zksy.WaterSupply.PumpStationInfo.service.IPumpStationInfoService;
|
|
|
|
|
+import com.zksy.WaterSupply.WaterFireHydrantInfo.domain.WaterFireHydrantInfo;
|
|
|
|
|
+import com.zksy.WaterSupply.WaterFireHydrantInfo.service.IWaterFireHydrantInfoService;
|
|
|
|
|
+import com.zksy.WaterSupply.WaterUserInfo.domain.WaterUserInfo;
|
|
|
|
|
+import com.zksy.WaterSupply.WaterUserInfo.service.IWaterUserInfoService;
|
|
|
import com.zksy.base.domain.EquipmentBase;
|
|
import com.zksy.base.domain.EquipmentBase;
|
|
|
import com.zksy.base.domain.EquipmentStatus;
|
|
import com.zksy.base.domain.EquipmentStatus;
|
|
|
import com.zksy.base.domain.HazardHiddenAccount;
|
|
import com.zksy.base.domain.HazardHiddenAccount;
|
|
@@ -17,6 +21,7 @@ import com.zksy.base.service.ManholeBaseService;
|
|
|
import com.zksy.base.service.PipeNetworkBaseService;
|
|
import com.zksy.base.service.PipeNetworkBaseService;
|
|
|
import com.zksy.base.service.RiskAssessmentService;
|
|
import com.zksy.base.service.RiskAssessmentService;
|
|
|
import com.zksy.cockpit.foundation.CockpitDistrict;
|
|
import com.zksy.cockpit.foundation.CockpitDistrict;
|
|
|
|
|
+import com.zksy.cockpit.foundation.CockpitFacilityContract;
|
|
|
import com.zksy.cockpit.foundation.CockpitDistrictPrefix;
|
|
import com.zksy.cockpit.foundation.CockpitDistrictPrefix;
|
|
|
import com.zksy.cockpit.foundation.CockpitErrorCategory;
|
|
import com.zksy.cockpit.foundation.CockpitErrorCategory;
|
|
|
import com.zksy.cockpit.foundation.CockpitErrorPayload;
|
|
import com.zksy.cockpit.foundation.CockpitErrorPayload;
|
|
@@ -45,14 +50,18 @@ public class CockpitEntityDetailService {
|
|
|
private final HazardHiddenAccountService hazards;
|
|
private final HazardHiddenAccountService hazards;
|
|
|
private final RiskAssessmentService risks;
|
|
private final RiskAssessmentService risks;
|
|
|
private final ManholeBaseService manholes;
|
|
private final ManholeBaseService manholes;
|
|
|
|
|
+ private final IWaterUserInfoService users;
|
|
|
|
|
+ private final IWaterFireHydrantInfoService hydrants;
|
|
|
|
|
|
|
|
public CockpitEntityDetailService(PipeNetworkBaseService pipes, IWaterPlantInfoService plants,
|
|
public CockpitEntityDetailService(PipeNetworkBaseService pipes, IWaterPlantInfoService plants,
|
|
|
IPumpStationInfoService stations, EquipmentBaseService equipment,
|
|
IPumpStationInfoService stations, EquipmentBaseService equipment,
|
|
|
DrainageGateInfoService gates, DrainageStorageInfoService storages,
|
|
DrainageGateInfoService gates, DrainageStorageInfoService storages,
|
|
|
- EquipmentStatusService equipmentStatuses, HazardHiddenAccountService hazards, RiskAssessmentService risks, ManholeBaseService manholes) {
|
|
|
|
|
|
|
+ EquipmentStatusService equipmentStatuses, HazardHiddenAccountService hazards, RiskAssessmentService risks, ManholeBaseService manholes,
|
|
|
|
|
+ IWaterUserInfoService users, IWaterFireHydrantInfoService hydrants) {
|
|
|
this.pipes = pipes; this.plants = plants; this.stations = stations;
|
|
this.pipes = pipes; this.plants = plants; this.stations = stations;
|
|
|
this.equipment = equipment; this.gates = gates; this.storages = storages;
|
|
this.equipment = equipment; this.gates = gates; this.storages = storages;
|
|
|
this.equipmentStatuses = equipmentStatuses; this.hazards = hazards; this.risks = risks; this.manholes = manholes;
|
|
this.equipmentStatuses = equipmentStatuses; this.hazards = hazards; this.risks = risks; this.manholes = manholes;
|
|
|
|
|
+ this.users = users; this.hydrants = hydrants;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public CockpitEntityDetailResponse load(String requestId, String categoryValue, String entityId) {
|
|
public CockpitEntityDetailResponse load(String requestId, String categoryValue, String entityId) {
|
|
@@ -64,6 +73,10 @@ public class CockpitEntityDetailService {
|
|
|
case WATER_PLANT: return plant(requestId, id);
|
|
case WATER_PLANT: return plant(requestId, id);
|
|
|
case PUMP_STATION: return station(requestId, id);
|
|
case PUMP_STATION: return station(requestId, id);
|
|
|
case ENGINEERING_FACILITY: return engineeringFacility(requestId, id);
|
|
case ENGINEERING_FACILITY: return engineeringFacility(requestId, id);
|
|
|
|
|
+ case DRAINAGE_GATE: return drainageGate(requestId, id);
|
|
|
|
|
+ case DRAINAGE_STORAGE: return drainageStorage(requestId, id);
|
|
|
|
|
+ case WATER_USER: return waterUser(requestId, id);
|
|
|
|
|
+ case WATER_FIRE_HYDRANT: return waterFireHydrant(requestId, id);
|
|
|
case MANHOLE: return manhole(requestId, id);
|
|
case MANHOLE: return manhole(requestId, id);
|
|
|
case EMERGENCY_RESOURCE: return resource(requestId, id);
|
|
case EMERGENCY_RESOURCE: return resource(requestId, id);
|
|
|
case HAZARD: return hazard(requestId, id);
|
|
case HAZARD: return hazard(requestId, id);
|
|
@@ -79,7 +92,7 @@ public class CockpitEntityDetailService {
|
|
|
put(a,"managementUnit",v.getManagementUnit()); put(a,"lengthMeters",v.getLength()); put(a,"diameterMillimeters",v.getDiameter());
|
|
put(a,"managementUnit",v.getManagementUnit()); put(a,"lengthMeters",v.getLength()); put(a,"diameterMillimeters",v.getDiameter());
|
|
|
put(a,"material",v.getMaterial()); put(a,"buildDate",v.getBuildDate()); put(a,"remark",v.getRemark());
|
|
put(a,"material",v.getMaterial()); put(a,"buildDate",v.getBuildDate()); put(a,"remark",v.getRemark());
|
|
|
Integer district = CockpitDistrictPrefix.codeOf(v.getNetworkCode());
|
|
Integer district = CockpitDistrictPrefix.codeOf(v.getNetworkCode());
|
|
|
- return response(requestId,"PIPE_NETWORK",v.getNetworkId(),v.getNetworkCode(),v.getNetworkName(),v.getStatus(),
|
|
|
|
|
|
|
+ return response(requestId,"PIPE_NETWORK",v.getNetworkId(),v.getNetworkCode(),v.getNetworkName(),CockpitFacilityContract.normalizeStatus(v.getStatus()),
|
|
|
v.getLocation(),district,new CockpitEntityDetailResponse.Coordinates(v.getStartLongitude(),v.getStartLatitude(),v.getEndLongitude(),v.getEndLatitude()),a,v.getUpdateTime());
|
|
v.getLocation(),district,new CockpitEntityDetailResponse.Coordinates(v.getStartLongitude(),v.getStartLatitude(),v.getEndLongitude(),v.getEndLatitude()),a,v.getUpdateTime());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -88,16 +101,16 @@ public class CockpitEntityDetailService {
|
|
|
Map<String,Object> a=map(); put(a,"waterSourceType",v.getWaterSourceType()); put(a,"designCapacity",v.getDesignCapacity());
|
|
Map<String,Object> a=map(); put(a,"waterSourceType",v.getWaterSourceType()); put(a,"designCapacity",v.getDesignCapacity());
|
|
|
put(a,"currentCapacity",v.getCurrentCapacity()); put(a,"treatmentProcess",v.getTreatmentProcess()); put(a,"commissionDate",v.getCommissionDate());
|
|
put(a,"currentCapacity",v.getCurrentCapacity()); put(a,"treatmentProcess",v.getTreatmentProcess()); put(a,"commissionDate",v.getCommissionDate());
|
|
|
put(a,"waterQualityStandard",v.getWaterQualityStandard()); put(a,"principal",v.getPrincipal()); put(a,"contactPhone",v.getContactPhone()); put(a,"remark",v.getRemark());
|
|
put(a,"waterQualityStandard",v.getWaterQualityStandard()); put(a,"principal",v.getPrincipal()); put(a,"contactPhone",v.getContactPhone()); put(a,"remark",v.getRemark());
|
|
|
- return response(requestId,"WATER_PLANT",String.valueOf(v.getId()),v.getPlantCode(),v.getPlantName(),v.getStatus(),v.getLocation(),null,
|
|
|
|
|
|
|
+ return response(requestId,"WATER_PLANT",String.valueOf(v.getId()),v.getPlantCode(),v.getPlantName(),CockpitFacilityContract.normalizeStatus(v.getStatus()),v.getLocation(),null,
|
|
|
new CockpitEntityDetailResponse.Coordinates(v.getLongitude(),v.getLatitude(),null,null),a,v.getUpdateTime());
|
|
new CockpitEntityDetailResponse.Coordinates(v.getLongitude(),v.getLatitude(),null,null),a,v.getUpdateTime());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private CockpitEntityDetailResponse station(String requestId, String id) {
|
|
private CockpitEntityDetailResponse station(String requestId, String id) {
|
|
|
PumpStationInfo v=stations.getById(id); if(v==null) throw missing();
|
|
PumpStationInfo v=stations.getById(id); if(v==null) throw missing();
|
|
|
- Map<String,Object>a=map(); put(a,"stationType",v.getStationType()); put(a,"pumpCount",v.getPumpCount()); put(a,"designFlow",v.getDesignFlow());
|
|
|
|
|
|
|
+ Map<String,Object>a=map(); put(a,"stationType",CockpitFacilityContract.pumpStationTypeCode(v.getStationType())); put(a,"pumpCount",v.getPumpCount()); put(a,"designFlow",v.getDesignFlow());
|
|
|
put(a,"designHead",v.getDesignHead()); put(a,"powerCapacity",v.getPowerCapacity()); put(a,"commissionDate",v.getCommissionDate());
|
|
put(a,"designHead",v.getDesignHead()); put(a,"powerCapacity",v.getPowerCapacity()); put(a,"commissionDate",v.getCommissionDate());
|
|
|
put(a,"principal",v.getPrincipal()); put(a,"contactPhone",v.getContactPhone()); put(a,"remark",v.getRemark());
|
|
put(a,"principal",v.getPrincipal()); put(a,"contactPhone",v.getContactPhone()); put(a,"remark",v.getRemark());
|
|
|
- return response(requestId,"PUMP_STATION",String.valueOf(v.getId()),v.getStationCode(),v.getStationName(),v.getStatus(),v.getLocation(),null,
|
|
|
|
|
|
|
+ return response(requestId,"PUMP_STATION",String.valueOf(v.getId()),v.getStationCode(),v.getStationName(),CockpitFacilityContract.normalizeStatus(v.getStatus()),v.getLocation(),null,
|
|
|
new CockpitEntityDetailResponse.Coordinates(v.getLongitude(),v.getLatitude(),null,null),a,v.getUpdateTime());
|
|
new CockpitEntityDetailResponse.Coordinates(v.getLongitude(),v.getLatitude(),null,null),a,v.getUpdateTime());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -105,28 +118,44 @@ public class CockpitEntityDetailService {
|
|
|
private CockpitEntityDetailResponse engineeringFacility(String requestId, String id) {
|
|
private CockpitEntityDetailResponse engineeringFacility(String requestId, String id) {
|
|
|
// 闸门与调蓄设施分表存储,id 全局唯一:先查闸门,未命中再查调蓄
|
|
// 闸门与调蓄设施分表存储,id 全局唯一:先查闸门,未命中再查调蓄
|
|
|
com.zksy.drainage.domain.DrainageGateInfo gate = gates.getEntityById(id);
|
|
com.zksy.drainage.domain.DrainageGateInfo gate = gates.getEntityById(id);
|
|
|
- if (gate != null) {
|
|
|
|
|
- Map<String,Object> a = drainageFacilityAttributes(gate);
|
|
|
|
|
- put(a, "facilityType", "gate");
|
|
|
|
|
- put(a, "designHead", gate.getDesignHead());
|
|
|
|
|
- return response(requestId, "DRAINAGE_GATE", gate.getFacilityId(), gate.getFacilityCode(),
|
|
|
|
|
- gate.getFacilityName(), gate.getStatus(), gate.getLocation(), null,
|
|
|
|
|
- new CockpitEntityDetailResponse.Coordinates(gate.getLongitude(), gate.getLatitude(), null, null),
|
|
|
|
|
- a, gate.getUpdateTime());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (gate != null) return gateDetail(requestId, gate);
|
|
|
com.zksy.drainage.domain.DrainageStorageInfo storage = storages.getEntityById(id);
|
|
com.zksy.drainage.domain.DrainageStorageInfo storage = storages.getEntityById(id);
|
|
|
- if (storage != null) {
|
|
|
|
|
- Map<String,Object> a = drainageFacilityAttributes(storage);
|
|
|
|
|
- put(a, "facilityType", "storage");
|
|
|
|
|
- put(a, "storageCapacity", storage.getStorageCapacity());
|
|
|
|
|
- return response(requestId, "DRAINAGE_STORAGE", storage.getFacilityId(), storage.getFacilityCode(),
|
|
|
|
|
- storage.getFacilityName(), storage.getStatus(), storage.getLocation(), null,
|
|
|
|
|
- new CockpitEntityDetailResponse.Coordinates(storage.getLongitude(), storage.getLatitude(), null, null),
|
|
|
|
|
- a, storage.getUpdateTime());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (storage != null) return storageDetail(requestId, storage);
|
|
|
throw missing();
|
|
throw missing();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private CockpitEntityDetailResponse drainageGate(String requestId, String id) {
|
|
|
|
|
+ com.zksy.drainage.domain.DrainageGateInfo gate = gates.getEntityById(id);
|
|
|
|
|
+ if (gate == null) throw missing();
|
|
|
|
|
+ return gateDetail(requestId, gate);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private CockpitEntityDetailResponse drainageStorage(String requestId, String id) {
|
|
|
|
|
+ com.zksy.drainage.domain.DrainageStorageInfo storage = storages.getEntityById(id);
|
|
|
|
|
+ if (storage == null) throw missing();
|
|
|
|
|
+ return storageDetail(requestId, storage);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private CockpitEntityDetailResponse gateDetail(String requestId, com.zksy.drainage.domain.DrainageGateInfo gate) {
|
|
|
|
|
+ Map<String,Object> a = drainageFacilityAttributes(gate);
|
|
|
|
|
+ put(a, "facilityType", "gate");
|
|
|
|
|
+ put(a, "designHead", gate.getDesignHead());
|
|
|
|
|
+ return response(requestId, "DRAINAGE_GATE", gate.getFacilityId(), gate.getFacilityCode(),
|
|
|
|
|
+ gate.getFacilityName(), CockpitFacilityContract.normalizeStatus(gate.getStatus()), gate.getLocation(), null,
|
|
|
|
|
+ new CockpitEntityDetailResponse.Coordinates(gate.getLongitude(), gate.getLatitude(), null, null),
|
|
|
|
|
+ a, gate.getUpdateTime());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private CockpitEntityDetailResponse storageDetail(String requestId, com.zksy.drainage.domain.DrainageStorageInfo storage) {
|
|
|
|
|
+ Map<String,Object> a = drainageFacilityAttributes(storage);
|
|
|
|
|
+ put(a, "facilityType", "storage");
|
|
|
|
|
+ put(a, "storageCapacity", storage.getStorageCapacity());
|
|
|
|
|
+ return response(requestId, "DRAINAGE_STORAGE", storage.getFacilityId(), storage.getFacilityCode(),
|
|
|
|
|
+ storage.getFacilityName(), CockpitFacilityContract.normalizeStatus(storage.getStatus()), storage.getLocation(), null,
|
|
|
|
|
+ new CockpitEntityDetailResponse.Coordinates(storage.getLongitude(), storage.getLatitude(), null, null),
|
|
|
|
|
+ a, storage.getUpdateTime());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private Map<String,Object> drainageFacilityAttributes(DrainageFacilityBase v) {
|
|
private Map<String,Object> drainageFacilityAttributes(DrainageFacilityBase v) {
|
|
|
Map<String,Object> a = map();
|
|
Map<String,Object> a = map();
|
|
|
put(a, "facilityLevel", v.getFacilityLevel());
|
|
put(a, "facilityLevel", v.getFacilityLevel());
|
|
@@ -139,6 +168,49 @@ public class CockpitEntityDetailService {
|
|
|
return a;
|
|
return a;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private CockpitEntityDetailResponse waterUser(String requestId, String id) {
|
|
|
|
|
+ WaterUserInfo v = users.getById(id);
|
|
|
|
|
+ if (v == null) throw missing();
|
|
|
|
|
+ Map<String,Object> a = map();
|
|
|
|
|
+ put(a, "userCode", v.getUserCode());
|
|
|
|
|
+ put(a, "userName", v.getUserName());
|
|
|
|
|
+ put(a, "userType", v.getUserType());
|
|
|
|
|
+ put(a, "address", v.getAddress());
|
|
|
|
|
+ put(a, "contactPerson", v.getContactPerson());
|
|
|
|
|
+ put(a, "contactPhone", v.getContactPhone());
|
|
|
|
|
+ put(a, "meterNumber", v.getMeterNumber());
|
|
|
|
|
+ put(a, "initialReading", v.getInitialReading());
|
|
|
|
|
+ put(a, "currentReading", v.getCurrentReading());
|
|
|
|
|
+ put(a, "annualWaterConsumption", v.getAnnualWaterConsumption());
|
|
|
|
|
+ put(a, "remark", v.getRemark());
|
|
|
|
|
+ return response(requestId, "WATER_USER", v.getId(), v.getUserCode(), v.getUserName(),
|
|
|
|
|
+ CockpitFacilityContract.normalizeStatus(v.getStatus()), null, null,
|
|
|
|
|
+ new CockpitEntityDetailResponse.Coordinates(v.getLongitude(), v.getLatitude(), null, null),
|
|
|
|
|
+ a, v.getUpdateTime());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private CockpitEntityDetailResponse waterFireHydrant(String requestId, String id) {
|
|
|
|
|
+ WaterFireHydrantInfo v = hydrants.getById(id);
|
|
|
|
|
+ if (v == null) throw missing();
|
|
|
|
|
+ Map<String,Object> a = map();
|
|
|
|
|
+ put(a, "hydrantCode", v.getHydrantCode());
|
|
|
|
|
+ put(a, "hydrantName", v.getHydrantName());
|
|
|
|
|
+ put(a, "hydrantType", v.getHydrantType());
|
|
|
|
|
+ put(a, "model", v.getModel());
|
|
|
|
|
+ put(a, "inletPipeDiameter", v.getInletPipeDiameter());
|
|
|
|
|
+ put(a, "outletSpec", v.getOutletSpec());
|
|
|
|
|
+ put(a, "ownershipUnit", v.getOwnershipUnit());
|
|
|
|
|
+ put(a, "maintenanceUnit", v.getMaintenanceUnit());
|
|
|
|
|
+ put(a, "principal", v.getPrincipal());
|
|
|
|
|
+ put(a, "contactPhone", v.getContactPhone());
|
|
|
|
|
+ put(a, "location", v.getLocation());
|
|
|
|
|
+ put(a, "remark", v.getRemark());
|
|
|
|
|
+ return response(requestId, "WATER_FIRE_HYDRANT", v.getHydrantId(), v.getHydrantCode(), v.getHydrantName(),
|
|
|
|
|
+ CockpitFacilityContract.normalizeStatus(v.getStatus()), v.getLocation(), null,
|
|
|
|
|
+ new CockpitEntityDetailResponse.Coordinates(v.getLongitude(), v.getLatitude(), null, null),
|
|
|
|
|
+ a, v.getUpdateTime());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 窨井详情(维护者 2026-11-16)。
|
|
* 窨井详情(维护者 2026-11-16)。
|
|
@@ -157,7 +229,7 @@ public class CockpitEntityDetailService {
|
|
|
put(a, "ownershipUnit", v.getOwnershipUnit());
|
|
put(a, "ownershipUnit", v.getOwnershipUnit());
|
|
|
put(a, "remark", v.getRemark());
|
|
put(a, "remark", v.getRemark());
|
|
|
return response(requestId, "MANHOLE", v.getManholeId(), v.getManholeCode(), v.getManholeName(),
|
|
return response(requestId, "MANHOLE", v.getManholeId(), v.getManholeCode(), v.getManholeName(),
|
|
|
- v.getStatus(), v.getLocation(), null,
|
|
|
|
|
|
|
+ CockpitFacilityContract.normalizeStatus(v.getStatus()), v.getLocation(), null,
|
|
|
new CockpitEntityDetailResponse.Coordinates(v.getLongitude(), v.getLatitude(), null, null),
|
|
new CockpitEntityDetailResponse.Coordinates(v.getLongitude(), v.getLatitude(), null, null),
|
|
|
a, v.getUpdateTime());
|
|
a, v.getUpdateTime());
|
|
|
}
|
|
}
|