Skip to content

Commit

Permalink
Merge pull request #1083 from nehaniua/Dev-2.0
Browse files Browse the repository at this point in the history
 Edcr Rules Configuration changes and Anonymous edcr service call changes frontend
  • Loading branch information
rahul01987 authored May 6, 2024
2 parents 5856044 + d02a723 commit 881eb15
Show file tree
Hide file tree
Showing 33 changed files with 3,548 additions and 1,531 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public class Floor extends Measurement {
private List<BigDecimal> floorHeights;
private List<Room> acRooms = new ArrayList<>();
private List<Room> regularRooms = new ArrayList<>();
private List<Room> habitationRooms = new ArrayList<>();
private List<Room> storeRooms = new ArrayList<>();
private Room kitchen;
private Room bathRoom;
private Room waterClosets;
Expand All @@ -92,9 +94,12 @@ public class Floor extends Measurement {
private InteriorOpenSpace interiorOpenSpace = new InteriorOpenSpace();
private MeasurementWithHeight verandah = new MeasurementWithHeight();
private MeasurementWithHeight lightAndVentilation = new MeasurementWithHeight();
private MeasurementWithHeight bathVentilation = new MeasurementWithHeight();
private MeasurementWithHeight waterClosetVentilation = new MeasurementWithHeight();
private List<RoofArea> roofAreas = new ArrayList<>();

private List<Balcony> balconies = new ArrayList<>();
private Boolean isStiltFloor;

private List<Measurement> overHangs;

Expand Down Expand Up @@ -419,6 +424,14 @@ public Boolean getTerrace() {
public void setTerrace(Boolean terrace) {
this.terrace = terrace;
}

public Boolean getIsStiltFloor() {
return isStiltFloor;
}

public void setIsStiltFloor(Boolean isStiltFloor) {
this.isStiltFloor = isStiltFloor;
}

public ParkingDetails getParking() {
return parking;
Expand Down Expand Up @@ -463,6 +476,36 @@ public void addRegularRoom(Room regularRoom) {
public void setRegularRooms(List<Room> regularRooms) {
this.regularRooms = regularRooms;
}

public List<Room> getHabitationRooms() {
return habitationRooms;
}

public void addHabitationRooms(Room habitationRooms) {
this.habitationRooms.add(habitationRooms);
}

/**
* @param habitationRooms the habitationRooms to set
*/
public void setHabitationRooms(List<Room> habitationRooms) {
this.habitationRooms = habitationRooms;
}

public List<Room> getStoreRooms() {
return storeRooms;
}

public void addStoreRooms(Room storeRooms) {
this.storeRooms.add(storeRooms);
}

/**
* @param storeRooms the storeRooms to set
*/
public void setStoreRooms(List<Room> storeRooms) {
this.storeRooms = storeRooms;
}

public Room getKitchen() {
return kitchen;
Expand Down Expand Up @@ -579,6 +622,22 @@ public MeasurementWithHeight getLightAndVentilation() {
public void setLightAndVentilation(MeasurementWithHeight lightAndVentilation) {
this.lightAndVentilation = lightAndVentilation;
}

public MeasurementWithHeight getBathVentilaion() {
return bathVentilation;
}

public void setBathVentilation(MeasurementWithHeight bathVentilation) {
this.bathVentilation = bathVentilation;
}

public MeasurementWithHeight getWaterClosetVentilation() {
return waterClosetVentilation;
}

public void setWaterClosetVentilation(MeasurementWithHeight waterClosetVentilation) {
this.waterClosetVentilation = waterClosetVentilation;
}

public List<RoofArea> getRoofAreas() {
return roofAreas;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ public class Room {
private List<Measurement> rooms = new ArrayList<>();

private MeasurementWithHeight lightAndVentilation = new MeasurementWithHeight();
private MeasurementWithHeight bathVentilation = new MeasurementWithHeight();

private List<Occupancy> mezzanineAreas = new ArrayList<>();

private List<Measurement> waterClosetVentialtion = new ArrayList<>();

public List<RoomHeight> getHeights() {
return heightOfRooms;
}
Expand Down Expand Up @@ -113,7 +116,26 @@ public MeasurementWithHeight getLightAndVentilation() {
public void setLightAndVentilation(MeasurementWithHeight lightAndVentilation) {
this.lightAndVentilation = lightAndVentilation;
}

public MeasurementWithHeight getBathVentilation() {
return bathVentilation;
}

/**
* @param lightAndVentilation the lightAndVentilation to set
*/
public void setVentilation(MeasurementWithHeight bathVentilation) {
this.bathVentilation = bathVentilation;
}


public List<Measurement> getWaterClosetVentilation() {
return waterClosetVentialtion;
}

public void setWaterClosetVentilation(List<Measurement> waterClosetVentialtion) {
this.waterClosetVentialtion = waterClosetVentialtion;
}
public List<Measurement> getRooms() {
return rooms;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
insert into state.egdcr_layername(id,key,value,createdby,createddate,lastmodifiedby,lastmodifieddate,version)
select nextval('state.seq_egdcr_layername'),'LAYER_NAME_BATH_VENTILATION','BLK_%s_FLR_%s_BATH_VENTILATION_%s',1,now(),1,now(),0 where not exists(select key from state.egdcr_layername where key='LAYER_NAME_BATH_VENTILATION');

insert into state.egdcr_layername(id,key,value,createdby,createddate,lastmodifiedby,lastmodifieddate,version)
select nextval('state.seq_egdcr_layername'),'LAYER_NAME_WATER_CLOSET_VENTILATION','BLK_%s_FLR_%s_WATER_CLOSET_VENTILATION_%s',1,now(),1,now(),0 where not exists(select key from state.egdcr_layername where key='LAYER_NAME_WATER_CLOSET_VENTILATION');

insert into state.egdcr_layername(id,key,value,createdby,createddate,lastmodifiedby,lastmodifieddate,version)
select nextval('state.seq_egdcr_layername'),'LAYER_NAME_STORE_ROOM','BLK_%s_FLR_%s_STORE_ROOM_%s',1,now(),1,now(),0 where not exists(select key from state.egdcr_layername where key='LAYER_NAME_STORE_ROOM');

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.egov.common.entity.edcr.Block;
import org.egov.common.entity.edcr.Floor;
import org.egov.common.entity.edcr.OccupancyTypeHelper;
import org.egov.common.entity.edcr.Plan;
import org.egov.common.entity.edcr.Result;
Expand Down Expand Up @@ -173,6 +174,7 @@ public Plan process(Plan pl) {
if (StringUtils.isNotBlank(typeOfArea) && roadWidth != null) {
validateNumberOfFloors(pl, errors, typeOfArea, roadWidth);
validateHeightOfBuilding(pl, errors, typeOfArea, roadWidth);
validateHeightOfFloors(pl, errors);
}

validatePlinthHeight(pl, errors);
Expand Down Expand Up @@ -348,6 +350,125 @@ private void validateNumberOfFloors(Plan pl, HashMap<String, String> errors, Str
}
}
}

private void validateHeightOfFloors(Plan pl, HashMap<String, String> errors) {
System.out.println("inside height of floor");
for (Block block : pl.getBlocks()) {

boolean isAccepted = false;
ScrutinyDetail scrutinyDetail = new ScrutinyDetail();
scrutinyDetail.addColumnHeading(1, RULE_NO);
scrutinyDetail.addColumnHeading(2, FLOOR_NO);
scrutinyDetail.addColumnHeading(3, MIN_REQUIRED);
// scrutinyDetail.addColumnHeading(4, MAX_PERMISSIBLE);
scrutinyDetail.addColumnHeading(5, PROVIDED);
scrutinyDetail.addColumnHeading(6, STATUS);
scrutinyDetail.setKey("Block_" + block.getNumber() + "_" + "Height of Floor");
OccupancyTypeHelper occupancyTypeHelper = block.getBuilding().getMostRestrictiveFarHelper();
for (Floor floor : block.getBuilding().getFloors()) {
BigDecimal floorHeight = floor.getFloorHeights() != null ? floor.getFloorHeights().get(0)
: BigDecimal.ZERO;

int floorNumber = floor.getNumber();

// String status;
String minRequiredFloorHeight = StringUtils.EMPTY;
String maxPermissibleFloorHeight = StringUtils.EMPTY;

minRequiredFloorHeight = "2.75" + DcrConstants.IN_METER;
//maxPermissibleFloorHeight = "4.40" + DcrConstants.IN_METER;
floor.setIsStiltFloor(false);

if(floor.getIsStiltFloor() == false) {

if (floorHeight.compareTo(BigDecimal.valueOf(2.75)) >= 0
//&& floorHeight.compareTo(BigDecimal.valueOf(4.40)) <= 0
) {

// status = Result.Accepted.getResultVal();
isAccepted = true;
} }

else if(floor.getIsStiltFloor() == true) {

if (floorHeight.compareTo(BigDecimal.valueOf(2.5)) >= 0

) {

isAccepted = true;
}
}

// if (occupancyTypeHelper != null && occupancyTypeHelper.getType() != null
// && G.equals(occupancyTypeHelper.getType().getCode())) {
// minRequiredFloorHeight = "6.0" + DcrConstants.IN_METER;
// maxPermissibleFloorHeight = "-";
// if (floorHeight.compareTo(BigDecimal.valueOf(6.0)) >= 0) {
// /*
// * Map<String, String> details = new HashMap<>(); details.put(FLOOR_NO,
// * String.valueOf(floorNumber)); details.put(RULE_NO, RULE_38);
// * details.put(MIN_REQUIRED, minRequiredFloorHeight + DcrConstants.IN_METER);
// * details.put(MAX_PERMISSIBLE, "-"); details.put(PROVIDED,
// * floorHeight.toString() + DcrConstants.IN_METER); details.put(STATUS,
// * Result.Accepted.getResultVal()); scrutinyDetail.getDetail().add(details);
// * pl.getReportOutput().getScrutinyDetails().add(scrutinyDetail);
// */
//// status = Result.Accepted.getResultVal();
// isAccepted = true;
// } else {
// /*
// * Map<String, String> details = new HashMap<>(); details.put(FLOOR_NO,
// * String.valueOf(floorNumber)); details.put(RULE_NO, RULE_38);
// * details.put(MIN_REQUIRED, minRequiredFloorHeight + DcrConstants.IN_METER);
// * details.put(MAX_PERMISSIBLE, "-"); details.put(PROVIDED,
// * floorHeight.toString() + DcrConstants.IN_METER); details.put(STATUS,
// * Result.Not_Accepted.getResultVal()); scrutinyDetail.getDetail().add(details);
// * pl.getReportOutput().getScrutinyDetails().add(scrutinyDetail);
// */
//// status = Result.Not_Accepted.getResultVal();
//// isAccepted=false;
// }
// } else if (floorNumber < 0) {
// minRequiredFloorHeight = "2.40" + DcrConstants.IN_METER;
// maxPermissibleFloorHeight = "4.20" + DcrConstants.IN_METER;
// if (floorHeight.compareTo(BigDecimal.valueOf(2.40)) >= 0
// && floorHeight.compareTo(BigDecimal.valueOf(4.20)) <= 0) {
//
//// status = Result.Accepted.getResultVal();
// isAccepted = true;
// }
// } else {
// minRequiredFloorHeight = "2.75" + DcrConstants.IN_METER;
// maxPermissibleFloorHeight = "4.40" + DcrConstants.IN_METER;
// if (floorHeight.compareTo(BigDecimal.valueOf(2.75)) >= 0
// && floorHeight.compareTo(BigDecimal.valueOf(4.40)) <= 0) {
//
//// status = Result.Accepted.getResultVal();
// isAccepted = true;
// }
//}
// addFloorHeightDetails(pl, scrutinyDetail, String.valueOf(floorNumber), RULE_38,
// minRequiredFloorHeight + DcrConstants.IN_METER, maxPermissibleFloorHeight,
// floorHeight.toString() + DcrConstants.IN_METER, status);
if (errors.isEmpty() && StringUtils.isNotBlank(minRequiredFloorHeight)
&& StringUtils.isNotBlank(maxPermissibleFloorHeight)) {
Map<String, String> details = new HashMap<>();
details.put(FLOOR_NO, String.valueOf(floorNumber));
details.put(RULE_NO, RULE_38);
details.put(MIN_REQUIRED, minRequiredFloorHeight);
//details.put(MAX_PERMISSIBLE, maxPermissibleFloorHeight);
details.put(PROVIDED, floorHeight.toString() + DcrConstants.IN_METER);
details.put(STATUS,
isAccepted ? Result.Accepted.getResultVal() : Result.Not_Accepted.getResultVal());
scrutinyDetail.getDetail().add(details);
pl.getReportOutput().getScrutinyDetails().add(scrutinyDetail);

}
}

}
}


private void validateHeightOfBuilding(Plan pl, HashMap<String, String> errors, String typeOfArea,
BigDecimal roadWidth) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,22 @@ public Plan process(Plan pl) {
}
}

if (minHeight.compareTo(new BigDecimal(2.4)) >= 0
&& totalArea.compareTo(new BigDecimal(1.8)) >= 0
if(
// (minHeight.compareTo(new BigDecimal(2.4)) >= 0
// &&
totalArea.compareTo(new BigDecimal(1.8)) >= 0
&& minWidth.compareTo(new BigDecimal(1.2)) >= 0) {

details.put(REQUIRED, "Height >= 2.4, Total Area >= 1.8, Width >= 1.2");
details.put(PROVIDED, "Height >= " + minHeight + ", Total Area >= " + totalArea
details.put(REQUIRED," Total Area >= 1.8, Width >= 1.2");
details.put(PROVIDED, " Total Area >= " + totalArea
+ ", Width >= " + minWidth);
details.put(STATUS, Result.Accepted.getResultVal());
scrutinyDetail.getDetail().add(details);
pl.getReportOutput().getScrutinyDetails().add(scrutinyDetail);

} else {
details.put(REQUIRED, "Height >= 2.4, Total Area >= 1.8, Width >= 1.2");
details.put(PROVIDED, "Height >= " + minHeight + ", Total Area >= " + totalArea
details.put(REQUIRED, ", Total Area >= 1.8, Width >= 1.2");
details.put(PROVIDED, ", Total Area >= " + totalArea
+ ", Width >= " + minWidth);
details.put(STATUS, Result.Not_Accepted.getResultVal());
scrutinyDetail.getDetail().add(details);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public Plan validate(Plan pl) {

return pl;
}

//Method updated by Neha Sharma
@Override
public Plan process(Plan pl) {

Expand Down Expand Up @@ -127,10 +127,10 @@ public Plan process(Plan pl) {
}

if (minHeight.compareTo(new BigDecimal(2.4)) >= 0
&& totalArea.compareTo(new BigDecimal(2.8)) >= 0
&& minWidth.compareTo(new BigDecimal(1.2)) >= 0) {
&& totalArea.compareTo(new BigDecimal(1.1)) >= 0
&& minWidth.compareTo(new BigDecimal(0.9)) >= 0) {

details.put(REQUIRED, "Height >= 2.4, Total Area >= 2.8, Width >= 1.2");
details.put(REQUIRED, "Height >= 2.4, Total Area >= 1.1, Width >= 0.9");
details.put(PROVIDED, "Height >= " + minHeight + ", Total Area >= " + totalArea
+ ", Width >= " + minWidth);
details.put(STATUS, Result.Accepted.getResultVal());
Expand Down
Loading

0 comments on commit 881eb15

Please sign in to comment.