From 54ad966d0b142c97fc659263b51d1ea5d7b5c7c6 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期五, 28 五月 2021 16:17:08 +0800
Subject: [PATCH] 修改bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java
index 882d812..1b5c67b 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java
@@ -21,6 +21,7 @@
 import org.springframework.util.ObjectUtils;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -54,7 +55,7 @@
         param.eq(ComStreetDO::getAreaCode, comStreetVO.getAreaCode());
         Integer integer = comStreetDAO.selectCount(param);
         if (integer > 0) {
-            return R.fail("街道已经存在");
+            return R.fail(500, "街道已经存在");
         }
         BeanUtils.copyProperties(comStreetVO, comStreetDO);
         int insert = comStreetDAO.insert(comStreetDO);
@@ -63,7 +64,7 @@
             BeanUtils.copyProperties(comStreetDO1, comStreetVO);
             return R.ok(comStreetVO);
         }
-        return R.fail();
+        return R.fail(500,"");
     }
 
 
@@ -85,8 +86,14 @@
         if (comStreetVO.getAreaCode() != null) {
             param.eq(ComStreetDO::getAreaCode, comStreetVO.getAreaCode());
         }
+        List<ComStreetVO> voList = Lists.newArrayList();
         List<ComStreetDO> comStreetDOS = comStreetDAO.selectList(param);
-        return R.ok(comStreetDOS);
+        comStreetDOS.forEach(dos -> {
+            ComStreetVO vo = new ComStreetVO();
+            BeanUtils.copyProperties(dos, vo);
+            voList.add(vo);
+        });
+        return R.ok(voList);
     }
 
     /**
@@ -138,6 +145,7 @@
 
     /**
      * 批量删除街道
+     *
      * @param streetIds 社区id
      * @return 删除结果
      */

--
Gitblit v1.7.1