From 46e7cd9daeb5072eb562317520307a1d60b1446e Mon Sep 17 00:00:00 2001 From: huanghongfa <18228131219@163.com> Date: 星期四, 25 二月 2021 13:15:47 +0800 Subject: [PATCH] all --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructAreaServiceImpl.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 52 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructAreaServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructAreaServiceImpl.java index a7e7416..1f0eb33 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructAreaServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngStructAreaServiceImpl.java @@ -182,5 +182,57 @@ return R.ok(comMngStructAreaVO); } + /** + * 选择导入的小区 + * + * @param param 小区名字 模糊查询 + * @param communityId 社区id + * @return 小区集合 ComMngStructAreaVO + */ + @Override + public R listAreas(String param, Long communityId) { + List<ComMngStructAreaVO> comMngStructAreaVOS=new ArrayList<>(); + comMngStructAreaVOS =comMngStructAreaDAO.listAreas(param,communityId); + if (!ObjectUtils.isEmpty(comMngStructAreaVOS)) { + comMngStructAreaVOS.forEach(comMngStructAreaVO -> { + String roleConnector = comMngStructAreaVO.getRoleConnector(); + String roleFloor = comMngStructAreaVO.getRoleFloor(); + String roleDoor = comMngStructAreaVO.getRoleDoor(); + String doorNum="1-1-1-"+roleFloor+roleConnector+roleDoor; + if (!ObjectUtils.isEmpty(roleFloor)) { + comMngStructAreaVO.setDoorNum(doorNum); + } + }); + } + return R.ok(comMngStructAreaVOS); + } + + /** + * 检查小区是否已经批量设置过房屋并且返回小区房屋门号规则 + * + * @param id 小区id + * @return ComMngStructAreaVO + */ + @Override + public R checkAreaHouse(Long id) { + ComMngStructAreaDO comMngStructAreaDO = comMngStructAreaDAO.selectById(id); + if (null==comMngStructAreaDO) { + return R.fail("小区不存在"); + } + String roleFloor = comMngStructAreaDO.getRoleFloor(); + String roleDoor = comMngStructAreaDO.getRoleDoor(); + String areaCode = comMngStructAreaDO.getAreaCode(); + if (ObjectUtils.isEmpty(roleDoor)||ObjectUtils.isEmpty(roleFloor)) { + return R.fail("小区未批量设置房屋,请先去社区后台配置"); + } + Integer num=comMngStructAreaDAO.selectCountHouseByParentHouseCode(areaCode); + if (num.intValue()==0) { + return R.fail("小区未批量设置房屋,请先去社区后台配置"); + } + ComMngStructAreaVO comMngStructAreaVO=new ComMngStructAreaVO(); + BeanUtils.copyProperties(comMngStructAreaDO,comMngStructAreaVO); + return R.ok(comMngStructAreaVO); + } + } -- Gitblit v1.7.1