楼宇管理,房屋管理,人房关系

bug修改。
This commit is contained in:
Renpc-kilig 2021-07-13 17:46:12 +08:00
parent 440af5f1a5
commit ae1e8be14d
6 changed files with 69 additions and 16 deletions

View File

@ -85,4 +85,11 @@ public interface IBuildingHouseDao {
* @throws RemoveException
*/
void deleteNoData(Map<String, Object> params) throws RemoveException;
/**
* 删除楼宇时删除楼宇下的房屋信息
* @param params
* @throws RemoveException
*/
void removeData(Map<String, Object> params) throws RemoveException;
}

View File

@ -141,4 +141,10 @@ public interface IBuildingHouseService {
*/
void deleteNoData(Map<String, Object> params);
/**
* 删除楼宇时删除楼宇下的房屋信息
* @param token
* @param cityBuildingId
*/
void removeData(String token, String cityBuildingId);
}

View File

@ -135,4 +135,16 @@ public class BuildingHouseServiceImpl extends AbstractService implements IBuildi
buildingHouseDao.deleteNoData(params);
}
@Override
public void removeData(String token, String cityBuildingIds) {
Map<String, Object> params = new HashMap<>();
params.put("cityBuildingIds", Arrays.asList(cityBuildingIds.split("_")));
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
buildingHouseDao.removeData(params);
}
}

View File

@ -178,6 +178,7 @@ public class CityBuildingServiceImpl extends AbstractService implements ICityBui
setUpdateInfo(params);
}
cityBuildingDao.removeCityBuilding(params);
buildingHouseService.removeData(token, ids);
}
@Override
@ -214,7 +215,7 @@ public class CityBuildingServiceImpl extends AbstractService implements ICityBui
} else {
setUpdateInfo(params);
}
updateHouse(cityBuildingId, cityBuildingVO);
updateHouse(token, cityBuildingId, cityBuildingVO);
cityBuildingDao.updateCityBuilding(params);
}
@ -223,9 +224,13 @@ public class CityBuildingServiceImpl extends AbstractService implements ICityBui
* @param cityBuildingId
* @param cityBuildingVO
*/
private void updateHouse(String cityBuildingId, CityBuildingVO cityBuildingVO) throws Exception {
private void updateHouse(String token, String cityBuildingId, CityBuildingVO cityBuildingVO) throws Exception {
Map<String, Object> params = new HashMap<>(2);
if (token != null) {
setUpdateInfo(token, params);
} else {
setUpdateInfo(params);
}
params.put("cityBuildingId", cityBuildingId);
// 先获取到修改之前的楼宇信息判断哪些数据发生了改变根据改变的数据进行相关的房屋信息修改
CityBuildingDTO cityBuildingDTO = cityBuildingDao.getCityBuilding(params);
@ -238,22 +243,22 @@ public class CityBuildingServiceImpl extends AbstractService implements ICityBui
buildingHouseVO.setCityBuildingId(cityBuildingId);
buildingHouseVO.setDistrictName(cityBuildingVO.getDistrictName());
buildingHouseVO.setDistrictId(cityBuildingVO.getDistrictId());
buildingHouseService.update(null, buildingHouseVO);
buildingHouseService.update(token,null, buildingHouseVO);
}
// 楼宇名称
if(!cityBuildingDTO.getBuildingName().equals(cityBuildingVO.getBuildingName())) {
BuildingHouseVO buildingHouseVO = new BuildingHouseVO();
buildingHouseVO.setCityBuildingId(cityBuildingId);
buildingHouseVO.setCityBuildingName(cityBuildingVO.getBuildingName());
buildingHouseService.update(null, buildingHouseVO);
buildingHouseService.update(token,null, buildingHouseVO);
}
// 楼宇编号
if(!cityBuildingDTO.getBuildingNum().equals(cityBuildingVO.getBuildingNum())) {
BuildingHouseVO buildingHouseVO = new BuildingHouseVO();
buildingHouseVO.setCityBuildingId(cityBuildingId);
buildingHouseVO.setNewHouseNumber(cityBuildingVO.getBuildingNum());
buildingHouseVO.setOldHouseNumber(cityBuildingDTO.getBuildingNum());
buildingHouseService.update(null, buildingHouseVO);
buildingHouseVO.setNewHouseNumber(cityBuildingVO.getBuildingNum() + "");
buildingHouseVO.setOldHouseNumber(cityBuildingDTO.getBuildingNum() + "");
buildingHouseService.update(token,null, buildingHouseVO);
}
// 楼宇层数
if(!cityBuildingDTO.getBuildingFloor().equals(cityBuildingVO.getBuildingFloor())) {

View File

@ -202,8 +202,13 @@
t1.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
<!-- 这里添加其他条件 -->
t1.id LIKE CONCAT('%', #{keywords}, '%')
t1.city_building_name LIKE CONCAT('%', #{keywords}, '%')
OR
t1.district_name LIKE CONCAT('%', #{keywords}, '%')
OR
t1.owner_name LIKE CONCAT('%', #{keywords}, '%')
OR
t1.owner_card LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="cityBuildingId != null and cityBuildingId != ''">
@ -263,4 +268,22 @@
)
</update>
<update id="removeData" parameterType="map">
UPDATE
city_building_house
SET
gmt_modified = #{gmtModified},
modifier = #{modifier},
is_delete = 1
WHERE
1 = 1
<if test="cityBuildingIds != null and cityBuildingIds.size > 0">
AND
city_building_id IN
<foreach collection="cityBuildingIds" index="index" open="(" separator="," close=")">
#{cityBuildingIds[${index}]}
</foreach>
</if>
</update>
</mapper>

View File

@ -41,6 +41,12 @@
<input type="text" id="buildingNum" name="buildingNum" class="layui-input" value="" placeholder="请输入楼宇编号" >
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">楼宇单元数</label>
<div class="layui-input-block">
<input type="text" id="buildingUnitNum" name="buildingUnitNum" class="layui-input" value="" placeholder="请输入楼宇单元数" >
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">楼宇层数</label>
<div class="layui-input-block">
@ -53,12 +59,6 @@
<input type="number" id="countOfFloor" name="countOfFloor" class="layui-input" value="" placeholder="请输入每层户数(大于等于0)" >
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">楼宇单元数</label>
<div class="layui-input-block">
<input type="text" id="buildingUnitNum" name="buildingUnitNum" class="layui-input" value="" placeholder="请输入楼宇单元数" >
</div>
</div>
<div class="layui-form-item layui-row">
<div class="layui-col-lg6">
<label class="layui-form-label">经度</label>