Commit ab46d946 authored by lixuan's avatar lixuan

feat: 房源

parent deec4928
Pipeline #144331 failed with stages
in 30 minutes and 37 seconds
package com.ruoyi.system.domain.grid;
import java.io.Serializable;
import java.util.Objects;
public class GridRegion implements Serializable {
private String id;
......@@ -113,6 +114,10 @@ public class GridRegion implements Serializable {
private String detail;
private String jzArea;
private Integer position;
public String getDetail(){return detail;}
public void setDetail(String detail){this.detail = detail;}
......@@ -299,97 +304,64 @@ public class GridRegion implements Serializable {
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
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", wgType=").append(wgType);
sb.append(", wgCode=").append(wgCode);
sb.append(", wgName=").append(wgName);
sb.append(", wgParentId=").append(wgParentId);
sb.append(", wgArea=").append(wgArea);
sb.append(", wgCentreCoordinate=").append(wgCentreCoordinate);
sb.append(", wgPrincipal=").append(wgPrincipal);
sb.append(", createTime=").append(createTime);
sb.append(", createBy=").append(createBy);
sb.append(", updateTime=").append(updateTime);
sb.append(", updateBy=").append(updateBy);
sb.append(", level=").append(level);
sb.append(", isValid=").append(isValid);
sb.append(", ylzd1=").append(ylzd1);
sb.append(", ylzd2=").append(ylzd2);
sb.append(", ylzd3=").append(ylzd3);
sb.append(", ylzd4=").append(ylzd4);
sb.append(", ylzd5=").append(ylzd5);
sb.append(", wgPurpose=").append(wgPurpose);
sb.append(", wgCoordinate=").append(wgCoordinate);
sb.append("]");
return sb.toString();
return "GridRegion{" +
"id='" + id + '\'' +
", wgType='" + wgType + '\'' +
", wgCode='" + wgCode + '\'' +
", wgName='" + wgName + '\'' +
", wgParentId='" + wgParentId + '\'' +
", wgArea='" + wgArea + '\'' +
", wgCentreCoordinate='" + wgCentreCoordinate + '\'' +
", wgPrincipal='" + wgPrincipal + '\'' +
", createTime='" + createTime + '\'' +
", createBy='" + createBy + '\'' +
", updateTime='" + updateTime + '\'' +
", updateBy='" + updateBy + '\'' +
", level='" + level + '\'' +
", isValid='" + isValid + '\'' +
", ylzd1='" + ylzd1 + '\'' +
", ylzd2='" + ylzd2 + '\'' +
", ylzd3='" + ylzd3 + '\'' +
", ylzd4='" + ylzd4 + '\'' +
", ylzd5='" + ylzd5 + '\'' +
", wgPurpose='" + wgPurpose + '\'' +
", wgCoordinate='" + wgCoordinate + '\'' +
", status='" + status + '\'' +
", pName='" + pName + '\'' +
", pId='" + pId + '\'' +
", detail='" + detail + '\'' +
", jzArea='" + jzArea + '\'' +
", position=" + position +
'}';
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
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()));
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
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);
}
@Override
public int hashCode() {
final int prime = 31;
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
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);
}
}
......@@ -22,5 +22,7 @@ public class HouseResourceProfileGraph {
private BigDecimal areaTotal;
private Integer position;
private List<HouseResourcePage> houseResources;
}
......@@ -221,22 +221,24 @@ public class HouseResourceServiceImpl implements HouseResourceService {
collect.forEach((k, v) -> {
HouseResourceProfileGraph houseResourceProfileGraph = new HouseResourceProfileGraph();
houseResourceProfileGraph.setId(k);
String wgName = gridRegionMapper.getWgNameByCode(k);
if (StringUtils.hasText(wgName)) {
houseResourceProfileGraph.setWgName(wgName);
}
String jzAreaByCode = gridRegionMapper.getJzAreaByCode(k);
if (StringUtils.hasText(jzAreaByCode)) {
houseResourceProfileGraph.setJzArea(new BigDecimal(jzAreaByCode));
GridRegion gridRegion = gridRegionMapper.getWgLevel(k);
if (Objects.nonNull(gridRegion)) {
houseResourceProfileGraph.setWgName(gridRegion.getWgName());
if (Objects.nonNull(gridRegion.getJzArea())) {
houseResourceProfileGraph.setJzArea(new BigDecimal(gridRegion.getJzArea()));
}
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.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.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);
});
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
......
......@@ -23,6 +23,8 @@
<result column="ylzd5" jdbcType="VARCHAR" property="ylzd5" />
<result column="wg_purpose" jdbcType="VARCHAR" property="wgPurpose" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="jz_area" jdbcType="VARCHAR" property="jzArea" />
<result column="position" jdbcType="INTEGER" property="position" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ruoyi.system.domain.grid.GridRegion">
<result column="wg_coordinate" jdbcType="LONGVARCHAR" property="wgCoordinate" />
......@@ -88,8 +90,8 @@
</sql>
<sql id="Base_Column_List">
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,
ylzd2, ylzd3, ylzd4, ylzd5, wg_purpose, status
wg_principal, create_time, create_by, update_time, update_by, level, is_valid, ylzd1,
ylzd2, ylzd3, ylzd4, ylzd5, wg_purpose, status, position, jz_area
</sql>
<sql id="Blob_Column_List">
wg_coordinate,detail
......@@ -125,7 +127,7 @@
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
......@@ -144,20 +146,20 @@
</delete>
<insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridRegion">
insert into grid_region (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, ylzd2, ylzd3,
ylzd4, ylzd5, wg_purpose,
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, ylzd2, ylzd3,
ylzd4, ylzd5, wg_purpose,
wg_coordinate)
values (#{id,jdbcType=VARCHAR}, #{wgType,jdbcType=VARCHAR},
#{wgCode,jdbcType=VARCHAR}, #{wgName,jdbcType=VARCHAR}, #{wgParentId,jdbcType=VARCHAR},
#{wgArea,jdbcType=VARCHAR}, #{wgCentreCoordinate,jdbcType=VARCHAR}, #{wgPrincipal,jdbcType=VARCHAR},
#{createTime,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, #{isValid,jdbcType=VARCHAR},
#{ylzd1,jdbcType=VARCHAR}, #{ylzd2,jdbcType=VARCHAR}, #{ylzd3,jdbcType=VARCHAR},
#{ylzd4,jdbcType=VARCHAR}, #{ylzd5,jdbcType=VARCHAR}, #{wgPurpose,jdbcType=VARCHAR},
#{wgCode,jdbcType=VARCHAR}, #{wgName,jdbcType=VARCHAR}, #{wgParentId,jdbcType=VARCHAR},
#{wgArea,jdbcType=VARCHAR}, #{wgCentreCoordinate,jdbcType=VARCHAR}, #{wgPrincipal,jdbcType=VARCHAR},
#{createTime,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR}, #{isValid,jdbcType=VARCHAR},
#{ylzd1,jdbcType=VARCHAR}, #{ylzd2,jdbcType=VARCHAR}, #{ylzd3,jdbcType=VARCHAR},
#{ylzd4,jdbcType=VARCHAR}, #{ylzd5,jdbcType=VARCHAR}, #{wgPurpose,jdbcType=VARCHAR},
#{wgCoordinate,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridRegion">
......@@ -759,4 +761,4 @@
</update>
</mapper>
\ No newline at end of file
</mapper>
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