Commit 5ef0ac59 authored by lixuan's avatar lixuan

feat: 房源

parent cb66ca0b
...@@ -68,7 +68,7 @@ public class HouseResource implements Serializable { ...@@ -68,7 +68,7 @@ public class HouseResource implements Serializable {
private String address; private String address;
private String log; private String lon;
private String lat; private String lat;
} }
...@@ -89,4 +89,6 @@ public class HouseResourceDetail { ...@@ -89,4 +89,6 @@ public class HouseResourceDetail {
private String log; private String log;
private String lat; private String lat;
private List<BusinessEntityDto> businessEntityDtoList;
} }
...@@ -24,4 +24,6 @@ public interface BusinessEntitySellMapper { ...@@ -24,4 +24,6 @@ public interface BusinessEntitySellMapper {
void deleteBusinessEntitySellByEntityId(@Param("businessEntityId") String businessEntityId); void deleteBusinessEntitySellByEntityId(@Param("businessEntityId") String businessEntityId);
List<BusinessEntitySell> selectBusinessEntitySellByEntityId(@Param("entityId") String entityId);
} }
...@@ -12,7 +12,6 @@ import com.ruoyi.system.domain.house.vo.*; ...@@ -12,7 +12,6 @@ import com.ruoyi.system.domain.house.vo.*;
import com.ruoyi.system.mapper.grid.GridRegionMapper; import com.ruoyi.system.mapper.grid.GridRegionMapper;
import com.ruoyi.system.mapper.house.BusinessEntityInfoMapper; import com.ruoyi.system.mapper.house.BusinessEntityInfoMapper;
import com.ruoyi.system.mapper.house.BusinessEntitySellMapper; import com.ruoyi.system.mapper.house.BusinessEntitySellMapper;
import com.ruoyi.system.mapper.house.HouseResourceAssociationObjectMapper;
import com.ruoyi.system.mapper.house.HouseResourceMapper; import com.ruoyi.system.mapper.house.HouseResourceMapper;
import com.ruoyi.system.service.house.HouseResourceService; import com.ruoyi.system.service.house.HouseResourceService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -58,6 +57,7 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -58,6 +57,7 @@ public class HouseResourceServiceImpl implements HouseResourceService {
businessEntityInfoMapper.insertBusinessEntityInfo(businessEntityInfo); businessEntityInfoMapper.insertBusinessEntityInfo(businessEntityInfo);
for (BusinessEntitySell businessEntitySell : businessEntityDto.getBusinessEntitySells()) { for (BusinessEntitySell businessEntitySell : businessEntityDto.getBusinessEntitySells()) {
businessEntitySell.setId(UUID.randomUUID().toString().replaceAll("-", ""));
businessEntitySell.setBusinessEntityInfoId(businessEntityInfoId); businessEntitySell.setBusinessEntityInfoId(businessEntityInfoId);
businessEntitySellMapper.insertBusinessEntitySell(businessEntitySell); businessEntitySellMapper.insertBusinessEntitySell(businessEntitySell);
} }
...@@ -87,6 +87,17 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -87,6 +87,17 @@ public class HouseResourceServiceImpl implements HouseResourceService {
houseResourceDetail.setDecorationConditionText(HouseEnums.DecorationConditionEnum.getDescByCode(houseResourceDetail.getDecorationCondition())); houseResourceDetail.setDecorationConditionText(HouseEnums.DecorationConditionEnum.getDescByCode(houseResourceDetail.getDecorationCondition()));
houseResourceDetail.setRentalUnitText(HouseEnums.RentalUnitEnum.getDescByCode(houseResourceDetail.getRentalUnit())); houseResourceDetail.setRentalUnitText(HouseEnums.RentalUnitEnum.getDescByCode(houseResourceDetail.getRentalUnit()));
houseResourceDetail.setHireStatusText(HouseEnums.hireStatusTextEnum.getDescByCode(houseResourceDetail.getHireStatus())); houseResourceDetail.setHireStatusText(HouseEnums.hireStatusTextEnum.getDescByCode(houseResourceDetail.getHireStatus()));
List<BusinessEntityInfo> businessEntityInfos = businessEntityInfoMapper.selectAllBusinessEntityInfosByHouseResourceId(houseResourceDetail.getId());
List<BusinessEntityDto> businessEntityDtoList = new ArrayList<>();
for (BusinessEntityInfo businessEntityInfo : businessEntityInfos) {
BusinessEntityDto businessEntityDto = new BusinessEntityDto();
BeanUtils.copyProperties(businessEntityInfo, businessEntityDto);
List<BusinessEntitySell> businessEntitySells = businessEntitySellMapper.selectBusinessEntitySellByEntityId(businessEntityInfo.getId());
businessEntityDto.setBusinessEntitySells(businessEntitySells);
businessEntityDtoList.add(businessEntityDto);
}
houseResourceDetail.setBusinessEntityDtoList(businessEntityDtoList);
return houseResourceDetail; return houseResourceDetail;
} }
......
...@@ -50,4 +50,9 @@ ...@@ -50,4 +50,9 @@
<delete id="deleteBusinessEntitySellByEntityId"> <delete id="deleteBusinessEntitySellByEntityId">
DELETE FROM business_entity_sell WHERE business_entity_info_id = #{businessEntityId} DELETE FROM business_entity_sell WHERE business_entity_info_id = #{businessEntityId}
</delete> </delete>
<select id="selectBusinessEntitySellByEntityId"
resultType="com.ruoyi.system.domain.house.BusinessEntitySell">
SELECT * FROM business_entity_sell WHERE business_entity_info_id = #{entityId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<result property="planeGraphUrl" column="plane_graph_url" jdbcType="VARCHAR"/> <result property="planeGraphUrl" column="plane_graph_url" jdbcType="VARCHAR"/>
<result property="hireStatus" column="hire_status" jdbcType="INTEGER"/> <result property="hireStatus" column="hire_status" jdbcType="INTEGER"/>
<result property="address" column="address" jdbcType="VARCHAR"/> <result property="address" column="address" jdbcType="VARCHAR"/>
<result property="log" column="log" jdbcType="VARCHAR"/> <result property="lon" column="lon" jdbcType="VARCHAR"/>
<result property="lat" column="lat" jdbcType="VARCHAR"/> <result property="lat" column="lat" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
...@@ -41,12 +41,12 @@ ...@@ -41,12 +41,12 @@
(id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area, (id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership, house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number, 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, log, lat) meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status, address, lon, lat)
VALUES VALUES
(#{id}, #{relationId}, #{two}, #{three}, #{four}, #{type}, #{projectId}, #{houseResourceUrl}, #{houseNumber}, #{houseArea}, (#{id}, #{relationId}, #{two}, #{three}, #{four}, #{type}, #{projectId}, #{houseResourceUrl}, #{houseNumber}, #{houseArea},
#{houseResourceAttribute}, #{houseResourceType}, #{houseResourceUse}, #{houseResourceEquity}, #{houseResourceEquityTel}, #{ownership}, #{houseResourceAttribute}, #{houseResourceType}, #{houseResourceUse}, #{houseResourceEquity}, #{houseResourceEquityTel}, #{ownership},
#{decorationCondition}, #{orientation}, #{landingHeadFlag}, #{commonAreaNumber}, #{officeNumber}, #{decorationCondition}, #{orientation}, #{landingHeadFlag}, #{commonAreaNumber}, #{officeNumber},
#{meetingNumber}, #{stationNumber}, #{setUp}, #{labelId}, #{unitPrice}, #{rentalUnit}, #{planeGraphUrl}, #{hireStatus}, #{address}, #{log}, #{lat}) #{meetingNumber}, #{stationNumber}, #{setUp}, #{labelId}, #{unitPrice}, #{rentalUnit}, #{planeGraphUrl}, #{hireStatus}, #{address}, #{lon}, #{lat})
</insert> </insert>
<select id="selectHouseResourceById" resultType="com.ruoyi.system.domain.house.HouseResource" parameterType="string"> <select id="selectHouseResourceById" resultType="com.ruoyi.system.domain.house.HouseResource" parameterType="string">
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
plane_graph_url = #{planeGraphUrl}, plane_graph_url = #{planeGraphUrl},
hire_status = #{hireStatus}, hire_status = #{hireStatus},
address = #{address}, address = #{address},
log = #{log}, lon = #{lon},
lat = #{lat} lat = #{lat}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
(id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area, (id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership, house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number, 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, log, lat) meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status, address, lon, lat)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.relationId}, #{two}, #{three}, #{four}, #{item.type}, #{item.projectId}, #{item.houseResourceUrl}, (#{item.id}, #{item.relationId}, #{two}, #{three}, #{four}, #{item.type}, #{item.projectId}, #{item.houseResourceUrl},
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
#{item.houseResourceUse}, #{item.houseResourceEquity}, #{item.houseResourceEquityTel}, #{ownership}, #{item.decorationCondition}, #{item.houseResourceUse}, #{item.houseResourceEquity}, #{item.houseResourceEquityTel}, #{ownership}, #{item.decorationCondition},
#{item.orientation}, #{item.landingHeadFlag}, #{item.commonAreaNumber}, #{item.officeNumber}, #{item.orientation}, #{item.landingHeadFlag}, #{item.commonAreaNumber}, #{item.officeNumber},
#{item.meetingNumber}, #{item.stationNumber}, #{item.setUp}, #{item.labelId}, #{item.unitPrice}, #{item.rentalUnit}, #{item.meetingNumber}, #{item.stationNumber}, #{item.setUp}, #{item.labelId}, #{item.unitPrice}, #{item.rentalUnit},
#{item.planeGraphUrl}, #{item.hireStatus}, #{item.address}, #{item.log}, #{item.lat}) #{item.planeGraphUrl}, #{item.hireStatus}, #{item.address}, #{item.lon}, #{item.lat})
</foreach> </foreach>
</insert> </insert>
......
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