| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | } |
| | | } |
| | | //查询反馈列表 |
| | | if(comActMicroWishVO.getStatus()==5||comActMicroWishVO.getStatus()==6){ |
| | | List<ComActMicroWishFeedbackVO> list=comActMicroWishFeedbackMapper.selectByWishId(id); |
| | | if(!list.isEmpty()){ |
| | | comActMicroWishVO.setFeedbackVOList(list); |
| | | } |
| | | List<ComActMicroWishFeedbackVO> feedList=comActMicroWishFeedbackMapper.selectByWishId(id); |
| | | if(!feedList.isEmpty()){ |
| | | comActMicroWishVO.setFeedbackVOList(feedList); |
| | | } |
| | | //查询操作记录 |
| | | List<ComActMicroWishOperationRecordVO> list=comActMicroWishOperationRecordMapper.getByWishId(id); |
| | | if(!list.isEmpty()){ |
| | | comActMicroWishVO.setOperationRecordVOList(list); |
| | | List<ComActMicroWishOperationRecordVO> operationList=comActMicroWishOperationRecordMapper.getByWishId(id); |
| | | if(!operationList.isEmpty()){ |
| | | comActMicroWishVO.setOperationRecordVOList(operationList); |
| | | } |
| | | comActMicroWishVO.setSponsorPhone(SensitiveUtil.desensitizedPhoneNumber(comActMicroWishVO.getSponsorPhone())); |
| | | //查询同类型id数组 |
| | | List<Long> idList=comActMicroWishOperationRecordMapper.selectId(comActMicroWishVO); |
| | | if(!idList.isEmpty()){ |
| | | comActMicroWishVO.setIdList(idList); |
| | | } |
| | | return R.ok(comActMicroWishVO); |
| | | } |
| | | |
| | |
| | | String feedbackPhotoPathList = comActMicroWishVO.getFeedbackPhotoPathList(); |
| | | ComActMicroWishDO comActMicroWishDO=new ComActMicroWishDO(); |
| | | comActMicroWishDO.setId(id); |
| | | Boolean isUpdate = false; |
| | | Date date = new Date(); |
| | | ComActMicroWishOperationRecordDO comActMicroWishOperationRecordDO=new ComActMicroWishOperationRecordDO(); |
| | | comActMicroWishOperationRecordDO.setCreateTime(date); |
| | | comActMicroWishOperationRecordDO.setUserId(comActMicroWishVO.getUserId()); |
| | | comActMicroWishOperationRecordDO.setWishId(comActMicroWishVO.getId()); |
| | | ComActMicroWishDO microWishDO = this.baseMapper.selectById(id); |
| | | if(microWishDO == null){ |
| | | return R.fail("未查询到该微心愿记录"); |
| | | } |
| | | // 1 审核通过 2驳回 3分配人员 4发起活动 5反馈 |
| | | switch (type){ |
| | | case 1: |
| | | isUpdate = true; |
| | | if(!microWishDO.getStatus().equals(ComActMicroWishDO.status.dsh)){ |
| | | return R.fail("该微心愿已审核,不可重复审核"); |
| | | } |
| | | comActMicroWishDO.setExamineAt(date); |
| | | comActMicroWishDO.setAimNum(comActMicroWishVO.getAimNum()); |
| | | comActMicroWishDO.setStatus(7);//集心中 |
| | |
| | | comActMicroWishOperationRecordMapper.insert(comActMicroWishOperationRecordDO); |
| | | break; |
| | | case 2: |
| | | isUpdate = true; |
| | | if(!microWishDO.getStatus().equals(ComActMicroWishDO.status.dsh)){ |
| | | return R.fail("该微心愿已审核,不可重复审核"); |
| | | } |
| | | comActMicroWishDO.setExamineAt(date); |
| | | comActMicroWishDO.setRejectReason(rejectReason); |
| | | comActMicroWishDO.setStatus(4);//驳回 |
| | | comActMicroWishOperationRecordDO.setType(ComActMicroWishOperationRecordDO.type.bh); |
| | | comActMicroWishOperationRecordDO.setContent("审核未通过"); |
| | | comActMicroWishOperationRecordDO.setContent(rejectReason); |
| | | comActMicroWishOperationRecordMapper.insert(comActMicroWishOperationRecordDO); |
| | | break; |
| | | case 3: |
| | | isUpdate = true; |
| | | comActMicroWishDO.setDistributionAt(date); |
| | | comActMicroWishDO.setResponsibleId(responsibleId); |
| | | comActMicroWishDO.setStatus(3);//进行中 |
| | | comActMicroWishDO.setForm(1); |
| | | break; |
| | | case 4: |
| | | isUpdate = true; |
| | | comActMicroWishDO.setDistributionAt(date); |
| | | comActMicroWishDO.setResponsibleId(responsibleId); |
| | | comActMicroWishDO.setStatus(3);//待确认 |
| | |
| | | } |
| | | //新增反馈记录 |
| | | ComActMicroWishFeedbackDO comActMicroWishFeedbackDO=new ComActMicroWishFeedbackDO(); |
| | | comActMicroWishFeedbackDO.setCreatTime(date); |
| | | comActMicroWishFeedbackDO.setCreateTime(date); |
| | | comActMicroWishFeedbackDO.setContent(feedback); |
| | | comActMicroWishFeedbackDO.setImgUrl(feedbackPhotoPathList); |
| | | comActMicroWishFeedbackDO.setMicroId(comActMicroWishVO.getId()); |
| | | comActMicroWishFeedbackDO.setUserId(comActMicroWishVO.getUserId()); |
| | | comActMicroWishDO.setStatus(5); |
| | | if(comActMicroWishVO.getStatus() != null && comActMicroWishVO.getStatus().equals(ComActMicroWishDO.status.ywc)){ |
| | | isUpdate = true; |
| | | comActMicroWishDO.setStatus(ComActMicroWishDO.status.ywc); |
| | | comActMicroWishDO.setFinishAt(date); |
| | | comActMicroWishDO.setFinish(feedback); |
| | | comActMicroWishDO.setFinishPhotoPathList(feedbackPhotoPathList); |
| | | } |
| | | // else { |
| | | // comActMicroWishDO.setStatus(3); |
| | | // } |
| | | comActMicroWishFeedbackMapper.insert(comActMicroWishFeedbackDO); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | int update = comActMicroWishDAO.updateById(comActMicroWishDO); |
| | | if (update>0) { |
| | | if(isUpdate){ |
| | | int update = comActMicroWishDAO.updateById(comActMicroWishDO); |
| | | if (update>0) { |
| | | return R.ok(); |
| | | } |
| | | }else{ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | if (num>0) { |
| | | if(count>=comActMicroWishDO.getAimNum()-1){ |
| | | comActMicroWishDO.setStatus(ComActMicroWishDO.status.dfp); |
| | | comActMicroWishDO.setFeedbackAt(DateUtil.date()); |
| | | comActMicroWishDAO.updateById(comActMicroWishDO); |
| | | } |
| | | return R.ok(); |
| | |
| | | return R.fail("心愿不存在"); |
| | | } |
| | | Integer status = comActMicroWishDO1.getStatus(); |
| | | if (status.intValue()!=5) { |
| | | return R.fail("心愿状态不是待确认"); |
| | | if (!status.equals(ComActMicroWishDO.status.ywc)) { |
| | | return R.fail("心愿状态不是已完成状态"); |
| | | } |
| | | ComActMicroWishDO comActMicroWishDO=new ComActMicroWishDO(); |
| | | comActMicroWishDO.setId(comActMicroWishVO.getId()); |