傅行帆 hace 5 años
padre
commit
bf84fe715a

+ 6
- 0
src/main/java/com/huiju/estateagents/entity/TaBuilding.java Ver fichero

@@ -313,4 +313,10 @@ public class TaBuilding implements Serializable {
313 313
      * 户型类型id
314 314
      */
315 315
     private Integer buildingTypeId;
316
+
317
+    /**
318
+     * 价格类型
319
+     */
320
+    @TableField(exist = false)
321
+    private String priceType;
316 322
 }

+ 21
- 0
src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java Ver fichero

@@ -132,6 +132,27 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
132 132
 
133 133
                 List<TaBuildingImg> buildingListImg = taBuildingImgMapper.selectList(queryListWrapper);
134 134
                 taBuilding.setBuildingListImg(buildingListImg);
135
+
136
+                //获取项目类型里的价格
137
+                QueryWrapper<TaBuildingProjectType> projectTypeQueryWrapper = new QueryWrapper<>();
138
+                projectTypeQueryWrapper.eq("building_id",taBuilding.getBuildingId());
139
+                projectTypeQueryWrapper.eq("building_type_id",taBuilding.getBuildingTypeId());
140
+                TaBuildingProjectType taBuildingProjectType = taBuildingProjectTypeMapper.selectOne(projectTypeQueryWrapper);
141
+                //价格相同显示一个否则显示区间
142
+                if (null != taBuildingProjectType){
143
+                    Integer startPrice = taBuildingProjectType.getStartPrice();
144
+                    Integer endPrice = taBuildingProjectType.getEndPrice();
145
+                    if (null != startPrice || null != endPrice){
146
+                        if (startPrice == endPrice){
147
+                            taBuilding.setPrice(String.valueOf(startPrice));
148
+                        }else {
149
+                            taBuilding.setPrice(startPrice + "--" + endPrice);
150
+                        }
151
+                    }
152
+                    taBuilding.setPriceType(taBuildingProjectType.getPriceType());
153
+                }else {
154
+                    taBuilding.setPrice(null);
155
+                }
135 156
             }
136 157
         }
137 158