From ec76ed1ea86e13cd76dc99ec0dfdf657d34919a5 Mon Sep 17 00:00:00 2001
From: CeDo <cedoogle@gmail.com>
Date: 星期二, 11 五月 2021 09:15:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

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 7c1ac3a..da1869d 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
@@ -14,9 +14,7 @@
 import com.panzhihua.service_community.dao.ComActDAO;
 import com.panzhihua.service_community.dao.ComActVillageDAO;
 import com.panzhihua.service_community.dao.ComMngPopulationDAO;
-import com.panzhihua.service_community.dao.ComMngVolunteerMngDAO;
 import com.panzhihua.service_community.model.dos.ComActDO;
-import com.panzhihua.service_community.model.dos.ComActDiscussDO;
 import com.panzhihua.service_community.model.dos.ComMngPopulationDO;
 import com.panzhihua.service_community.model.dos.ComMngVillageDO;
 import com.panzhihua.service_community.service.ComMngVillageService;
@@ -25,10 +23,7 @@
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * @author: llming
@@ -160,4 +155,24 @@
         this.saveBatch(comMngVillageDOS);
         return R.ok("共计导入实有房屋数量:" + comMngVillageDOS.size());
     }
+
+    @Override
+    public R editVillage(Long villageId, ComMngVillageVO comMngVillageVO) {
+        ComMngVillageDO comMngVillageDO = this.baseMapper.selectById(villageId);
+        if (comMngVillageDO == null) {
+            return R.fail("id有误!");
+        }
+        BeanUtils.copyProperties(comMngVillageVO, comMngVillageDO);
+        ComActDO comActDO = comActDAO.selectById(comMngVillageDO.getCommunityId());
+        if (comActDO == null || comActDO.getStreetId() == null) {
+            return R.fail("社区没有绑定街道,请绑定后操作!");
+        }
+        comMngVillageDO.setStreetId(comActDO.getStreetId());
+        int update = this.baseMapper.update(comMngVillageDO, new LambdaQueryWrapper<ComMngVillageDO>()
+                .eq(ComMngVillageDO::getVillageId, villageId));
+        if(update>0){
+            return R.ok(comMngVillageVO);
+        }
+        return R.fail();
+    }
 }

--
Gitblit v1.7.1