| | |
| | | import com.panzhihua.common.model.dtos.community.elder.PageElderAuthStatisticDTO; |
| | | import com.panzhihua.common.model.dtos.community.elder.SignElderAuthStatisticDTO; |
| | | import com.panzhihua.common.model.vos.elders.ComEldersAuthHistoryVO; |
| | | import com.panzhihua.common.model.vos.elders.ComEldersAuthStatisticVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private ComEldersAuthStatisticsMapper comEldersAuthStatisticsMapper; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComElderAuthRecordsDAO comElderAuthRecordsDAO; |
| | | @Resource |
| | | private ComElderAuthElderliesDAO comElderAuthElderliesDAO; |
| | | @Resource |
| | | private ComPensionAuthHistoryRecordMapper comPensionAuthHistoryRecordMapper; |
| | | @Resource |
| | | private ComPensionAuthRecordDAO comPensionAuthRecordDAO; |
| | | @Resource |
| | | private ComPensionAuthPensionerDAO comPensionAuthPensionerDAO; |
| | | |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | |
| | | public R setCommunityAuthType(Long communityId, Integer type) { |
| | | List<SysConfDO> authConf = |
| | | sysConfDao.selectList(new LambdaQueryWrapper<SysConfDO>().eq(SysConfDO::getCommunityId, communityId) |
| | | .eq(SysConfDO::getCode, "ELDER_AUTH_TYPE").orderByDesc(SysConfDO::getCreateAt)); |
| | | .eq(SysConfDO::getCode, "ELDER_AUTH_TYPE_" + communityId).orderByDesc(SysConfDO::getCreateAt)); |
| | | if (authConf != null && authConf.size() > 0) { |
| | | SysConfDO first = authConf.get(0); |
| | | first.setValue(type + ""); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 检测上月所有视频认证记录,取最后一条记录为认证成功记录 |
| | | * 身份认证定时任务 |
| | | * @return 执行结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R timedTaskEldersRecordAuthJobHandler(){ |
| | | Date nowDate = new Date(); |
| | | //查询所有启用中社区 |
| | | List<ComActDO> actList = comActDAO.selectList(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getState,0)); |
| | | |
| | | actList.forEach(act -> { |
| | | //查询社区上月所有视频认证 |
| | | List<ComEldersAuthHistoryVO> authList = eldersAuthDAO.getEldersAuthRecords(act.getCommunityId()); |
| | | authList.forEach(auth -> { |
| | | if(auth.getUserId() != null){ |
| | | ComEldersAuthHistoryRecordDO authHistoryRecordDO = new ComEldersAuthHistoryRecordDO(); |
| | | authHistoryRecordDO.setCommunityId(auth.getCommunityId()); |
| | | authHistoryRecordDO.setCreateAt(auth.getCreateAt()); |
| | | authHistoryRecordDO.setAuthId(auth.getId()); |
| | | authHistoryRecordDO.setUserId(auth.getUserId()); |
| | | authHistoryRecordDO.setBrithday(auth.getBirthday()); |
| | | authHistoryRecordDO.setDomicile(auth.getDomicile()); |
| | | authHistoryRecordDO.setIdCard(auth.getIdCard()); |
| | | authHistoryRecordDO.setName(auth.getName()); |
| | | authHistoryRecordDO.setIsAuth(1); |
| | | try { |
| | | Integer age = IdcardUtil.getAgeByIdCard(auth.getIdCard()); |
| | | authHistoryRecordDO.setAge(age); |
| | | }catch (Exception e){ |
| | | log.error("年龄转换失败"); |
| | | } |
| | | comEldersAuthHistoryRecordMapper.insert(authHistoryRecordDO); |
| | | } |
| | | }); |
| | | //高龄认证本期期数 |
| | | String elderAuthPeriod = DateUtils.getCurrentDateString_YYYY_MM(); |
| | | //养老认证本期期数 |
| | | String pensionAuthPeriod = DateUtils.getCurrentDateString_YYYY(); |
| | | |
| | | //查询所有老人信息并加入到老人认证历史记录表中,如果不存在则新增,存在则不做操作 |
| | | List<ComElderAuthElderliesDO> authElderliesList = comElderAuthElderliesDAO.getAuthElderLiesList(); |
| | | authElderliesList.forEach(authElderlies -> { |
| | | //查询高龄认证记录 |
| | | ComEldersAuthHistoryRecordDO authHistoryRecordDO = comEldersAuthHistoryRecordMapper.selectOne(new QueryWrapper<ComEldersAuthHistoryRecordDO>().lambda() |
| | | .eq(ComEldersAuthHistoryRecordDO::getElderliesId,authElderlies.getId()) |
| | | .eq(ComEldersAuthHistoryRecordDO::getAuthPeriod,elderAuthPeriod)); |
| | | if(authHistoryRecordDO == null){ |
| | | authHistoryRecordDO = new ComEldersAuthHistoryRecordDO(); |
| | | BeanUtils.copyProperties(authElderlies,authHistoryRecordDO); |
| | | authHistoryRecordDO.setIsAuth(ComEldersAuthHistoryRecordDO.isAuth.no); |
| | | authHistoryRecordDO.setElderliesId(authElderlies.getId()); |
| | | authHistoryRecordDO.setAuthPeriod(elderAuthPeriod); |
| | | authHistoryRecordDO.setCreateAt(nowDate); |
| | | authHistoryRecordDO.setBrithday(IdcardUtil.getBirthByIdCard(authElderlies.getIdCard())); |
| | | authHistoryRecordDO.setAge(IdcardUtil.getAgeByIdCard(authElderlies.getIdCard())); |
| | | comEldersAuthHistoryRecordMapper.insert(authHistoryRecordDO); |
| | | } |
| | | }); |
| | | |
| | | //查询所有养老人员信息并加入到老人认证历史记录表中,如果不存在则新增,存在则不做操作 |
| | | List<ComPensionAuthPensionerDO> pensionAuthPensionerList = comPensionAuthPensionerDAO.getAuthPensionList(); |
| | | pensionAuthPensionerList.forEach(authPension -> { |
| | | //查询养老认证记录 |
| | | ComPensionAuthHistoryRecordDO pensionAuthDO = comPensionAuthHistoryRecordMapper.selectOne(new QueryWrapper<ComPensionAuthHistoryRecordDO>().lambda() |
| | | .eq(ComPensionAuthHistoryRecordDO::getElderliesId,authPension.getId()) |
| | | .eq(ComPensionAuthHistoryRecordDO::getAuthPeriod,pensionAuthPeriod)); |
| | | if(pensionAuthDO == null){ |
| | | pensionAuthDO = new ComPensionAuthHistoryRecordDO(); |
| | | BeanUtils.copyProperties(authPension,pensionAuthDO); |
| | | pensionAuthDO.setIsAuth(ComPensionAuthHistoryRecordDO.isAuth.no); |
| | | pensionAuthDO.setElderliesId(authPension.getId()); |
| | | pensionAuthDO.setAuthPeriod(pensionAuthPeriod); |
| | | pensionAuthDO.setCreateAt(nowDate); |
| | | pensionAuthDO.setBrithday(IdcardUtil.getBirthByIdCard(authPension.getIdCard())); |
| | | pensionAuthDO.setAge(IdcardUtil.getAgeByIdCard(authPension.getIdCard())); |
| | | comPensionAuthHistoryRecordMapper.insert(pensionAuthDO); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public R pageAuthStatisticAdmin(PageElderAuthStatisticDTO pageElderAuthStatisticDTO){ |
| | | return R.ok(comEldersAuthHistoryRecordMapper.pageAuthStatisticAdmin(new Page(pageElderAuthStatisticDTO.getPageNum(),pageElderAuthStatisticDTO.getPageSize()),pageElderAuthStatisticDTO)); |
| | | IPage<ComEldersAuthStatisticVO> authStatisticPage = comEldersAuthHistoryRecordMapper.pageAuthStatisticAdmin( |
| | | new Page(pageElderAuthStatisticDTO.getPageNum(),pageElderAuthStatisticDTO.getPageSize()),pageElderAuthStatisticDTO); |
| | | authStatisticPage.getRecords().forEach(authStatistic -> { |
| | | authStatistic.setAge(IdcardUtil.getAgeByIdCard(authStatistic.getIdCard())); |
| | | authStatistic.setBirthday(IdcardUtil.getBirth(authStatistic.getIdCard())); |
| | | }); |
| | | return R.ok(authStatisticPage); |
| | | } |
| | | |
| | | /** |