From 50e1eb020efe8da670b718d865fa4c1eaa61ee7d Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 20 五月 2021 19:51:09 +0800
Subject: [PATCH] 修改bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
index a1055c6..00c5bc0 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -20,6 +20,7 @@
 import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO;
 import com.panzhihua.common.model.vos.user.InputUserInfoVO;
 import com.panzhihua.common.model.vos.user.UserElectronicFileVO;
+import com.panzhihua.common.utlis.AgeUtils;
 import com.panzhihua.service_community.dao.ComActDAO;
 import com.panzhihua.service_community.dao.ComActVillageDAO;
 import com.panzhihua.service_community.dao.ComMngPopulationDAO;
@@ -43,6 +44,7 @@
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -173,6 +175,16 @@
         page.setSize(pageSize);
         page.setCurrent(pageNum);
         IPage<ComMngPopulationVO> iPage = populationDAO.pagePopulation(page, comMngPopulationVO);
+        iPage.getRecords().forEach(vo->{
+            //获取用户生日
+            String date = vo.getCardNo().substring(6, 14);
+            String year = date.substring(0,4);
+            String month = date.substring(4,6);
+            String day = date.substring(6,8);
+            String birthday = year + "-" + month + "-" + day;
+            //设置用户年龄
+            vo.setBirthday(birthday);
+        });
         return R.ok(iPage);
     }
 
@@ -448,6 +460,7 @@
         if(!StringUtils.isEmpty(comMngVillageDO.getGroupAt())){
             populationDO.setVillageName(comMngVillageDO.getGroupAt());
         }
+        populationDO.setUpdateAt(new Date());
 //        this.updateById(populationDO);
         if(populationDAO.updateById(populationDO) > 0){
             return R.ok();
@@ -503,4 +516,14 @@
         }
         return R.ok();
     }
+
+    @Override
+    public R editUserElectronicFile(UserElectronicFileVO userElectronicFileVO) {
+        UserElectronicFileVO electronicFileVO = populationDAO.getSysUserById(userElectronicFileVO.getUserId());
+        if(electronicFileVO==null){
+            return R.fail("id有误!");
+        }
+         populationDAO.updateSysUserElectronicFile(userElectronicFileVO);
+        return R.ok();
+    }
 }

--
Gitblit v1.7.1