| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import static java.util.stream.Collectors.toList; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.service_community.dao.ComActActEvaluateDAO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthAddByFamilyDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthAddDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthEditDTO; |
| | | import com.panzhihua.common.model.dtos.community.EldersAuthFeedbackAddDTO; |
| | | import com.panzhihua.common.model.dtos.community.GrantRewardDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageEldersAuthDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageQuestnaireAnswerDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageQuestnaireDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageQuestnaireSubDetailsDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.ExportEasyPhotoDTO; |
| | | import com.panzhihua.common.model.dtos.community.questnaire.StatisticsSummaryDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.ActivitySignVO; |
| | | import com.panzhihua.common.model.vos.community.BatchhouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActPrizeVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActRegistVO; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageBackVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.ComActMicroWishVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructOtherBuildVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngAppletsVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthDetailsVO; |
| | | import com.panzhihua.common.model.vos.community.EldersAuthVO; |
| | | import com.panzhihua.common.model.vos.community.ResetComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.SignactivityVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.EditComActQuestnaireVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO; |
| | |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.*; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.IdCard; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.service_community.dao.ComActActSignDAO; |
| | | import com.panzhihua.service_community.dao.ComEldersAuthHistoryRecordMapper; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationDAO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.*; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | private ComActEasyPhotoActivityService comActEasyPhotoActivityService; |
| | | @Resource |
| | | private ComActActEvaluateService comActActEvaluateService; |
| | | @Resource |
| | | private ComEldersAuthElderlyService comEldersAuthElderlyService; |
| | | @Resource |
| | | private ComActMicroWishOperationRecordService wishOperationRecordService; |
| | | @Resource |
| | | private ComActActEvaluateDAO comActActEvaluateDAO; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | } else { |
| | | comActActivityVO1.setType(2); |
| | | } |
| | | fillActivitySignList(id, comActActivityVO1); |
| | | }); |
| | | page.setRecords(content); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("detailactivity") |
| | | public R detailActivity(@RequestParam("id") Long id, |
| | | @RequestParam(value = "userId", required = false) Long userId) { |
| | | @RequestParam(value = "userId", required = false) Long userId, |
| | | @RequestParam(value = "pageNum",defaultValue = "1", required = false) Long pageNum, |
| | | @RequestParam(value = "pageSize",defaultValue = "10", required = false) Long pageSize) { |
| | | ComActActivityVO comActActivityVO = comActActivityService.inforActivity(id, userId); |
| | | if (ObjectUtils.isEmpty(comActActivityVO)) { |
| | | return R.fail("活动不存在"); |
| | |
| | | comActActivityVO.setComActActPrizeVOList(comActActPrizeVOS); |
| | | } |
| | | //活动评价 |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = comActActEvaluateService |
| | | .list(new QueryWrapper<ComActActEvaluateDO>().lambda().eq(ComActActEvaluateDO::getActivityId, id)); |
| | | if (!ObjectUtils.isEmpty(comActActEvaluateDOList)) { |
| | | List<ComActActEvaluateVO> comActActEvaluateVOList = new ArrayList<>(); |
| | | comActActEvaluateDOList.forEach(comActActEvaluateDO -> { |
| | | ComActActEvaluateVO comActActEvaluateVO = new ComActActEvaluateVO(); |
| | | BeanUtils.copyProperties(comActActEvaluateDO, comActActEvaluateVO); |
| | | comActActEvaluateVOList.add(comActActEvaluateVO); |
| | | }); |
| | | comActActivityVO.setComActActEvaluateVOList(comActActEvaluateVOList); |
| | | //活动评价总数 |
| | | comActActivityVO.setEvaluateAmount(comActActEvaluateDOList.size()); |
| | | IPage<ComActActEvaluateVO> comActActEvaluatePage = comActActEvaluateDAO.getEvaluateListPage(new Page(pageNum,pageSize),id); |
| | | comActActivityVO.setComActActEvaluateVOList(comActActEvaluatePage.getRecords()); |
| | | //活动评价总数 |
| | | comActActivityVO.setEvaluateAmount(comActActEvaluatePage.getTotal()); |
| | | //当前用户对活动的评分 |
| | | ComActActEvaluateVO userActEvaluateVO = comActActEvaluateDAO.getEvaluateListByUserId(id,userId); |
| | | if(userActEvaluateVO != null){ |
| | | comActActivityVO.setMyRating(userActEvaluateVO.getStarLevel()); |
| | | } |
| | | fillActivitySignList(id, comActActivityVO); |
| | | comActActivityVO.setIntegral(0); |
| | | return R.ok(comActActivityVO); |
| | | } |
| | | |
| | | /** |
| | | * 填充活动报名名单 |
| | | * @param activityId 活动id |
| | | * @param comActActivityVO 需填充VO |
| | | */ |
| | | private void fillActivitySignList(Long activityId, ComActActivityVO comActActivityVO) { |
| | | //活动报名名单 |
| | | ActivitySignVO activitySignVO = new ActivitySignVO(); |
| | | activitySignVO.setActivityId(id); |
| | | activitySignVO.setActivityId(activityId); |
| | | R r = comActActivityService.listActivitySigns(activitySignVO); |
| | | if (R.isOk(r)) { |
| | | List<ActivitySignVO> activitySignVOS = |
| | |
| | | } |
| | | } |
| | | List<ActivitySignVO> collect = activitySignVOS.stream() |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 1).collect(Collectors.toList()); |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 1).collect(toList()); |
| | | if (!ObjectUtils.isEmpty(collect)) { |
| | | int size = collect.size(); |
| | | if (size >= 6) { |
| | |
| | | } |
| | | } |
| | | List<ActivitySignVO> collect1 = activitySignVOS.stream() |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 0).collect(Collectors.toList()); |
| | | .filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 0).collect(toList()); |
| | | if (!ObjectUtils.isEmpty(collect1)) { |
| | | int size = collect1.size(); |
| | | if (size >= 6) { |
| | |
| | | } |
| | | |
| | | } |
| | | comActActivityVO.setIntegral(0); |
| | | return R.ok(comActActivityVO); |
| | | } |
| | | |
| | | /** |
| | | * 活动签到 |
| | | * |
| | | * @param comActActRegistVO 请求参数 |
| | | * @return 签到结果 |
| | | */ |
| | | @PostMapping("activity/sign-in") |
| | | public R activitySignIn(@RequestBody ComActActRegistVO comActActRegistVO) { |
| | | return comActActivityService.activitySignIn(comActActRegistVO); |
| | | } |
| | | |
| | | /** |
| | | * 用户签到列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 用户签到记录列表 |
| | | */ |
| | | @GetMapping("/sign-in/user/list") |
| | | public R listSignInActivity(@RequestParam("userId") Long userId) { |
| | | return comActActivityService.listSignInActivity(userId); |
| | | } |
| | | |
| | | /** |
| | | * 社区活动评价 |
| | | * |
| | | * @param comActActEvaluateVO 社区评价VO |
| | | * @return 评价结果 |
| | | */ |
| | | @PostMapping("activity/evaluate") |
| | | public R activityEvaluate(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { |
| | | return comActActEvaluateService.activityEvaluate(comActActEvaluateVO); |
| | | } |
| | | |
| | | /** |
| | | * 用户评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 当前用户对所有活动的评价列表 |
| | | */ |
| | | @GetMapping("/evaluate/user/list") |
| | | public R listEvaluate(@RequestParam("userId") Long userId) { |
| | | return comActActEvaluateService.listEvaluate(userId); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * description getRegistLists 查询活动未签到 |
| | | * @param comActActRegistVO 查询参数 |
| | | * @return R 查询结果 |
| | | * @author txb |
| | | * @date 2021/8/25 9:33 |
| | | */ |
| | | @PostMapping("activity/noRegist/getList") |
| | | public R getNoRegistLists(@RequestBody ComActActRegistVO comActActRegistVO){ |
| | | return comActActivityService.getNoRegistLists(comActActRegistVO); |
| | | } |
| | | |
| | | /** |
| | | * description activityStagistics 活动数据统计 |
| | | * @param activityId 活动id |
| | | * @return R 统计结果 |
| | |
| | | @GetMapping("activity/statistics") |
| | | public R activityStatistics(@RequestParam("activityId") Long activityId){ |
| | | return comActActivityService.activityStatistics(activityId); |
| | | } |
| | | |
| | | /** |
| | | * 获取活动历史封面 getPictureList |
| | | * @param userId 用户id |
| | | * @return R 统计结果 |
| | | * @author txb |
| | | * @date 2021/8/27 13:33 |
| | | */ |
| | | @GetMapping("/activity/picture/getList") |
| | | public R getPictureList(@RequestParam("userId") Long userId){ |
| | | return comActActivityService.getPictureList(userId); |
| | | } |
| | | |
| | | /** |
| | | * 获取系统预置图库 getSysPictureList |
| | | * @param type 图库类型 |
| | | * @return R 系统图库集 |
| | | * @author txb |
| | | * @date 2021/8/27 13:33 |
| | | */ |
| | | @GetMapping("/activity/sysPicture/getList") |
| | | public R getSysPictureList(@RequestParam(value = "type") Integer type){ |
| | | return comActActivityService.getSysPictureList(type); |
| | | } |
| | | |
| | | /** |
| | |
| | | int size = list.size(); |
| | | if (size == 4) { |
| | | List<ComActDynDO> collect = list.stream().sorted(Comparator.comparing(ComActDynDO::getCreateAt)) |
| | | .collect(Collectors.toList()); |
| | | .collect(toList()); |
| | | ComActDynDO comActDynDO1 = collect.get(0); |
| | | comActDynDO1.setIsTopping(0); |
| | | boolean update = comActDynService.updateById(comActDynDO1); |
| | |
| | | int size = list.size(); |
| | | if (size == 4) { |
| | | List<ComActDynDO> collect = list.stream().sorted(Comparator.comparing(ComActDynDO::getUpdateAt)) |
| | | .collect(Collectors.toList()); |
| | | .collect(toList()); |
| | | ComActDynDO comActDynDO1 = collect.get(0); |
| | | comActDynDO1.setIsTopping(0); |
| | | boolean updateById = comActDynService.updateById(comActDynDO1); |
| | |
| | | return comActMicroWishService.pageMicroWish(comActMicroWishVO); |
| | | } |
| | | |
| | | @PostMapping("pagemicrowish/applets") |
| | | public R pageMicroWishApplets(@RequestBody ComActMicroWishVO comActMicroWishVO) { |
| | | return comActMicroWishService.pageMicroWishApplets(comActMicroWishVO); |
| | | } |
| | | |
| | | /** |
| | | * 心愿详情 |
| | | * |
| | |
| | | BeanUtils.copyProperties(comActMicroWishVO, comActMicroWishDO); |
| | | boolean save = comActMicroWishService.save(comActMicroWishDO); |
| | | if (save) { |
| | | wishOperationRecordService.addOperationRecord("用户提交微心愿",comActMicroWishVO.getSponsorId() |
| | | ,comActMicroWishDO.getId(), ComActMicroWishOperationRecordDO.type.ytj,"用户提交微心愿",null); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | if (authUserDO == null) { |
| | | return R.fail("未查询到老人信息"); |
| | | } |
| | | |
| | | Long elderId = authUserDO.getId(); |
| | | boolean canReAuthThisMonth = comEldersAuthUserService.checkReAuthAgain(elderId); |
| | | if (!canReAuthThisMonth) { |
| | | return R.fail("当月已认证,不能再次进行认证"); |
| | | } |
| | | |
| | | //根据身份证获取出生日期并获取岁数 |
| | | String idCard = authUserDO.getIdCard(); |
| | | |
| | | Long loginUserId = eldersAuthAddByFamilyDTO.getUserId(); |
| | | EldersAuthDO eldersAuthDO = new EldersAuthDO(); |
| | | eldersAuthDO.setSumitUserId(loginUserId); |
| | | eldersAuthDO.setCreateBy(loginUserId); |
| | | eldersAuthDO.setCreateAt(new Date()); |
| | | eldersAuthDO.setIdCard(idCard); |
| | | eldersAuthDO.setAuthUserName(authUserDO.getName()); |
| | | eldersAuthDO.setVideoUrl(eldersAuthAddByFamilyDTO.getVideoUrl()); |
| | | eldersAuthDO.setFamilyUserId(authUserDO.getId()); |
| | | eldersAuthDO.setAge(IdcardUtil.getAgeByIdCard(idCard)); |
| | | // 根据身份证查询出籍贯 出生日期 |
| | | // String domicile = IdCard.domicile(eldersAuthDO.getIdCard()); |
| | | String domicile = eldersAuthService.queryDomicile(eldersAuthDO.getIdCard()); |
| | | if (StringUtils.isEmpty(domicile)) { |
| | | domicile = "暂无"; |
| | | } |
| | | |
| | | Date birthDay = IdCard.birthDay(idCard); |
| | | eldersAuthDO.setDomicile(domicile); |
| | | eldersAuthDO.setBirthDay(birthDay); |
| | | int add = eldersAuthService.getBaseMapper().insert(eldersAuthDO); |
| | | if (add == 1) { |
| | | // 设置认证成功 |
| | | Long familyUserId = eldersAuthDO.getFamilyUserId(); |
| | | ComEldersAuthUserDO comEldersAuthUserDO = new ComEldersAuthUserDO(); |
| | | comEldersAuthUserDO.setId(familyUserId); |
| | | comEldersAuthUserDO.setIsAuth(1); |
| | | boolean updated = comEldersAuthUserService.updateById(comEldersAuthUserDO); |
| | | if (!updated) { |
| | | throw new ServiceException("添加认证失败,更新认证状态"); |
| | | } |
| | | // 认证成功 添加认证记录 |
| | | List<ComEldersAuthHistoryRecordDO> authHistoryRecordDOList = |
| | | comEldersAuthHistoryRecordMapper.selectList(new QueryWrapper<ComEldersAuthHistoryRecordDO>().lambda() |
| | | .eq(ComEldersAuthHistoryRecordDO::getIdCard, idCard) |
| | | .ge(ComEldersAuthHistoryRecordDO::getCreateAt, DateUtils.getFirstDayOfMonth())); |
| | | if (authHistoryRecordDOList.isEmpty()) { |
| | | ComEldersAuthHistoryRecordDO authHistoryRecordDO = new ComEldersAuthHistoryRecordDO(); |
| | | authHistoryRecordDO.setUserId(eldersAuthAddByFamilyDTO.getFamilyUserId()); |
| | | authHistoryRecordDO.setAuthId(eldersAuthDO.getId()); |
| | | BeanUtils.copyProperties(eldersAuthDO, authHistoryRecordDO); |
| | | authHistoryRecordDO.setId(null); |
| | | authHistoryRecordDO.setBrithday(AgeUtils.getAgeFormatBirthday(IdcardUtil.getBirthByIdCard(idCard))); |
| | | authHistoryRecordDO.setAge(IdcardUtil.getAgeByIdCard(idCard)); |
| | | authHistoryRecordDO.setIsAuth(1); |
| | | authHistoryRecordDO.setDomicile(domicile); |
| | | comEldersAuthHistoryRecordMapper.insert(authHistoryRecordDO); |
| | | } |
| | | return R.ok(eldersAuthDO.getId()); |
| | | } |
| | | long year=DateUtil.betweenYear(birthDay,DateUtil.date(),true); |
| | | if(authUserDO.getBigAgeId()!=null){ |
| | | ComEldersAuthElderlyDO comEldersAuthElderlyDO=comEldersAuthElderlyService.getById(authUserDO.getBigAgeId()); |
| | | if(comEldersAuthElderlyDO!=null&&comEldersAuthElderlyDO.getIsExist()==ComEldersAuthElderlyDO.isExist.yes&&comEldersAuthElderlyDO.getIsBigAge()==ComEldersAuthElderlyDO.isBigAge.yes&&year>=80){ |
| | | Long elderId = authUserDO.getId(); |
| | | boolean canReAuthThisMonth = comEldersAuthUserService.checkReAuthAgain(elderId); |
| | | if (!canReAuthThisMonth) { |
| | | return R.fail("当月已认证,不能再次进行认证"); |
| | | } |
| | | Long loginUserId = eldersAuthAddByFamilyDTO.getUserId(); |
| | | EldersAuthDO eldersAuthDO = new EldersAuthDO(); |
| | | eldersAuthDO.setSumitUserId(loginUserId); |
| | | eldersAuthDO.setCreateBy(loginUserId); |
| | | eldersAuthDO.setCreateAt(new Date()); |
| | | eldersAuthDO.setIdCard(idCard); |
| | | eldersAuthDO.setAuthUserName(authUserDO.getName()); |
| | | eldersAuthDO.setVideoUrl(eldersAuthAddByFamilyDTO.getVideoUrl()); |
| | | eldersAuthDO.setFamilyUserId(authUserDO.getId()); |
| | | eldersAuthDO.setAge(IdcardUtil.getAgeByIdCard(idCard)); |
| | | // 根据身份证查询出籍贯 出生日期 |
| | | // String domicile = IdCard.domicile(eldersAuthDO.getIdCard()); |
| | | String domicile = eldersAuthService.queryDomicile(eldersAuthDO.getIdCard()); |
| | | if (StringUtils.isEmpty(domicile)) { |
| | | domicile = "暂无"; |
| | | } |
| | | eldersAuthDO.setDomicile(domicile); |
| | | eldersAuthDO.setBirthDay(birthDay); |
| | | int add = eldersAuthService.getBaseMapper().insert(eldersAuthDO); |
| | | if (add == 1) { |
| | | // 设置认证成功 |
| | | Long familyUserId = eldersAuthDO.getFamilyUserId(); |
| | | ComEldersAuthUserDO comEldersAuthUserDO = new ComEldersAuthUserDO(); |
| | | comEldersAuthUserDO.setId(familyUserId); |
| | | comEldersAuthUserDO.setIsAuth(1); |
| | | boolean updated = comEldersAuthUserService.updateById(comEldersAuthUserDO); |
| | | if (!updated) { |
| | | throw new ServiceException("添加认证失败,更新认证状态"); |
| | | } |
| | | // 认证成功 添加认证记录 |
| | | List<ComEldersAuthHistoryRecordDO> authHistoryRecordDOList = |
| | | comEldersAuthHistoryRecordMapper.selectList(new QueryWrapper<ComEldersAuthHistoryRecordDO>().lambda() |
| | | .eq(ComEldersAuthHistoryRecordDO::getIdCard, idCard) |
| | | .ge(ComEldersAuthHistoryRecordDO::getCreateAt, DateUtils.getFirstDayOfMonth())); |
| | | if (authHistoryRecordDOList.isEmpty()) { |
| | | ComEldersAuthHistoryRecordDO authHistoryRecordDO = new ComEldersAuthHistoryRecordDO(); |
| | | authHistoryRecordDO.setUserId(eldersAuthAddByFamilyDTO.getFamilyUserId()); |
| | | authHistoryRecordDO.setAuthId(eldersAuthDO.getId()); |
| | | BeanUtils.copyProperties(eldersAuthDO, authHistoryRecordDO); |
| | | authHistoryRecordDO.setId(null); |
| | | authHistoryRecordDO.setBrithday(AgeUtils.getAgeFormatBirthday(IdcardUtil.getBirthByIdCard(idCard))); |
| | | authHistoryRecordDO.setAge(IdcardUtil.getAgeByIdCard(idCard)); |
| | | authHistoryRecordDO.setIsAuth(1); |
| | | authHistoryRecordDO.setDomicile(domicile); |
| | | comEldersAuthHistoryRecordMapper.insert(authHistoryRecordDO); |
| | | } |
| | | return R.ok(eldersAuthDO.getId()); |
| | | } |
| | | |
| | | return R.fail(); |
| | | } |
| | | return R.fail("不满足认证条件"); |
| | | } |
| | | return R.fail("未查询到高龄老人库数据"); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询西区社区列表 |
| | | * |
| | | * @return 社区列表 |
| | | */ |
| | | @GetMapping("/eventgrid/community/westList") |
| | | public R getWestCommunityLists() { |
| | | return comActService.getWestCommunityLists(); |
| | | } |
| | | |
| | | /** |
| | | * 随手拍发放奖励 |
| | | * |
| | | * @param grantRewardDTO |
| | |
| | | */ |
| | | @PostMapping("easyphoto/getUserReward") |
| | | public R getUserReward(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId) { |
| | | return comActEasyPhotoService.getUserReward(userId, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 获取首页弹窗接口 |
| | | * |
| | | * @param userId |
| | | * 用户id |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 首页弹窗接口 |
| | | */ |
| | | @PostMapping("easyphoto/getUserRewards") |
| | | public R getUserRewards(@RequestParam("userId") Long userId, @RequestParam("communityId") Long communityId) { |
| | | return comActEasyPhotoService.getUserReward(userId, communityId); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 定时任务针对活动结束后7天还未评价的用户默认好评 |
| | | */ |
| | | @PostMapping("activity/default-praise") |
| | | public R timedTaskActivityDefaultPraise() { |
| | | return comActActEvaluateService.timedTaskActivityDefaultPraise(); |
| | | } |
| | | |
| | | /** |
| | | * 小程序-新增问卷调查浏览数量 |
| | | * |
| | | * @param questId |
| | |
| | | public R easyPhotoNoHandleList(@RequestParam("communityId") Long communityId) { |
| | | return comActEasyPhotoService.easyPhotoNoHandleList(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 微心愿处理人列表 |
| | | * @param communityId 社区id |
| | | * @param type 处理人类型(1.后台用户 2.党员 3.志愿者) |
| | | * @return 处理人列表 |
| | | */ |
| | | @GetMapping("wish/handle/list/admin") |
| | | public R wishHandleListAdmin(@RequestParam(value = "communityId") Long communityId,@RequestParam("type") Integer type){ |
| | | return R.ok(comActMicroWishService.wishHandleListAdmin(communityId,type)); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台分页查询微心愿 |
| | | * @param comActMicroWishVO 请求参数 |
| | | * @return 微心愿列表 |
| | | */ |
| | | @PostMapping("pagemicrowishAdmin") |
| | | public R pageMicroWishAdmin(@RequestBody ComActMicroWishVO comActMicroWishVO) { |
| | | return comActMicroWishService.pageMicroWishAdmin(comActMicroWishVO); |
| | | } |
| | | } |