| | |
| | | import com.panzhihua.common.model.dtos.community.GrantRewardDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.ExportEasyPhotoDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.ExportEasyPhotoVO; |
| | | import com.panzhihua.common.utlis.*; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | }else { |
| | | comActEasyPhotoVO1.setHaveGiveThumbsUp(1); |
| | | } |
| | | comActEasyPhotoVO1.setPhone(SensitiveUtil.desensitizedPhoneNumber(comActEasyPhotoVO1.getPhone())); |
| | | |
| | | if(comActEasyPhotoVO1.getActivityId() != null && comActEasyPhotoVO1.getStatus().equals(ComActEasyPhotoDO.status.ywc)){ |
| | | //查询随手拍活动 |
| | |
| | | comActEasyPhotoVO1.setActivityMoney(photoActivityDO.getOrdinaryReward()); |
| | | }else if(comActEasyPhotoVO1.getActivityType().equals(ComActEasyPhotoDO.activityType.yb)){ |
| | | comActEasyPhotoVO1.setActivityMoney(photoActivityDO.getCommonlyReward()); |
| | | }else if(comActEasyPhotoVO1.getActivityType().equals(ComActEasyPhotoDO.activityType.wu)){ |
| | | comActEasyPhotoVO1.setActivityMoney(BigDecimal.ZERO); |
| | | } |
| | | } |
| | | } |
| | |
| | | comActEasyPhotoVO.setPhotoFeedbackList(photoFeedbackList); |
| | | } |
| | | |
| | | comActEasyPhotoVO.setPhone(SensitiveUtil.desensitizedPhoneNumber(comActEasyPhotoVO.getPhone())); |
| | | // comActEasyPhotoVO.setPhone(SensitiveUtil.desensitizedPhoneNumber(comActEasyPhotoVO.getPhone())); |
| | | if(comActEasyPhotoVO.getAddrRemark()==null){ |
| | | comActEasyPhotoVO.setAddrRemark(""); |
| | | } |
| | |
| | | switch (type){ |
| | | case 1: |
| | | if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | return R.fail("该随手拍已审核,不可重复操作"); |
| | | return R.fail("该随手拍已处理,不可重复操作"); |
| | | } |
| | | cmActEasyPhotoDO.setStatus(2);//进行中 |
| | | cmActEasyPhotoDO.setIsNeedFeedBack(1); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setIsPublicity(comActEasyPhotoVO.getIsPublicity()); |
| | | if(comActEasyPhotoVO.getIsReportUrban().equals(ComActEasyPhotoVO.isReportUrban.yes)){ |
| | | cmActEasyPhotoDO.setIsReportUrban(ComActEasyPhotoVO.isReportUrban.yes); |
| | | cmActEasyPhotoDO.setTransferReason(comActEasyPhotoVO.getTransferReason()); |
| | | cmActEasyPhotoDO.setTransferTime(nowDate); |
| | | }else{ |
| | | cmActEasyPhotoDO.setIsReportUrban(ComActEasyPhotoVO.isReportUrban.no); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getHandlerId()); |
| | | } |
| | | cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | if(StringUtils.isNotEmpty(comActEasyPhotoVO.getHandleResult()) || StringUtils.isNotEmpty(comActEasyPhotoVO.getHandlePhotoList())){ |
| | |
| | | comActUserWalletService.examineAddMoney(comActEasyPhotoVO.getActivityType(),comActEasyPhotoVO.getId(),comActEasyPhotoVO.getUserId(),BigDecimal.ZERO); |
| | | break; |
| | | case 2: |
| | | if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | return R.fail("该随手拍已审核,不可重复操作"); |
| | | } |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setStatus(3);//已驳回 |
| | | cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | cmActEasyPhotoDO.setRejectReason(comActEasyPhotoVO.getRejectReason()); |
| | | // if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | // return R.fail("该随手拍已处理,不可重复操作"); |
| | | // } |
| | | // cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | // cmActEasyPhotoDO.setStatus(3);//已驳回 |
| | | // cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | // cmActEasyPhotoDO.setRejectReason(comActEasyPhotoVO.getRejectReason()); |
| | | break; |
| | | case 3: |
| | | if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dfk)){ |
| | | return R.fail("该随手拍不是待反馈状态,不可进行反馈"); |
| | | return R.fail("该随手拍不是进行中状态,不可进行反馈"); |
| | | } |
| | | //给随手拍新增反馈信息 |
| | | ComActEasyPhotoFeedbackDO photoFeedbackDO = new ComActEasyPhotoFeedbackDO(); |
| | |
| | | photoFeedback.setCreateBy(comActEasyPhotoVO.getUserId()); |
| | | comActEasyPhotoFeedbackMapper.insert(photoFeedback); |
| | | } |
| | | if(cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | //审核通过判断随手拍是否有活动并计算用户收益 |
| | | comActUserWalletService.examineAddMoney(comActEasyPhotoVO.getActivityType(),comActEasyPhotoVO.getId(),comActEasyPhotoVO.getUserId(),BigDecimal.ZERO); |
| | | } |
| | | // if(cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | // cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | // cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | // cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | // //审核通过判断随手拍是否有活动并计算用户收益 |
| | | // comActUserWalletService.examineAddMoney(comActEasyPhotoVO.getActivityType(),comActEasyPhotoVO.getId(),comActEasyPhotoVO.getUserId(),BigDecimal.ZERO); |
| | | // } |
| | | cmActEasyPhotoDO.setFeedbackAt(nowDate); |
| | | cmActEasyPhotoDO.setStatus(ComActEasyPhotoDO.status.ywc); |
| | | cmActEasyPhotoDO.setCompleteId(comActEasyPhotoVO.getUserId()); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R easyPhotoCount(ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | return R.ok(this.comActEasyPhotoDAO.easyPhotoCount(comActEasyPhotoVO)); |
| | | } |
| | | |
| | | @Override |
| | | public R updatePageeasyphoto(ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | ComActEasyPhotoDO comActEasyPhotoDO=new ComActEasyPhotoDO(); |
| | | BeanUtils.copyProperties(comActEasyPhotoVO,comActEasyPhotoDO); |
| | | int result=this.comActEasyPhotoDAO.updateById(comActEasyPhotoDO); |
| | | if(result>0){ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public R export(ExportEasyPhotoDTO exportEasyPhotoDTO) { |
| | | if(exportEasyPhotoDTO!=null){ |
| | | List<ExportEasyPhotoVO> list; |
| | | if(!CollectionUtils.isEmpty(exportEasyPhotoDTO.getIds())){ |
| | | list=this.comActEasyPhotoDAO.exportByIds(exportEasyPhotoDTO.getIds()); |
| | | } |
| | | else { |
| | | list=this.comActEasyPhotoDAO.export(exportEasyPhotoDTO); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | return R.fail("参数错误"); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台-切换随手拍公示状态 |
| | | * @param comActEasyPhotoVO 请求参数 |
| | | * @return 切换结果 |
| | | */ |
| | | @Override |
| | | public R easyPhotoSwitchPublicity(ComActEasyPhotoVO comActEasyPhotoVO){ |
| | | //查询随手拍 |
| | | ComActEasyPhotoDO easyPhotoDO = this.baseMapper.selectById(comActEasyPhotoVO.getId()); |
| | | if(easyPhotoDO == null){ |
| | | return R.fail("未查询到随手拍记录"); |
| | | } |
| | | easyPhotoDO.setIsPublicity(comActEasyPhotoVO.getIsPublicity()); |
| | | if(this.baseMapper.updateById(easyPhotoDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询社区待处理随手拍id集合 |
| | | * @param communityId 社区id |
| | | * @return 社区待处理随手拍id集合 |
| | | */ |
| | | @Override |
| | | public R easyPhotoNoHandleList(Long communityId){ |
| | | return R.ok(this.baseMapper.easyPhotoNoHandleIds(communityId)); |
| | | } |
| | | |
| | | |
| | | } |