From e3a7b5f659b6967d8b426f20c8b52fe740be50b6 Mon Sep 17 00:00:00 2001 From: luofl <1442745593@qq.com> Date: 星期一, 14 四月 2025 15:45:07 +0800 Subject: [PATCH] 迭代:4.11版本 --- springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java | 77 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 77 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java index 338ba4d..f118a4c 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java @@ -34,6 +34,7 @@ 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; @@ -175,6 +176,31 @@ 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 @@ -411,6 +437,16 @@ } } } + + 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); + } + + } @@ -482,6 +518,10 @@ buttonPermission(detail, systemUserByPhone, loginUserInfoVO); + Integer auditButtonStatus = detail.getAuditButtonStatus(); + if (auditButtonStatus == 1 && detail.getStatus() == 5 && !Objects.equals(detail.getAuditCreateBy(), loginUserInfoVO.getUserId())){ + detail.setStatus(0); + } // //已办结,显示评价按钮 @@ -584,6 +624,8 @@ return complaintProgressService.lambdaQuery().eq(ComplaintProgress::getComplaintId, complaintId) .orderByAsc(ComplaintProgress::getCreateTime).list(); } + + @Override @Transactional(rollbackFor = Exception.class) @@ -693,6 +735,41 @@ } @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); -- Gitblit v1.7.1