Commit 5ef0ac59 authored by lixuan's avatar lixuan

feat: 房源

parent cb66ca0b
......@@ -68,7 +68,7 @@ public class HouseResource implements Serializable {
private String address;
private String log;
private String lon;
private String lat;
}
......@@ -89,4 +89,6 @@ public class HouseResourceDetail {
private String log;
private String lat;
private List<BusinessEntityDto> businessEntityDtoList;
}
......@@ -24,4 +24,6 @@ public interface BusinessEntitySellMapper {
void deleteBusinessEntitySellByEntityId(@Param("businessEntityId") String businessEntityId);
List<BusinessEntitySell> selectBusinessEntitySellByEntityId(@Param("entityId") String entityId);
}
......@@ -12,7 +12,6 @@ import com.ruoyi.system.domain.house.vo.*;
import com.ruoyi.system.mapper.grid.GridRegionMapper;
import com.ruoyi.system.mapper.house.BusinessEntityInfoMapper;
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.service.house.HouseResourceService;
import org.springframework.beans.BeanUtils;
......@@ -58,6 +57,7 @@ public class HouseResourceServiceImpl implements HouseResourceService {
businessEntityInfoMapper.insertBusinessEntityInfo(businessEntityInfo);
for (BusinessEntitySell businessEntitySell : businessEntityDto.getBusinessEntitySells()) {
businessEntitySell.setId(UUID.randomUUID().toString().replaceAll("-", ""));
businessEntitySell.setBusinessEntityInfoId(businessEntityInfoId);
businessEntitySellMapper.insertBusinessEntitySell(businessEntitySell);
}
......@@ -87,6 +87,17 @@ public class HouseResourceServiceImpl implements HouseResourceService {
houseResourceDetail.setDecorationConditionText(HouseEnums.DecorationConditionEnum.getDescByCode(houseResourceDetail.getDecorationCondition()));
houseResourceDetail.setRentalUnitText(HouseEnums.RentalUnitEnum.getDescByCode(houseResourceDetail.getRentalUnit()));
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;
}
......
......@@ -50,4 +50,9 @@
<delete id="deleteBusinessEntitySellByEntityId">
DELETE FROM business_entity_sell WHERE business_entity_info_id = #{businessEntityId}
</delete>
<select id="selectBusinessEntitySellByEntityId"
resultType="com.ruoyi.system.domain.house.BusinessEntitySell">
SELECT * FROM business_entity_sell WHERE business_entity_info_id = #{entityId}
</select>
</mapper>
\ No newline at end of file
......@@ -32,7 +32,7 @@
<result property="planeGraphUrl" column="plane_graph_url" jdbcType="VARCHAR"/>
<result property="hireStatus" column="hire_status" jdbcType="INTEGER"/>
<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"/>
</resultMap>
......@@ -41,12 +41,12 @@
(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,
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
(#{id}, #{relationId}, #{two}, #{three}, #{four}, #{type}, #{projectId}, #{houseResourceUrl}, #{houseNumber}, #{houseArea},
#{houseResourceAttribute}, #{houseResourceType}, #{houseResourceUse}, #{houseResourceEquity}, #{houseResourceEquityTel}, #{ownership},
#{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>
<select id="selectHouseResourceById" resultType="com.ruoyi.system.domain.house.HouseResource" parameterType="string">
......@@ -84,7 +84,7 @@
plane_graph_url = #{planeGraphUrl},
hire_status = #{hireStatus},
address = #{address},
log = #{log},
lon = #{lon},
lat = #{lat}
WHERE id = #{id}
</update>
......@@ -98,7 +98,7 @@
(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,
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
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.relationId}, #{two}, #{three}, #{four}, #{item.type}, #{item.projectId}, #{item.houseResourceUrl},
......@@ -106,7 +106,7 @@
#{item.houseResourceUse}, #{item.houseResourceEquity}, #{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.log}, #{item.lat})
#{item.planeGraphUrl}, #{item.hireStatus}, #{item.address}, #{item.lon}, #{item.lat})
</foreach>
</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