| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.DesensitizedUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | } |
| | | return R.ok(iPage); |
| | | } |
| | | @Override |
| | | public R pageMicroWishAppletsDesensitize(ComActMicroWishVO comActMicroWishVO) { |
| | | Long userId = comActMicroWishVO.getResponsibleId(); |
| | | IPage<ComActMicroWishVO> iPage = comActMicroWishDAO.pageMicroWishApplets(new Page(comActMicroWishVO.getPageNum() |
| | | ,comActMicroWishVO.getPageSize()), comActMicroWishVO); |
| | | List<ComActMicroWishVO> records = iPage.getRecords(); |
| | | if (!ObjectUtils.isEmpty(records)) { |
| | | records.forEach(comActMicroWishVO1 -> { |
| | | if(userId != null){ |
| | | Long id = comActMicroWishVO1.getId(); |
| | | ComActMicroWishUserDO comActMicroWishUserDO = comActMicroWishUserDAO.selectOne(new QueryWrapper<ComActMicroWishUserDO>().lambda().eq(ComActMicroWishUserDO::getMicroWishId, id) |
| | | .eq(ComActMicroWishUserDO::getUserId, userId)); |
| | | if (ObjectUtils.isEmpty(comActMicroWishUserDO)) { |
| | | comActMicroWishVO1.setHaveGiveThumbsUp(0); |
| | | } else { |
| | | comActMicroWishVO1.setHaveGiveThumbsUp(1); |
| | | } |
| | | } |
| | | comActMicroWishVO1.setSponsorPhone(SensitiveUtil.desensitizedPhoneNumber(comActMicroWishVO1.getSponsorPhone())); |
| | | comActMicroWishVO1.setSponsorName(DesensitizedUtil.chineseName(comActMicroWishVO1.getSponsorName())); |
| | | comActMicroWishVO1.setResponsibleName(DesensitizedUtil.chineseName(comActMicroWishVO1.getResponsibleName())); |
| | | }); |
| | | iPage.setRecords(records); |
| | | } |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | /** |
| | | * 心愿详情 |
| | |
| | | comActMicroWishVO.setResponsibleName(this.getWishHandleName(comActMicroWishVO.getHandleId())); |
| | | return R.ok(comActMicroWishVO); |
| | | } |
| | | /** |
| | | * 心愿详情 - 脱敏 |
| | | * |
| | | * @param id 查询主键 |
| | | * @param userId 登录用户id |
| | | * @return 心愿内容 |
| | | */ |
| | | @Override |
| | | public R detailMicroWishDesensitize(Long id, Long userId) { |
| | | ComActMicroWishVO comActMicroWishVO = comActMicroWishDAO.detailMicroWish(id); |
| | | if (ObjectUtils.isEmpty(comActMicroWishVO)) { |
| | | return R.fail("微心愿不存在"); |
| | | } |
| | | Integer starNum = comActMicroWishVO.getStarNum(); |
| | | if (null==starNum) { |
| | | comActMicroWishVO.setStarNum(0); |
| | | } |
| | | if (ObjectUtils.isEmpty(comActMicroWishVO)) { |
| | | return R.fail("心愿不存在"); |
| | | } |
| | | if(userId != null){ |
| | | ComActMicroWishUserDO comActMicroWishUserDO = comActMicroWishUserDAO.selectOne(new QueryWrapper<ComActMicroWishUserDO>().lambda().eq(ComActMicroWishUserDO::getUserId, userId).eq(ComActMicroWishUserDO::getMicroWishId, id)); |
| | | if (ObjectUtils.isEmpty(comActMicroWishUserDO)) { |
| | | comActMicroWishVO.setHaveGiveThumbsUp(0); |
| | | }else { |
| | | comActMicroWishVO.setHaveGiveThumbsUp(1); |
| | | } |
| | | } |
| | | //查询反馈列表 |
| | | List<ComActMicroWishFeedbackVO> feedList=comActMicroWishFeedbackMapper.selectByWishId(id); |
| | | if(!feedList.isEmpty()){ |
| | | for (ComActMicroWishFeedbackVO comActMicroWishFeedbackVO : feedList) { |
| | | comActMicroWishFeedbackVO.setName(DesensitizedUtil.chineseName(comActMicroWishFeedbackVO.getName())); |
| | | } |
| | | comActMicroWishVO.setFeedbackVOList(feedList); |
| | | } |
| | | //查询操作记录 |
| | | List<ComActMicroWishOperationRecordVO> operationList=comActMicroWishOperationRecordMapper.getByWishId(id); |
| | | if(!operationList.isEmpty()){ |
| | | comActMicroWishVO.setOperationRecordVOList(operationList); |
| | | } |
| | | comActMicroWishVO.setSponsorPhone(SensitiveUtil.desensitizedPhoneNumber(comActMicroWishVO.getSponsorPhone())); |
| | | comActMicroWishVO.setSponsorName(DesensitizedUtil.chineseName(comActMicroWishVO.getSponsorName())); |
| | | comActMicroWishVO.setResponsibleName(DesensitizedUtil.chineseName(comActMicroWishVO.getResponsibleName())); |
| | | //查询同类型id数组 |
| | | List<Long> idList=comActMicroWishOperationRecordMapper.selectId(comActMicroWishVO); |
| | | if(!idList.isEmpty()){ |
| | | comActMicroWishVO.setIdList(idList); |
| | | } |
| | | //查询处理人 |
| | | comActMicroWishVO.setResponsibleName(DesensitizedUtil.chineseName(this.getWishHandleName(comActMicroWishVO.getHandleId()))); |
| | | return R.ok(comActMicroWishVO); |
| | | } |
| | | |
| | | /** |
| | | * 审核、分配、反馈心愿 |