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 |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 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 e762cce..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
@@ -655,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;
     }

--
Gitblit v1.7.1