From 232ba6884fc96e251184a2a1b0fc1499fbe899b0 Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期五, 24 九月 2021 15:25:29 +0800
Subject: [PATCH] 便民服务问题修改

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java |   48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java
index b3f5e07..ba43122 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java
@@ -543,7 +543,7 @@
             if(resultMap != null){
                 ComEldersAuthStatisticsDO authStatisticsDO = new ComEldersAuthStatisticsDO();
                 authStatisticsDO.setCommunityId(act.getCommunityId());
-                authStatisticsDO.setMonth(DateUtils.getMonth(nowDate));
+                authStatisticsDO.setMonth(DateUtils.getMonth(nowDate) + 1);
                 authStatisticsDO.setYear(DateUtils.getYear(nowDate));
                 authStatisticsDO.setCreateAt(nowDate);
                 authStatisticsDO.setSum(Integer.parseInt(resultMap.get("oldCount").toString()));
@@ -595,4 +595,50 @@
         });
         return R.ok();
     }
+
+    @Override
+    public R setAuthType(Long communityId, Integer type){
+        List<SysConfDO> authConf =
+                sysConfDao.selectList(new LambdaQueryWrapper<SysConfDO>().eq(SysConfDO::getCommunityId, communityId)
+                        .eq(SysConfDO::getCode, "ELDER_AUTH_TYPE_" + communityId).orderByDesc(SysConfDO::getCreateAt));
+        if (authConf != null && authConf.size() > 0) {
+            SysConfDO first = authConf.get(0);
+            first.setValue(type + "");
+            int updated = sysConfDao.updateById(first);
+            if (updated == 1) {
+                return R.ok();
+            }
+        }
+        return R.fail();
+    }
+
+    @Override
+    public R getAuthType(EldersAuthTypeQueryDTO eldersAuthTypeQueryDTO){
+        Long communityId = eldersAuthTypeQueryDTO.getCommunityId();
+        List<SysConfDO> confDOList = sysConfDao.selectList(new LambdaQueryWrapper<SysConfDO>()
+                .eq(SysConfDO::getCommunityId, communityId).eq(SysConfDO::getCode,"ELDER_AUTH_TYPE_" + communityId).orderByDesc(SysConfDO::getCreateAt));
+        if (confDOList == null || confDOList.size() == 0) {
+            SysConfDO sysConfDO = new SysConfDO();
+            sysConfDO.setCode("ELDER_AUTH_TYPE_" + communityId);
+            sysConfDO.setName("高龄认证类型");
+            sysConfDO.setValue(2 + "");// 核验类型(1.视频认证 2.人脸核验)
+            sysConfDO.setDescription("高龄认证默认添加的核验类型");
+            sysConfDO.setCommunityId(communityId);
+            sysConfDO.setCreateBy(eldersAuthTypeQueryDTO.getUserId());
+            int inserted = sysConfDao.insert(sysConfDO);
+            if (inserted != 1) {
+                throw new ServiceException("添加高龄认证默认添加的核验类型失败");
+            }
+            confDOList = sysConfDao.selectList(new LambdaQueryWrapper<SysConfDO>()
+                    .eq(SysConfDO::getCommunityId, communityId)
+                    .orderByDesc(SysConfDO::getCreateAt));
+        }
+        if (confDOList != null && confDOList.size() > 0) {
+            SysConfDO latest = confDOList.get(0);
+            SysConfVO sysConfVO = new SysConfVO();
+            BeanUtils.copyProperties(latest, sysConfVO);
+            return R.ok(sysConfVO.getValue());
+        }
+        return R.ok();
+    }
 }

--
Gitblit v1.7.1