Commit 6c91fd87 by Milovan Samardzic

izmenaIndexAgreemnt

parent b799deb5
...@@ -14,6 +14,7 @@ import org.springframework.ui.Model; ...@@ -14,6 +14,7 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.math.BigDecimal;
import java.nio.DoubleBuffer; import java.nio.DoubleBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -41,7 +42,9 @@ public class OglasController ...@@ -41,7 +42,9 @@ public class OglasController
@Autowired @Autowired
LajkRepository lajkRepo; LajkRepository lajkRepo;
public static float round(double d, int decimalPlace) {
return BigDecimal.valueOf(d).setScale(decimalPlace,BigDecimal.ROUND_HALF_UP).floatValue();
}
@GetMapping("/novi-oglas") @GetMapping("/novi-oglas")
public String getNoviOglas(Model model, @AuthenticationPrincipal KorisnikDetails loggedUser) public String getNoviOglas(Model model, @AuthenticationPrincipal KorisnikDetails loggedUser)
{ {
...@@ -119,7 +122,7 @@ public class OglasController ...@@ -119,7 +122,7 @@ public class OglasController
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<String>();
for (Oglas o:listaOglasa) { for (Oglas o:listaOglasa) {
list.add(kRepo.findCity(o.getLokacijaId())); list.add(kRepo.findCity(o.getLokacijaId()));
prosecnaOcenaList.add(oRepo.averageOcenaByOglasId(o.getOglasId())); prosecnaOcenaList.add(round(oRepo.averageOcenaByOglasId(o.getOglasId()),2));
} }
model.addAttribute("gradovi",list); model.addAttribute("gradovi",list);
model.addAttribute("lokacije", lRepo.findAll()); model.addAttribute("lokacije", lRepo.findAll());
......
...@@ -154,9 +154,9 @@ ...@@ -154,9 +154,9 @@
<div class="col-lg-4"> <div class="col-lg-4">
<div class="features-icons-item mx-auto mb-0 mb-lg-3"> <div class="features-icons-item mx-auto mb-0 mb-lg-3">
<div class="features-icons-icon d-flex"><i class="bi-terminal m-auto text-primary"></i></div> <div class="features-icons-icon d-flex"><i class="bi-terminal m-auto text-primary"></i></div>
<img src="https://d2dlxvmcs24r4u.cloudfront.net/modules/portals/template1/images/box-3.png" height="60"> <img src="https://entreprenistapodcast.com/wp-content/uploads/2022/03/how-do-i-get-a-partnership-agreement.png" height="60">
<h3>Nekretnine na mapi</h3> <h3>Lako zakazivanje obilaska</h3>
<p class="lead mb-0">Pogledajte rezultate pretrage na mapi i otkrijte dostupne nekretnine na osnovu njihove tačne lokacije.</p> <p class="lead mb-0">Uz nasu aplikaciju mozete lako i brzo zakazati obilazak odabrane nekretnine i cetovati sa vlasnikom.</p>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment