| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoDAO; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoUserDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO; |
| | |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | Page page = new Page<>(); |
| | | Long pageNum = comActEasyPhotoVO.getPageNum(); |
| | | Long pageSize = comActEasyPhotoVO.getPageSize(); |
| | | if (ObjectUtils.isEmpty(pageNum)||0==pageNum) { |
| | | Long userId = comActEasyPhotoVO.getLogInUserId(); |
| | | if (null==pageNum||0==pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (ObjectUtils.isEmpty(pageSize)||0==pageSize) { |
| | | if (null==pageSize||0==pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | |
| | | if (!ObjectUtils.isEmpty(records)) { |
| | | records.forEach(comActEasyPhotoVO1 -> { |
| | | Long id = comActEasyPhotoVO1.getId(); |
| | | Long sponsorId = comActEasyPhotoVO1.getSponsorId(); |
| | | ComActEasyPhotoUserDO comActEasyPhotoUserDO = comActEasyPhotoUserDAO.selectOne(new QueryWrapper<ComActEasyPhotoUserDO>().lambda().eq(ComActEasyPhotoUserDO::getEasyPhotoId, id).eq(ComActEasyPhotoUserDO::getUserId, sponsorId)); |
| | | ComActEasyPhotoUserDO comActEasyPhotoUserDO = comActEasyPhotoUserDAO.selectOne(new QueryWrapper<ComActEasyPhotoUserDO>().lambda().eq(ComActEasyPhotoUserDO::getEasyPhotoId, id).eq(ComActEasyPhotoUserDO::getUserId, userId)); |
| | | if (ObjectUtils.isEmpty(comActEasyPhotoUserDO)) { |
| | | comActEasyPhotoVO1.setHaveGiveThumbsUp(0); |
| | | }else { |
| | |
| | | @Override |
| | | public R detailEasyPhoto(Long id, Long userId) { |
| | | ComActEasyPhotoVO comActEasyPhotoVO=comActEasyPhotoDAO.detailEasyPhoto(id); |
| | | if (ObjectUtils.isEmpty(comActEasyPhotoVO)) { |
| | | if (ObjectUtils.isEmpty(comActEasyPhotoVO)||null==comActEasyPhotoVO.getStatus()) { |
| | | return R.fail("随手拍不存在"); |
| | | } |
| | | ComActEasyPhotoUserDO comActEasyPhotoUserDO = comActEasyPhotoUserDAO.selectOne(new QueryWrapper<ComActEasyPhotoUserDO>().lambda().eq(ComActEasyPhotoUserDO::getEasyPhotoId, id).eq(ComActEasyPhotoUserDO::getUserId, userId)); |
| | |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 审核反馈随手拍 |
| | | * |
| | | * @param comActEasyPhotoVO 操作参数 |
| | | * @return 操作结果 |
| | | */ |
| | | @Override |
| | | public R putEasypHotoStatus(ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | Integer type = comActEasyPhotoVO.getType(); |
| | | // 操作类型 1审核通过 2驳回 3反馈 |
| | | ComActEasyPhotoDO cmActEasyPhotoDO=new ComActEasyPhotoDO(); |
| | | cmActEasyPhotoDO.setId(comActEasyPhotoVO.getId()); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | Date date = new Date(); |
| | | switch (type){ |
| | | case 1: |
| | | int isNeedFeedBack = comActEasyPhotoVO.getIsNeedFeedBack().intValue(); |
| | | if (isNeedFeedBack==1) { |
| | | cmActEasyPhotoDO.setStatus(2);//进行中 |
| | | cmActEasyPhotoDO.setIsNeedFeedBack(1); |
| | | }else{ |
| | | cmActEasyPhotoDO.setStatus(4);//已完成 |
| | | } |
| | | cmActEasyPhotoDO.setExamineAt(date); |
| | | break; |
| | | case 2: |
| | | cmActEasyPhotoDO.setStatus(3);//已驳回 |
| | | cmActEasyPhotoDO.setExamineAt(date); |
| | | cmActEasyPhotoDO.setRejectReason(comActEasyPhotoVO.getRejectReason()); |
| | | break; |
| | | case 3: |
| | | cmActEasyPhotoDO.setHandleResult(comActEasyPhotoVO.getHandleResult()); |
| | | cmActEasyPhotoDO.setHandlePhotoList(comActEasyPhotoVO.getHandlePhotoList()); |
| | | cmActEasyPhotoDO.setStatus(4);//已完成 |
| | | cmActEasyPhotoDO.setFeedbackAt(date); |
| | | break; |
| | | default:break; |
| | | } |
| | | int update = comActEasyPhotoDAO.updateById(cmActEasyPhotoDO); |
| | | if (update>0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 随手拍是否有待审核和带反馈的事件 |
| | | * |
| | | * @param communityId 社区id |
| | | * @param userId 登录用户id |
| | | * @return 待处理事件集合 |
| | | */ |
| | | @Override |
| | | public List<TodoEventsVO> selectNeedToDo(Long communityId, Long userId) { |
| | | List<TodoEventsVO> todoEventsVOS=comActEasyPhotoDAO.selectNeedToDo(communityId,userId); |
| | | return todoEventsVOS; |
| | | } |
| | | } |