From 6873ee2b98283d9a876dfc6e5d878094e5de61d9 Mon Sep 17 00:00:00 2001 From: huanghongfa <18228131219@163.com> Date: 星期三, 20 一月 2021 11:30:46 +0800 Subject: [PATCH] 系统配置 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java | 61 +++++++++++++++++++++++++++++- 1 files changed, 59 insertions(+), 2 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java index db1d137..541f5f4 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java @@ -615,7 +615,22 @@ */ @PostMapping("batchhouse") public R batchHouse(@RequestBody BatchhouseVO batchhouseVO) { - return comMngStructHouseService.batchHouse(batchhouseVO); + R r = comMngStructHouseService.batchHouse(batchhouseVO); + if (R.isOk(r)) { + String areaCode = batchhouseVO.getAreaCode(); + String ruleDoor = batchhouseVO.getRuleDoor(); + String ruleConnector = batchhouseVO.getRuleConnector(); + String ruleFloor = batchhouseVO.getRuleFloor(); + ComMngStructAreaVO comMngStructAreaVO=new ComMngStructAreaVO(); + comMngStructAreaVO.setRoleDoor(ruleDoor); + comMngStructAreaVO.setRoleFloor(ruleFloor); + comMngStructAreaVO.setRoleConnector(ruleConnector); + comMngStructAreaVO.setAreaCode(areaCode); + comMngStructAreaVO.setCommunityId(null); + comMngStructAreaVO.setIsAccumulation(null); + comMngStructAreaService.putArea(comMngStructAreaVO); + } + return r; } /** @@ -640,7 +655,19 @@ R r=comMngStructAreaService.selectAreaByAreaCode(batchhouseVO.getAreaCode()); if (R.isOk(r)) { ComMngStructAreaDO comMngStructAreaDO = (ComMngStructAreaDO)r.getData(); - return comMngStructHouseService.addHouse(batchhouseVO,comMngStructAreaDO); + try { + R r1 = comMngStructHouseService.addHouse(batchhouseVO, comMngStructAreaDO); + return r1; + } catch (Exception e) { + if (e.getMessage().contains("unique_house_name")) { + return R.fail("房屋地址重复"); + }else { + log.error("添加同级地址失败【{}】",e.getMessage()); + return R.fail("添加房屋失败"); + } + } + + } return r; } @@ -1013,5 +1040,35 @@ return comActActivityService.timedTaskActActivityAll(); } + /** + * 其他建筑详情 + * @param id 主键id + * @return 建筑内容 + */ + @PostMapping("detailotherbuild") + public R detailOtherbuild(@RequestParam("id")Long id){ + return comMngStructOtherBuildService.detailOtherbuild(id); + } + + /** + * 编辑其他建筑 + * @param comMngStructOtherBuildVO 编辑内容 + * @return 编辑结果 + */ + @PostMapping("putotherbuild") + public R putOtherbuild(@RequestBody ComMngStructOtherBuildVO comMngStructOtherBuildVO){ + return comMngStructOtherBuildService.putOtherbuild(comMngStructOtherBuildVO); + } + + /** + * 删除其他建筑 + * @param id 主键 + * @return 删除结果 + */ + @PostMapping("deleteotherbuild") + public R deleteOtherbuild(@RequestParam("id")Long id){ + return comMngStructOtherBuildService.deleteOtherbuild(id); + } + } -- Gitblit v1.7.1