Commit bf86d636 authored by lixuan's avatar lixuan

Merge branch 'dev-lx' into 'dev'

feat: 房源

See merge request !142
parents e9fae526 eddc7e0a
Pipeline #143317 passed with stages
in 5 minutes and 11 seconds
...@@ -163,8 +163,10 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -163,8 +163,10 @@ public class HouseResourceServiceImpl implements HouseResourceService {
collect.forEach((k, v) -> { collect.forEach((k, v) -> {
HouseResourceProfileGraph houseResourceProfileGraph = new HouseResourceProfileGraph(); HouseResourceProfileGraph houseResourceProfileGraph = new HouseResourceProfileGraph();
houseResourceProfileGraph.setId(k); houseResourceProfileGraph.setId(k);
GridRegion gridRegion = gridRegionMapper.selectByPrimaryKey(k); String wgName = gridRegionMapper.getWgNameByCode(k);
houseResourceProfileGraph.setWgName(gridRegion.getWgName()); if (StringUtils.hasText(wgName)) {
houseResourceProfileGraph.setWgName(wgName);
}
houseResourceProfileGraph.setHouseResources(handleHouseList(v)); houseResourceProfileGraph.setHouseResources(handleHouseList(v));
resourceProfileGraphList.add(houseResourceProfileGraph); resourceProfileGraphList.add(houseResourceProfileGraph);
}); });
...@@ -183,12 +185,18 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -183,12 +185,18 @@ public class HouseResourceServiceImpl implements HouseResourceService {
private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list) { private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list) {
list.forEach(x -> { list.forEach(x -> {
String wgNameByCode = gridRegionMapper.getWgNameByCode(x.getTwo()); GridRegionExample twoExample = new GridRegionExample();
if (StringUtils.hasText(wgNameByCode)) { twoExample.createCriteria().andWgTypeEqualTo(String.valueOf(x.getType())).andWgCodeEqualTo(x.getTwo());
x.setWgName2(wgNameByCode); List<GridRegion> two = gridRegionMapper.selectByExample(twoExample);
if (!CollectionUtils.isEmpty(two)) {
x.setWgName2(two.get(0).getWgName());
}
GridRegionExample threeExample = new GridRegionExample();
threeExample.createCriteria().andWgTypeEqualTo(String.valueOf(x.getType())).andWgCodeEqualTo(x.getThree());
List<GridRegion> three = gridRegionMapper.selectByExample(threeExample);
if (!CollectionUtils.isEmpty(three)) {
x.setWgName3(three.get(0).getWgName());
} }
GridRegion three = gridRegionMapper.selectByPrimaryKey(x.getThree());
x.setWgName3(three.getWgName());
x.setHouseResourceAttributeText(HouseEnums.HouseResourceAttributeEnum.getDescByCode(x.getHouseResourceAttribute())); x.setHouseResourceAttributeText(HouseEnums.HouseResourceAttributeEnum.getDescByCode(x.getHouseResourceAttribute()));
x.setHouseResourceTypeText(HouseEnums.HouseResourceTypeEnum.getDescByCode(x.getHouseResourceType())); x.setHouseResourceTypeText(HouseEnums.HouseResourceTypeEnum.getDescByCode(x.getHouseResourceType()));
x.setOrientationText(HouseEnums.OrientationEnum.getDescByCode(x.getOrientation())); x.setOrientationText(HouseEnums.OrientationEnum.getDescByCode(x.getOrientation()));
......
...@@ -139,10 +139,10 @@ ...@@ -139,10 +139,10 @@
<if test="query.houseNumber != null and query.houseNumber != ''"> <if test="query.houseNumber != null and query.houseNumber != ''">
and t1.house_number like concat('%', #{query.houseNumber}, '%') and t1.house_number like concat('%', #{query.houseNumber}, '%')
</if> </if>
</where>
<if test="query.sortWay != null and query.sortWay != ''"> <if test="query.sortWay != null and query.sortWay != ''">
order by t1.house_area ${query.sortWay} order by t1.house_area ${query.sortWay}
</if> </if>
</where>
</select> </select>
<select id="selectProfileGraph" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage"> <select id="selectProfileGraph" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
SELECT SELECT
...@@ -173,8 +173,8 @@ ...@@ -173,8 +173,8 @@
<if test="query.houseNumber != null and query.houseNumber != ''"> <if test="query.houseNumber != null and query.houseNumber != ''">
and t1.house_number like concat('%', #{query.houseNumber}, '%') and t1.house_number like concat('%', #{query.houseNumber}, '%')
</if> </if>
order by t1.four DESC
</where> </where>
order by t1.four DESC
</select> </select>
<select id="selectList" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage"> <select id="selectList" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
SELECT SELECT
......
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