From 975a89133e7fc67523f3d34d8fd216e05c41c0d8 Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Tue, 12 Oct 2021 09:31:11 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9=E3=80=82=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=B0=E5=A2=9E=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/houseusersub/IHouseUserSubDao.java | 6 ++++ .../houseuser/impl/HouseUserServiceImpl.java | 4 +++ .../mapper/houseuser/house-user-mapper.xml | 19 +++++++++-- .../houseusersub/house-user-sub-mapper.xml | 33 ++++++++++++++++++- .../resources/templates/building/save.html | 3 ++ 5 files changed, 62 insertions(+), 3 deletions(-) diff --git a/src/main/java/cn/com/tenlion/systemhouse/dao/houseusersub/IHouseUserSubDao.java b/src/main/java/cn/com/tenlion/systemhouse/dao/houseusersub/IHouseUserSubDao.java index c4dacd8..bb373c1 100644 --- a/src/main/java/cn/com/tenlion/systemhouse/dao/houseusersub/IHouseUserSubDao.java +++ b/src/main/java/cn/com/tenlion/systemhouse/dao/houseusersub/IHouseUserSubDao.java @@ -117,4 +117,10 @@ public interface IHouseUserSubDao { */ Integer count(Map params) throws SearchException; + /** + * 通过户主(房主)ID删除其家庭成员信息 + * @param params + * @throws RemoveException + */ + void removeSub(Map params) throws RemoveException; } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemhouse/service/houseuser/impl/HouseUserServiceImpl.java b/src/main/java/cn/com/tenlion/systemhouse/service/houseuser/impl/HouseUserServiceImpl.java index 373ef1c..beb3a32 100644 --- a/src/main/java/cn/com/tenlion/systemhouse/service/houseuser/impl/HouseUserServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemhouse/service/houseuser/impl/HouseUserServiceImpl.java @@ -1,6 +1,7 @@ package cn.com.tenlion.systemhouse.service.houseuser.impl; import cn.com.tenlion.systemhouse.dao.houseuser.IHouseUserDao; +import cn.com.tenlion.systemhouse.dao.houseusersub.IHouseUserSubDao; import cn.com.tenlion.systemhouse.pojo.bos.houseuser.HouseUserBO; import cn.com.tenlion.systemhouse.pojo.dtos.houseuser.HouseUserDTO; import cn.com.tenlion.systemhouse.pojo.pos.houseuser.HouseUserPO; @@ -31,6 +32,8 @@ public class HouseUserServiceImpl extends DefaultBaseService implements IHouseUs @Autowired private IHouseUserDao houseUserDao; + @Autowired + private IHouseUserSubDao houseUserSubDao; @Override public void save(HouseUserVO houseUserVO) { @@ -76,6 +79,7 @@ public class HouseUserServiceImpl extends DefaultBaseService implements IHouseUs setAppUpdateInfo(token, params); } houseUserDao.remove(params); + houseUserSubDao.removeSub(params); } @Override diff --git a/src/main/resources/mybatis/mapper/houseuser/house-user-mapper.xml b/src/main/resources/mybatis/mapper/houseuser/house-user-mapper.xml index f4b3e45..0f843f1 100644 --- a/src/main/resources/mybatis/mapper/houseuser/house-user-mapper.xml +++ b/src/main/resources/mybatis/mapper/houseuser/house-user-mapper.xml @@ -84,7 +84,6 @@ ) - DELETE FROM @@ -96,6 +95,21 @@ + + + UPDATE + house_house_user + SET + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + is_delete = 1 + WHERE + house_user_id IN + + #{houseUserIds[${index}]} + + + UPDATE @@ -216,6 +230,8 @@ house_house_user t1 WHERE 1 = 1 + AND + t1.is_delete = 0 AND t1.building_house_id = #{buildingHouseId} @@ -252,7 +268,6 @@ 1 = 1 AND ( - t1.id LIKE CONCAT('%', #{keywords}, '%') ) diff --git a/src/main/resources/mybatis/mapper/houseusersub/house-user-sub-mapper.xml b/src/main/resources/mybatis/mapper/houseusersub/house-user-sub-mapper.xml index b11a969..955146e 100644 --- a/src/main/resources/mybatis/mapper/houseusersub/house-user-sub-mapper.xml +++ b/src/main/resources/mybatis/mapper/houseusersub/house-user-sub-mapper.xml @@ -89,7 +89,6 @@ ) - DELETE FROM @@ -101,6 +100,36 @@ + + + UPDATE + house_house_user_sub + SET + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + is_delete = 1 + WHERE + house_user_sub_id IN + + #{houseUserSubIds[${index}]} + + + + + + UPDATE + house_house_user_sub + SET + gmt_modified = #{gmtModified}, + modifier = #{modifier}, + is_delete = 1 + WHERE + house_user_id IN + + #{houseUserIds[${index}]} + + + UPDATE @@ -228,6 +257,8 @@ house_house_user_sub t1 WHERE 1 = 1 + AND + t1.is_delete = 0 AND house_user_id = #{houseUserId} diff --git a/src/main/resources/templates/building/save.html b/src/main/resources/templates/building/save.html index cfc419a..096a426 100644 --- a/src/main/resources/templates/building/save.html +++ b/src/main/resources/templates/building/save.html @@ -277,6 +277,9 @@ $('#start').show(); $('#end').show(); $('#start').empty(); + $('#floorCountDiv').hide(); + $('#houseCountDiv').hide(); + $('#elevatorDiv').addClass("layui-col-lg12").removeClass("layui-col-lg4"); for(var i = 0;i < unitCount;i++) { var html = '
' +