From 19f39f95190ae02a90b07c97bc9e5cb54de383a4 Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期四, 19 五月 2022 10:48:21 +0800
Subject: [PATCH] 花城E+bug更新

---
 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngVillageServeExcelListen.java                        |    6 ++++++
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java |    5 ++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngVillageServeExcelListen.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngVillageServeExcelListen.java
index 7d155b9..1f19118 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngVillageServeExcelListen.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngVillageServeExcelListen.java
@@ -34,6 +34,12 @@
 
     @Override
     public void invoke(ComMngVillageServeExcelVO comMngVillageServeExcelVO, AnalysisContext analysisContext) {
+        try {
+            Integer.parseInt(comMngVillageServeExcelVO.getHouseNum());
+        }
+        catch (Exception e){
+            throw new ServiceException("门牌号只能为纯数字");
+        }
         list.add(comMngVillageServeExcelVO);
         // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM
         if (list.size() >= BATCH_COUNT) {
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
index 258bdab..01028ba 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
@@ -202,8 +202,11 @@
             boolean result = comMngVillageDOs.stream().anyMatch(
                 village -> village.getAlley().equals(vo.getAlley()) && village.getHouseNum().equals(vo.getHouseNum()));
             if (result) {
-                return R.fail("导入街路巷已存在(" + vo.getAlley() + ")");
+                return R.fail("导入街路巷重复(" + vo.getAlley() + ")");
             }
+            ComMngVillageDO comMngVillageDO=new ComMngVillageDO();
+            BeanUtils.copyProperties(vo,comMngVillageDO);
+            comMngVillageDOs.add(comMngVillageDO);
             index++;
         }
         ComActDO comActDO = comActDAO.selectById(communityId);

--
Gitblit v1.7.1