From 1c6fb64a919ceadc314f7a9b4ffba05118e2f38c Mon Sep 17 00:00:00 2001 From: gaoben Date: Fri, 13 Aug 2021 16:08:09 +0800 Subject: [PATCH] =?UTF-8?q?v2.0.18=201.=E6=88=B7=E5=AE=A4=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=B8=A6?= =?UTF-8?q?=E6=A5=BC=E5=B1=82=E7=9A=84=E6=88=BF=E5=B1=8B=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ten/controller/TenCellController.java | 7 ++++-- .../modules/ten/service/TenCellService.java | 2 +- .../modules/ten/service/TenRoomService.java | 2 +- .../ten/service/impl/TenCellServiceImpl.java | 4 ++-- .../ten/service/impl/TenRoomServiceImpl.java | 23 ++++++++++++++----- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenCellController.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenCellController.java index e506193..65b444e 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenCellController.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/controller/TenCellController.java @@ -203,8 +203,11 @@ public class TenCellController extends AbstractController { @ApiOperation("删除小区") @RequiresPermissions("ten:cell") //@RequiresPermissions("ten:cell:delete") - public R syncRoomAddress(@RequestParam("cellId") Long cellId){ - int count = tenRoomService.syncAddress(cellId); + public R syncRoomAddress(@RequestParam("cellId") Long cellId,@RequestParam("layerFlag") Integer layerFlag){ + if(layerFlag ==null){ + layerFlag = 0; + } + int count = tenRoomService.syncAddress(cellId,layerFlag); return R.ok().put("count",count); } } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenCellService.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenCellService.java index 0942a2b..030d232 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenCellService.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenCellService.java @@ -30,7 +30,7 @@ public interface TenCellService extends IService { void updateByIdResis(TenCellEntity cell); - int syncRoomAddress(Long cellId); + int syncRoomAddress(Long cellId,Integer layerFlag); } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenRoomService.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenRoomService.java index dec702f..06a73ed 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenRoomService.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/TenRoomService.java @@ -49,6 +49,6 @@ public interface TenRoomService { List getNotSync(Long paramLong); - int syncAddress(Long cellId); + int syncAddress(Long cellId,Integer layerFlag); } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenCellServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenCellServiceImpl.java index 966d768..fa7326b 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenCellServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenCellServiceImpl.java @@ -181,7 +181,7 @@ public class TenCellServiceImpl extends ServiceImpl i } @Override - public int syncRoomAddress(Long cellId) { - return tenRoomService.syncAddress(cellId); + public int syncRoomAddress(Long cellId,Integer layerFlag) { + return tenRoomService.syncAddress(cellId,layerFlag); } } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRoomServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRoomServiceImpl.java index b06252c..ff58f14 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRoomServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRoomServiceImpl.java @@ -205,7 +205,7 @@ public class TenRoomServiceImpl implements TenRoomService { @Override @Transactional(rollbackFor = Exception.class) - public int syncAddress(Long cellId) { + public int syncAddress(Long cellId,Integer layerFlag) { List allRooms = tenRoomDao.getNotBindByCellId(cellId); TenCellEntity cellEntity = tenCellService.getById(cellId); int count = 0; @@ -217,12 +217,23 @@ public class TenRoomServiceImpl implements TenRoomService { String unit = buildEntity.getUnit(); String layer = roomEntity.getLayer().toString(); String roomNumber = roomEntity.getRoomNumber().toString(); - String address = "号"+buildNumber+"栋"+unit+"单元"+layer+"层"+roomNumber+"号"; + //查询可以关联的标准地址 - List searchAddressList = tenAddressService.list(new QueryWrapper() - .eq("dzjb",14) - .eq("xqid",xqid) - .like("dzqc",address)); + List searchAddressList = new ArrayList<>(); + if(layerFlag.intValue() == 0){ + String address = "号"+buildNumber+"栋"+unit+"单元"+layer+"层"+roomNumber+"号"; + searchAddressList = tenAddressService.list(new QueryWrapper() + .eq("dzjb",14) + .eq("xqid",xqid) + .like("dzqc",address)); + } + if(layerFlag.intValue() == 1){ + String address = "号"+buildNumber+"栋"+unit+"单元"+layer+"层"+layer+"0?"+roomNumber+"号"; + searchAddressList = tenAddressService.list(new QueryWrapper() + .eq("dzjb",14) + .eq("xqid",xqid) + .last("and dzqc REGEXP '"+address+"'")); + } //查询关联的是否已经绑定 if(searchAddressList.size() == 1){ TenAddressEntity addressEntity = searchAddressList.get(0);