| | |
| | | import jodd.util.StringUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | complaint.setClosingTime(new Date(System.currentTimeMillis() + config.getDemandProcessingTime() * 24 * 60 * 60 * 1000)); |
| | | // 保存诉求记录 |
| | | save(complaint); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveAndReport(ComplaintVO complaintVO, LoginUserInfoVO loginUserInfo) { |
| | | Complaint complaint = new Complaint(); |
| | | BeanUtil.copyProperties(complaintVO, complaint); |
| | | saveComplaint(complaint, loginUserInfo); |
| | | ComplaintReportDTO dto = new ComplaintReportDTO(); |
| | | dto.setComplaintId(complaint.getId()); |
| | | dto.setComment(complaintVO.getComment()); |
| | | saveReport(dto, loginUserInfo); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveAndComplete(ComplaintSaveAndCompleteDTO complaintVO, LoginUserInfoVO loginUserInfo) { |
| | | Complaint complaint = new Complaint(); |
| | | BeanUtil.copyProperties(complaintVO, complaint); |
| | | saveComplaint(complaint, loginUserInfo); |
| | | |
| | | ComplaintCompletionDTO complaintCompletionDTO = complaintVO.getComplaintCompletionDTO(); |
| | | complaintCompletionDTO.setComplaintId(complaint.getId()); |
| | | complaintCompletionDTO.setId(complaint.getId()); |
| | | saveResult(complaintCompletionDTO, loginUserInfo); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | Long auditCreateBy = vo.getAuditCreateBy(); |
| | | Long userId = loginUserInfo.getUserId(); |
| | | if (null != auditCreateBy && auditCreateBy.compareTo(userId) == 0 && vo.getStatus() == 5) { |
| | | vo.setWithdrawButtonStatus(0); |
| | | }else { |
| | | vo.setWithdrawButtonStatus(1); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | .orderByAsc(ComplaintProgress::getCreateTime).list(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveReport(ComplaintReportDTO dto, LoginUserInfoVO loginUserInfoVO) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void reportWithdraw(ComplaintReportWithdrawDTO dto, LoginUserInfoVO loginUserInfoVO) { |
| | | ComplaintAuditRecord complaintAuditRecord = complaintAuditRecordService.getOne(new LambdaQueryWrapper<ComplaintAuditRecord>() |
| | | .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId()) |
| | | .eq(ComplaintAuditRecord::getAuditType, 2) |
| | | .eq(ComplaintAuditRecord::getLatestFlag, true)); |
| | | if (Objects.isNull(complaintAuditRecord)) { |
| | | throw new ServiceException("未找到相关记录"); |
| | | } |
| | | complaintAuditRecord.setAuditStatus(3); |
| | | complaintAuditRecord.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | complaintAuditRecord.setUpdateTime(new Date()); |
| | | complaintAuditRecord.setLatestFlag(false); |
| | | complaintAuditRecordService.updateById(complaintAuditRecord); |
| | | |
| | | // 获取上一条记录 |
| | | ComplaintAuditRecord lastRecord = complaintAuditRecordService.getOne(new LambdaQueryWrapper<ComplaintAuditRecord>() |
| | | .ne(ComplaintAuditRecord::getId, complaintAuditRecord.getId()) |
| | | .eq(ComplaintAuditRecord::getComplaintId, dto.getComplaintId()) |
| | | .eq(ComplaintAuditRecord::getAuditType, 2) |
| | | .eq(ComplaintAuditRecord::getLatestFlag, false) |
| | | .orderByDesc(ComplaintAuditRecord::getSort) |
| | | ); |
| | | if (Objects.nonNull(lastRecord)) { |
| | | // 复制上一条记录 |
| | | ComplaintAuditRecord newRecord = new ComplaintAuditRecord(); |
| | | BeanUtils.copyProperties(lastRecord, newRecord); |
| | | newRecord.setId(null); |
| | | newRecord.setLatestFlag(true); |
| | | newRecord.setUpdateBy(loginUserInfoVO.getUserId()); |
| | | newRecord.setUpdateTime(new Date()); |
| | | complaintAuditRecordService.save(newRecord); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveDispatch(ComplaintDispatch dto, LoginUserInfoVO loginUserInfoVO) { |
| | | IdentityInformation identityInformation = identityInformationService.getCurrentIdentityInformation(loginUserInfoVO); |