湖北征信商铺定制接口

This commit is contained in:
2026-01-28 17:09:12 +08:00
parent 7898ccbc1a
commit 8bdb7b595c
4 changed files with 43 additions and 22 deletions
@@ -139,7 +139,7 @@ public class CommercialController {
}
}
Double lng = json.getDouble("lng");
Double lat = json.getDouble("lat");
Double lat = json.getDouble("lat");
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(lng, lat, model.getMinPrice(), model.getMaxPrice(), "shop_sell", 5);
List<BusinessCaseDto> dtos = createSample(houseSelf, "sell", ratio, lng, lat);
mav.setModel(BasicModel.buildOKModel().setResult(dtos));
@@ -147,9 +147,10 @@ public class CommercialController {
BasicModel.markNoDataRequest();
}
}
}else{
mav.setModel(BasicModel.buildServerErrorModel().setMsg(json.getString("msg")));
}
// else{
// mav.setModel(BasicModel.buildServerErrorModel().setMsg(json.getString("msg")));
// }
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
@@ -252,7 +253,7 @@ public class CommercialController {
dto.setSize(jsonObject.getDouble("size"));
if(jsonObject.containsKey("type")){
dto.setType(jsonObject.getString("type"));
dto.setEstateType(jsonObject.getString("type"));
}
if(jsonObject.containsKey("floor")){
dto.setFloor(jsonObject.getInt("floor"));
@@ -280,11 +281,11 @@ public class CommercialController {
if(ratio != null){
Integer totalPrice = (int)(sample.getTotalPrice().intValue() * ratio);
if(cat.equals("rent")){
Double dayPrice = totalPrice/sample.getSize()*30;
Double dayPrice = totalPrice/(sample.getSize()*30);
dto.setUnitPrice(DataUtil.getDoubleRound(2, dayPrice));
}else{
Integer avgPrie = (int)(totalPrice/sample.getSize());
dto.setUnitPrice(avgPrie);
Integer avgPrice = BigDecimal.valueOf(totalPrice/sample.getSize()).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
dto.setUnitPrice(avgPrice);
}
dto.setTotalPrice(totalPrice);
}else{
@@ -298,7 +299,7 @@ public class CommercialController {
}
dto.setSize(sample.getSize());
if(StringUtils.isNotBlank(sample.getType())){
dto.setType(sample.getType());
dto.setEstateType(sample.getType());
}
if(sample.getFloor()!=null){
dto.setFloor(sample.getFloor());
@@ -366,8 +367,27 @@ public class CommercialController {
JSONObject json = locationEvaluateApi(model, AvmUrls.SHOPRENT_EVALUATE);
if (json != null) {
if (json.containsKey("msg") && "成功".equals(json.getString("msg"))) {
if (json.containsKey("case")) {
List<BusinessCaseDto> dtos = createBusiness((JSONArray) json.get("case"), "rent", ratio);
if (json.containsKey("unitPrice") && json.containsKey("lng")) {
Double minPrice = null;
Double maxPrice = null;
if(json.get("unitPrice") != null){
Double unitPrice = (Double) json.get("unitPrice");
minPrice = unitPrice - unitPrice * 0.1;
maxPrice = unitPrice + unitPrice * 0.1;
}else{
if(model.getMinPrice() != null && model.getMinPrice()>0){
minPrice = model.getMinPrice().doubleValue();
}
if(model.getMaxPrice() != null && model.getMaxPrice()>0){
minPrice = model.getMaxPrice().doubleValue();
}
}
Double lng = json.getDouble("lng");
Double lat = json.getDouble("lat");
List<DealSample> houseSelf = dealSampleService.querySampleByLocation(lng, lat, DataUtil.getDoubleRound(2, minPrice), DataUtil.getDoubleRound(2, maxPrice), "shop_rent", 5);
List<BusinessCaseDto> dtos = createSample(houseSelf, "rent", ratio, lng, lat);
mav.setModel(BasicModel.buildOKModel().setResult(dtos));
@@ -375,9 +395,10 @@ public class CommercialController {
BasicModel.markNoDataRequest();
}
}
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg(json.getString("msg")));
}
// else {
// mav.setModel(BasicModel.buildServerErrorModel().setMsg(json.getString("msg")));
// }
} else {
mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中..."));
}
@@ -1143,7 +1143,7 @@ public class OfficeController {
}
if(StringUtils.isNotBlank(house.getEstateType())){
dto.setType(house.getEstateType());
dto.setEstateType(house.getEstateType());
}
if(StringUtils.isNotBlank(house.getLocation()) && district.getLat()!=null){
@@ -1198,7 +1198,7 @@ public class OfficeController {
}
if(StringUtils.isNotBlank(house.getType())){
dto.setType(house.getType());
dto.setEstateType(house.getType());
}
Map<String, Double> locationMap = (Map) house.getLocation();
@@ -853,7 +853,7 @@ public class OfficeSellController {
}
if(StringUtils.isNotBlank(house.getEstateType())){
dto.setType(house.getEstateType());
dto.setEstateType(house.getEstateType());
}
if(StringUtils.isNotBlank(house.getLocation()) && district.getLat()!=null){
@@ -894,7 +894,7 @@ public class OfficeSellController {
Double dayPrice = totalPrice/(house.getSize()*30);
dto.setUnitPrice(DataUtil.getDoubleRound(2, dayPrice));
}else{
Integer avgPrie = (int)(totalPrice/house.getSize());
Integer avgPrie = BigDecimal.valueOf(totalPrice/house.getSize()).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
dto.setUnitPrice(avgPrie);
}
dto.setTotalPrice(totalPrice);
@@ -910,7 +910,7 @@ public class OfficeSellController {
}
if(StringUtils.isNotBlank(house.getType())){
dto.setType(house.getType());
dto.setEstateType(house.getType());
}
Map<String, Double> locationMap = (Map) house.getLocation();
@@ -12,7 +12,7 @@ public class BusinessCaseDto {
private Integer totalPrice;//总价(单位:元)
private Integer floor;//所在楼层
private String caseDate;//案例时间(如: 2013-07-12)
private String type;//类型
private String estateType;//类型
public String getId() {
return id;
@@ -102,11 +102,11 @@ public class BusinessCaseDto {
this.caseDate = caseDate;
}
public String getType() {
return type;
public String getEstateType() {
return estateType;
}
public void setType(String type) {
this.type = type;
public void setEstateType(String estateType) {
this.estateType = estateType;
}
}