Commit 65ab38c9 authored by lixuan's avatar lixuan

feat: 房源

parent ba7f0f1e
Pipeline #145024 failed with stages
in 22 minutes and 8 seconds
package com.ruoyi.web.controller.house;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.house.HouseResource;
import com.ruoyi.system.domain.house.vo.HouseResourcePageQuery;
import com.ruoyi.system.domain.house.vo.HouseResourceSaveUpdateDto;
import com.ruoyi.system.domain.house.vo.PageBusinessEntityStatisticsQuery;
import com.ruoyi.system.domain.house.vo.YearTaxSaveUpdateDto;
import com.ruoyi.system.domain.house.vo.*;
import com.ruoyi.system.service.house.HouseResourceService;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@RestController
......@@ -85,4 +86,17 @@ public class HouseResourceController {
houseResourceService.saveYearTax(dto);
return AjaxResult.success();
}
@PostMapping("/export")
public void export(HttpServletResponse response, HouseResourcePageQuery query) {
List<HouseResourceExport> exportList = new ArrayList<>();
List<HouseResourcePage> pageList = houseResourceService.listHouseResources(query);
pageList.forEach(x -> {
HouseResourceExport houseResourceExport = new HouseResourceExport();
BeanUtils.copyProperties(x, houseResourceExport);
exportList.add(houseResourceExport);
});
ExcelUtil<HouseResourceExport> util = new ExcelUtil<>(HouseResourceExport.class);
util.exportExcel(response, exportList, "房源数据");
}
}
......@@ -78,5 +78,5 @@ public class HouseResource implements Serializable {
private String remark;
private Integer showFlag;
private Integer registrationPlaceFlag;
}
package com.ruoyi.system.domain.house.vo;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class HouseResourceExport {
@Excel(name = "二级网格")
private String wgName2;
@Excel(name = "三级网格")
private String wgName3;
@Excel(name = "四级网格")
private String wgName4;
@Excel(name = "类型", readConverterExp = "1=楼宇,4=道路,5=街区,6=综合体,7=市场")
private int type;
private List<String> businessEntityInfoNames;
@Excel(name = "所属门牌号")
private String houseNumber;
private int houseResourceType;
@Excel(name = "房源类型")
private String houseResourceTypeText;
@Excel(name = "房源面积")
private BigDecimal houseArea;
private int houseResourceAttribute;
@Excel(name = "房源属性")
private String houseResourceAttributeText;
@Excel(name = "产权人联系方式")
private String houseResourceEquityTel;
@Excel(name = "产权人归属")
private String ownership;
@Excel(name = "地址")
private String address;
@Excel(name = "负责人")
private String principal;
@Excel(name = "负责人联系方式")
private String principalTel;
@Excel(name = "主营业务")
private String business;
@Excel(name = "工作人员数量")
private Integer workerNumber;
@Excel(name = "性质")
private String nature;
@Excel(name = "注册地址")
private String registeredAddress;
@Excel(name = "行业分类")
private String industryClassification;
@Excel(name = "是否规上企业", readConverterExp = "0=否,1=是")
private Boolean gs;
@Excel(name = "备注")
private String remark;
}
......@@ -109,4 +109,6 @@ public class HouseResourcePage {
private Boolean gs;
private BigDecimal dayPrice;
private Integer registrationPlaceFlag;
}
......@@ -71,4 +71,8 @@ public class HouseResourcePageQuery extends PageDomain {
private BigDecimal unitPriceMax;
private Boolean gsFlag;
private String industryClassification;
private String incomeSort;
}
......@@ -37,7 +37,7 @@
<result property="lon" column="lon" jdbcType="VARCHAR"/>
<result property="lat" column="lat" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="showFlag" column="show_flag" jdbcType="INTEGER"/>
<result property="registrationPlaceFlag" column="registration_place_flag" jdbcType="INTEGER"/>
</resultMap>
<insert id="insertHouseResource" parameterType="com.ruoyi.system.domain.house.HouseResource">
......@@ -45,12 +45,12 @@
(id, relation_id, two, three, four, type, project_id, house_resource_url, business_license_url, house_number, house_area,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, business_status, house_resource_equity_tel, ownership,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number,
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status, address, lon, lat, remark)
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status, address, lon, lat, remark, registration_place_flag)
VALUES
(#{id}, #{relationId}, #{two}, #{three}, #{four}, #{type}, #{projectId}, #{houseResourceUrl}, #{businessLicenseUrl}, #{houseNumber}, #{houseArea},
#{houseResourceAttribute}, #{houseResourceType}, #{houseResourceUse}, #{houseResourceEquity}, #{businessStatus}, #{houseResourceEquityTel}, #{ownership},
#{decorationCondition}, #{orientation}, #{landingHeadFlag}, #{commonAreaNumber}, #{officeNumber},
#{meetingNumber}, #{stationNumber}, #{setUp}, #{labelId}, #{unitPrice}, #{rentalUnit}, #{planeGraphUrl}, #{hireStatus}, #{address}, #{lon}, #{lat}, #{remark})
#{meetingNumber}, #{stationNumber}, #{setUp}, #{labelId}, #{unitPrice}, #{rentalUnit}, #{planeGraphUrl}, #{hireStatus}, #{address}, #{lon}, #{lat}, #{remark}, #{registrationPlaceFlag})
</insert>
<select id="selectHouseResourceById" resultType="com.ruoyi.system.domain.house.HouseResource" parameterType="string">
......@@ -92,7 +92,8 @@
address = #{address},
lon = #{lon},
lat = #{lat},
remark = #{remark}
remark = #{remark},
registration_place_flag = #{registrationPlaceFlag}
WHERE id = #{id}
</update>
......@@ -105,7 +106,7 @@
(id, relation_id, two, three, four, type, project_id, house_resource_url, business_license_url, house_number, house_area,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, business_status, house_resource_equity_tel, ownership,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number,
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status, address, lon, lat, remark)
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status, address, lon, lat, remark, registration_place_flag)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.relationId}, #{two}, #{three}, #{four}, #{item.type}, #{item.projectId}, #{item.houseResourceUrl}, #{item.businessLicenseUrl},
......@@ -113,7 +114,7 @@
#{item.houseResourceUse}, #{item.houseResourceEquity}, #{businessStatus}, #{item.houseResourceEquityTel}, #{ownership}, #{item.decorationCondition},
#{item.orientation}, #{item.landingHeadFlag}, #{item.commonAreaNumber}, #{item.officeNumber},
#{item.meetingNumber}, #{item.stationNumber}, #{item.setUp}, #{item.labelId}, #{item.unitPrice}, #{item.rentalUnit},
#{item.planeGraphUrl}, #{item.hireStatus}, #{item.address}, #{item.lon}, #{item.lat}, #{item.remark})
#{item.planeGraphUrl}, #{item.hireStatus}, #{item.address}, #{item.lon}, #{item.lat}, #{item.remark}, #{item.registrationPlaceFlag})
</foreach>
</insert>
......@@ -172,6 +173,9 @@
<if test="query.gsFlag != null and query.gsFlag != ''">
and t3.gs = ${query.gsFlag}
</if>
<if test="query.industryClassification != null and query.industryClassification != ''">
and t3.industry_classification like concat('%', #{query.industryClassification}, '%')
</if>
<if test="query.wgCodes != null and query.wgCodes.size() > 0">
and t1.two in
<foreach item="item" index="index" collection="query.wgCodes" open="(" separator="," close=")">
......@@ -183,6 +187,9 @@
<if test="query.dayPriceMin != null and query.dayPriceMin != '' and query.dayPriceMax != null and query.dayPriceMax != ''">
having dayPrice <![CDATA[ >= ]]> #{query.dayPriceMin} and dayPrice <![CDATA[ <= ]]> #{query.dayPriceMax}
</if>
<if test="query.incomeSort != null and query.incomeSort != ''">
ORDER BY income #{incomeSort}
</if>
</select>
<select id="selectProfileGraph" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
SELECT
......@@ -251,7 +258,6 @@
<if test="query.sortWay != null and query.sortWay != ''">
order by t1.house_area ${query.sortWay}
</if>
GROUP BY t1.id
<trim prefix="having" prefixOverrides="and">
<if test="query.houseAreaMin != null and query.houseAreaMin != '' and query.houseAreaMax != null and query.houseAreaMax != ''">
and t1.house_area <![CDATA[ >= ]]> #{query.houseAreaMin} and t1.house_area <![CDATA[ <= ]]> #{query.houseAreaMax}
......@@ -261,6 +267,7 @@
</if>
</trim>
</where>
GROUP BY t1.id
</select>
<select id="selectAll" resultType="com.ruoyi.system.domain.house.HouseResource">
SELECT * FROM house_resource
......
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