Skip to content

Commit

Permalink
fix: Change logic for check proper jeonse price
Browse files Browse the repository at this point in the history
  • Loading branch information
Minjae-vincent committed Jul 18, 2024
1 parent 857c666 commit 41d9a2f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public JeonseCheckList checkJeonse(String actlNo) {
String[] parsedAddress = splitAddress(jeonse.getAddress());

String isViolation = buildingRegisterMapper.findBuildingViolationByAddress(parsedAddress[0], parsedAddress[1], parsedAddress[2], parsedAddress[3]);
if(isViolation == null){
if (isViolation == null) {
isViolation = "정상건축물";
}

Expand All @@ -152,6 +152,10 @@ public JeonseCheckList checkJeonse(String actlNo) {
}
AppropriateJeonse appropriateJeonsePrice = getAppropriateJeonsePrice(jeonse);

boolean isAppropriateJeonsePrice =
jeonse.getPrc() >= appropriateJeonsePrice.getJeonsePrice() * 0.9 &&
jeonse.getPrc() <= appropriateJeonsePrice.getJeonsePrice() * 1.1;


return JeonseCheckList.builder()
.jeonse(jeonse)
Expand All @@ -166,7 +170,7 @@ public JeonseCheckList checkJeonse(String actlNo) {
.isViolation(isViolation)
.build())
.appropriateJeonsePrice(JeonseCheckList.AppropriateJeonsePrice.builder()
.success(jeonse.getPrc() < appropriateJeonsePrice.getJeonsePrice())
.success(isAppropriateJeonsePrice)
.jeonsePrice(appropriateJeonsePrice.getJeonsePrice())
.infrastructureNum(JeonseCheckList.AppropriateJeonsePrice.InfrastructureNum.builder()
.school(appropriateJeonsePrice.getInfrastructureNum().getSchool())
Expand Down

0 comments on commit 41d9a2f

Please sign in to comment.