Commit 07560d98 authored by lixuan's avatar lixuan

feat: 房源

parent 5d262b50
Pipeline #144330 failed with stages
in 32 minutes and 57 seconds
package com.ruoyi.system.domain.grid; package com.ruoyi.system.domain.grid;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
public class GridRegion implements Serializable { public class GridRegion implements Serializable {
private String id; private String id;
...@@ -113,6 +114,10 @@ public class GridRegion implements Serializable { ...@@ -113,6 +114,10 @@ public class GridRegion implements Serializable {
private String detail; private String detail;
private String jzArea;
private Integer position;
public String getDetail(){return detail;} public String getDetail(){return detail;}
public void setDetail(String detail){this.detail = detail;} public void setDetail(String detail){this.detail = detail;}
...@@ -299,97 +304,64 @@ public class GridRegion implements Serializable { ...@@ -299,97 +304,64 @@ public class GridRegion implements Serializable {
this.wgCoordinate = wgCoordinate; this.wgCoordinate = wgCoordinate;
} }
public String getJzArea() {
return jzArea;
}
public void setJzArea(String jzArea) {
this.jzArea = jzArea;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); return "GridRegion{" +
sb.append(getClass().getSimpleName()); "id='" + id + '\'' +
sb.append(" ["); ", wgType='" + wgType + '\'' +
sb.append("Hash = ").append(hashCode()); ", wgCode='" + wgCode + '\'' +
sb.append(", id=").append(id); ", wgName='" + wgName + '\'' +
sb.append(", wgType=").append(wgType); ", wgParentId='" + wgParentId + '\'' +
sb.append(", wgCode=").append(wgCode); ", wgArea='" + wgArea + '\'' +
sb.append(", wgName=").append(wgName); ", wgCentreCoordinate='" + wgCentreCoordinate + '\'' +
sb.append(", wgParentId=").append(wgParentId); ", wgPrincipal='" + wgPrincipal + '\'' +
sb.append(", wgArea=").append(wgArea); ", createTime='" + createTime + '\'' +
sb.append(", wgCentreCoordinate=").append(wgCentreCoordinate); ", createBy='" + createBy + '\'' +
sb.append(", wgPrincipal=").append(wgPrincipal); ", updateTime='" + updateTime + '\'' +
sb.append(", createTime=").append(createTime); ", updateBy='" + updateBy + '\'' +
sb.append(", createBy=").append(createBy); ", level='" + level + '\'' +
sb.append(", updateTime=").append(updateTime); ", isValid='" + isValid + '\'' +
sb.append(", updateBy=").append(updateBy); ", ylzd1='" + ylzd1 + '\'' +
sb.append(", level=").append(level); ", ylzd2='" + ylzd2 + '\'' +
sb.append(", isValid=").append(isValid); ", ylzd3='" + ylzd3 + '\'' +
sb.append(", ylzd1=").append(ylzd1); ", ylzd4='" + ylzd4 + '\'' +
sb.append(", ylzd2=").append(ylzd2); ", ylzd5='" + ylzd5 + '\'' +
sb.append(", ylzd3=").append(ylzd3); ", wgPurpose='" + wgPurpose + '\'' +
sb.append(", ylzd4=").append(ylzd4); ", wgCoordinate='" + wgCoordinate + '\'' +
sb.append(", ylzd5=").append(ylzd5); ", status='" + status + '\'' +
sb.append(", wgPurpose=").append(wgPurpose); ", pName='" + pName + '\'' +
sb.append(", wgCoordinate=").append(wgCoordinate); ", pId='" + pId + '\'' +
sb.append("]"); ", detail='" + detail + '\'' +
return sb.toString(); ", jzArea='" + jzArea + '\'' +
", position=" + position +
'}';
} }
@Override @Override
public boolean equals(Object that) { public boolean equals(Object o) {
if (this == that) { if (o == null || getClass() != o.getClass()) return false;
return true; GridRegion that = (GridRegion) o;
} return Objects.equals(id, that.id) && Objects.equals(wgType, that.wgType) && Objects.equals(wgCode, that.wgCode) && Objects.equals(wgName, that.wgName) && Objects.equals(wgParentId, that.wgParentId) && Objects.equals(wgArea, that.wgArea) && Objects.equals(wgCentreCoordinate, that.wgCentreCoordinate) && Objects.equals(wgPrincipal, that.wgPrincipal) && Objects.equals(createTime, that.createTime) && Objects.equals(createBy, that.createBy) && Objects.equals(updateTime, that.updateTime) && Objects.equals(updateBy, that.updateBy) && Objects.equals(level, that.level) && Objects.equals(isValid, that.isValid) && Objects.equals(ylzd1, that.ylzd1) && Objects.equals(ylzd2, that.ylzd2) && Objects.equals(ylzd3, that.ylzd3) && Objects.equals(ylzd4, that.ylzd4) && Objects.equals(ylzd5, that.ylzd5) && Objects.equals(wgPurpose, that.wgPurpose) && Objects.equals(wgCoordinate, that.wgCoordinate) && Objects.equals(status, that.status) && Objects.equals(pName, that.pName) && Objects.equals(pId, that.pId) && Objects.equals(detail, that.detail) && Objects.equals(jzArea, that.jzArea) && Objects.equals(position, that.position);
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
GridRegion other = (GridRegion) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getWgType() == null ? other.getWgType() == null : this.getWgType().equals(other.getWgType()))
&& (this.getWgCode() == null ? other.getWgCode() == null : this.getWgCode().equals(other.getWgCode()))
&& (this.getWgName() == null ? other.getWgName() == null : this.getWgName().equals(other.getWgName()))
&& (this.getWgParentId() == null ? other.getWgParentId() == null : this.getWgParentId().equals(other.getWgParentId()))
&& (this.getWgArea() == null ? other.getWgArea() == null : this.getWgArea().equals(other.getWgArea()))
&& (this.getWgCentreCoordinate() == null ? other.getWgCentreCoordinate() == null : this.getWgCentreCoordinate().equals(other.getWgCentreCoordinate()))
&& (this.getWgPrincipal() == null ? other.getWgPrincipal() == null : this.getWgPrincipal().equals(other.getWgPrincipal()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
&& (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
&& (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid()))
&& (this.getYlzd1() == null ? other.getYlzd1() == null : this.getYlzd1().equals(other.getYlzd1()))
&& (this.getYlzd2() == null ? other.getYlzd2() == null : this.getYlzd2().equals(other.getYlzd2()))
&& (this.getYlzd3() == null ? other.getYlzd3() == null : this.getYlzd3().equals(other.getYlzd3()))
&& (this.getYlzd4() == null ? other.getYlzd4() == null : this.getYlzd4().equals(other.getYlzd4()))
&& (this.getYlzd5() == null ? other.getYlzd5() == null : this.getYlzd5().equals(other.getYlzd5()))
&& (this.getWgPurpose() == null ? other.getWgPurpose() == null : this.getWgPurpose().equals(other.getWgPurpose()))
&& (this.getWgCoordinate() == null ? other.getWgCoordinate() == null : this.getWgCoordinate().equals(other.getWgCoordinate()));
} }
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; return Objects.hash(id, wgType, wgCode, wgName, wgParentId, wgArea, wgCentreCoordinate, wgPrincipal, createTime, createBy, updateTime, updateBy, level, isValid, ylzd1, ylzd2, ylzd3, ylzd4, ylzd5, wgPurpose, wgCoordinate, status, pName, pId, detail, jzArea, position);
int result = 1; }
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); }
result = prime * result + ((getWgType() == null) ? 0 : getWgType().hashCode());
result = prime * result + ((getWgCode() == null) ? 0 : getWgCode().hashCode());
result = prime * result + ((getWgName() == null) ? 0 : getWgName().hashCode());
result = prime * result + ((getWgParentId() == null) ? 0 : getWgParentId().hashCode());
result = prime * result + ((getWgArea() == null) ? 0 : getWgArea().hashCode());
result = prime * result + ((getWgCentreCoordinate() == null) ? 0 : getWgCentreCoordinate().hashCode());
result = prime * result + ((getWgPrincipal() == null) ? 0 : getWgPrincipal().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode());
result = prime * result + ((getYlzd1() == null) ? 0 : getYlzd1().hashCode());
result = prime * result + ((getYlzd2() == null) ? 0 : getYlzd2().hashCode());
result = prime * result + ((getYlzd3() == null) ? 0 : getYlzd3().hashCode());
result = prime * result + ((getYlzd4() == null) ? 0 : getYlzd4().hashCode());
result = prime * result + ((getYlzd5() == null) ? 0 : getYlzd5().hashCode());
result = prime * result + ((getWgPurpose() == null) ? 0 : getWgPurpose().hashCode());
result = prime * result + ((getWgCoordinate() == null) ? 0 : getWgCoordinate().hashCode());
return result;
}
}
\ No newline at end of file
...@@ -22,5 +22,7 @@ public class HouseResourceProfileGraph { ...@@ -22,5 +22,7 @@ public class HouseResourceProfileGraph {
private BigDecimal areaTotal; private BigDecimal areaTotal;
private Integer position;
private List<HouseResourcePage> houseResources; private List<HouseResourcePage> houseResources;
} }
...@@ -221,22 +221,24 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -221,22 +221,24 @@ 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);
String wgName = gridRegionMapper.getWgNameByCode(k); GridRegion gridRegion = gridRegionMapper.getWgLevel(k);
if (StringUtils.hasText(wgName)) { if (Objects.nonNull(gridRegion)) {
houseResourceProfileGraph.setWgName(wgName); houseResourceProfileGraph.setWgName(gridRegion.getWgName());
} if (Objects.nonNull(gridRegion.getJzArea())) {
String jzAreaByCode = gridRegionMapper.getJzAreaByCode(k); houseResourceProfileGraph.setJzArea(new BigDecimal(gridRegion.getJzArea()));
if (StringUtils.hasText(jzAreaByCode)) { }
houseResourceProfileGraph.setJzArea(new BigDecimal(jzAreaByCode)); if (Objects.nonNull(gridRegion.getPosition())) {
houseResourceProfileGraph.setPosition(gridRegion.getPosition());
}
} }
houseResourceProfileGraph.setJyArea(v.stream().map(HouseResourcePage::getHouseArea).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)); houseResourceProfileGraph.setJyArea(v.stream().map(HouseResourcePage::getHouseArea).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
houseResourceProfileGraph.setKzCount(v.stream().filter(x -> x.getHouseResourceType() == HouseEnums.HouseResourceTypeEnum.KZ.getCode()).count()); houseResourceProfileGraph.setKzCount(v.stream().filter(x -> x.getHouseResourceType() == HouseEnums.HouseResourceTypeEnum.KZ.getCode()).count());
houseResourceProfileGraph.setKzArea(v.stream().filter(x -> x.getHouseResourceType() == HouseEnums.HouseResourceTypeEnum.KZ.getCode()).map(HouseResourcePage::getHouseArea).reduce(BigDecimal.ZERO, BigDecimal::add)); houseResourceProfileGraph.setKzArea(v.stream().filter(x -> x.getHouseResourceType() == HouseEnums.HouseResourceTypeEnum.KZ.getCode()).map(HouseResourcePage::getHouseArea).reduce(BigDecimal.ZERO, BigDecimal::add));
houseResourceProfileGraph.setAreaTotal(v.stream().map(HouseResourcePage::getHouseArea).reduce(BigDecimal.ZERO, BigDecimal::add)); houseResourceProfileGraph.setAreaTotal(v.stream().map(HouseResourcePage::getHouseArea).reduce(BigDecimal.ZERO, BigDecimal::add));
houseResourceProfileGraph.setHouseResources(v.stream().sorted(Comparator.comparing(HouseResourcePage::getHouseNumber)).collect(Collectors.toList())); houseResourceProfileGraph.setHouseResources(v.stream().sorted(Comparator.comparing(HouseResourcePage::getHouseNumber, Comparator.nullsLast(String::compareTo))).collect(Collectors.toList()));
resourceProfileGraphList.add(houseResourceProfileGraph); resourceProfileGraphList.add(houseResourceProfileGraph);
}); });
return resourceProfileGraphList.stream().sorted(Comparator.comparing(HouseResourceProfileGraph::getId)).collect(Collectors.toList()); return resourceProfileGraphList.stream().sorted(Comparator.comparing(HouseResourceProfileGraph::getPosition, Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());
} }
@Override @Override
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
<result column="ylzd5" jdbcType="VARCHAR" property="ylzd5" /> <result column="ylzd5" jdbcType="VARCHAR" property="ylzd5" />
<result column="wg_purpose" jdbcType="VARCHAR" property="wgPurpose" /> <result column="wg_purpose" jdbcType="VARCHAR" property="wgPurpose" />
<result column="status" jdbcType="VARCHAR" property="status" /> <result column="status" jdbcType="VARCHAR" property="status" />
<result column="jz_area" jdbcType="VARCHAR" property="jzArea" />
<result column="position" jdbcType="INTEGER" property="position" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ruoyi.system.domain.grid.GridRegion"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ruoyi.system.domain.grid.GridRegion">
<result column="wg_coordinate" jdbcType="LONGVARCHAR" property="wgCoordinate" /> <result column="wg_coordinate" jdbcType="LONGVARCHAR" property="wgCoordinate" />
...@@ -88,8 +90,8 @@ ...@@ -88,8 +90,8 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, wg_type, wg_code, wg_name, wg_parent_id, wg_area, wg_centre_coordinate, id, wg_type, wg_code, wg_name, wg_parent_id, wg_area, wg_centre_coordinate,
wg_principal, create_time, create_by, update_time, update_by, level, is_valid, ylzd1, wg_principal, create_time, create_by, update_time, update_by, level, is_valid, ylzd1,
ylzd2, ylzd3, ylzd4, ylzd5, wg_purpose, status ylzd2, ylzd3, ylzd4, ylzd5, wg_purpose, status, position, jz_area
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
wg_coordinate,detail wg_coordinate,detail
...@@ -125,7 +127,7 @@ ...@@ -125,7 +127,7 @@
</if> </if>
</select> </select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs"> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List" />
...@@ -144,20 +146,20 @@ ...@@ -144,20 +146,20 @@
</delete> </delete>
<insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridRegion"> <insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridRegion">
insert into grid_region (id, wg_type, insert into grid_region (id, wg_type,
wg_code, wg_name, wg_parent_id, wg_code, wg_name, wg_parent_id,
wg_area, wg_centre_coordinate, wg_principal, wg_area, wg_centre_coordinate, wg_principal,
create_time, create_by, update_time, create_time, create_by, update_time,
update_by, level, is_valid, update_by, level, is_valid,
ylzd1, ylzd2, ylzd3, ylzd1, ylzd2, ylzd3,
ylzd4, ylzd5, wg_purpose, ylzd4, ylzd5, wg_purpose,
wg_coordinate) wg_coordinate)
values (#{id,jdbcType=VARCHAR}, #{wgType,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{wgType,jdbcType=VARCHAR},
#{wgCode,jdbcType=VARCHAR}, #{wgName,jdbcType=VARCHAR}, #{wgParentId,jdbcType=VARCHAR}, #{wgCode,jdbcType=VARCHAR}, #{wgName,jdbcType=VARCHAR}, #{wgParentId,jdbcType=VARCHAR},
#{wgArea,jdbcType=VARCHAR}, #{wgCentreCoordinate,jdbcType=VARCHAR}, #{wgPrincipal,jdbcType=VARCHAR}, #{wgArea,jdbcType=VARCHAR}, #{wgCentreCoordinate,jdbcType=VARCHAR}, #{wgPrincipal,jdbcType=VARCHAR},
#{createTime,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, #{isValid,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, #{isValid,jdbcType=VARCHAR},
#{ylzd1,jdbcType=VARCHAR}, #{ylzd2,jdbcType=VARCHAR}, #{ylzd3,jdbcType=VARCHAR}, #{ylzd1,jdbcType=VARCHAR}, #{ylzd2,jdbcType=VARCHAR}, #{ylzd3,jdbcType=VARCHAR},
#{ylzd4,jdbcType=VARCHAR}, #{ylzd5,jdbcType=VARCHAR}, #{wgPurpose,jdbcType=VARCHAR}, #{ylzd4,jdbcType=VARCHAR}, #{ylzd5,jdbcType=VARCHAR}, #{wgPurpose,jdbcType=VARCHAR},
#{wgCoordinate,jdbcType=LONGVARCHAR}) #{wgCoordinate,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridRegion"> <insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridRegion">
...@@ -759,4 +761,4 @@ ...@@ -759,4 +761,4 @@
</update> </update>
</mapper> </mapper>
\ No newline at end of file
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