From f0a9a41697a8568e8b3bd3436c450e68b3298916 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 27 二月 2025 11:39:18 +0800 Subject: [PATCH] 修改日志 --- springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintAuditRecordServiceImpl.java | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 53 insertions(+), 1 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintAuditRecordServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintAuditRecordServiceImpl.java index 791335b..faf3f8a 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintAuditRecordServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintAuditRecordServiceImpl.java @@ -1,20 +1,72 @@ package com.panzhihua.sangeshenbian.service.impl; +import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.sangeshenbian.model.entity.ComplaintAuditRecord; import com.panzhihua.sangeshenbian.dao.ComplaintAuditRecordMapper; +import com.panzhihua.sangeshenbian.model.entity.SystemUser; import com.panzhihua.sangeshenbian.service.IComplaintAuditRecordService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.Objects; /** * <p> * 诉求上报、延期申请审核表 服务实现类 * </p> * - * @author + * @author * @since 2025-02-23 */ @Service public class ComplaintAuditRecordServiceImpl extends ServiceImpl<ComplaintAuditRecordMapper, ComplaintAuditRecord> implements IComplaintAuditRecordService { + @Override + public void createComplaintAuditRecord(Long complaintId, Integer auditType, String comment, LoginUserInfoVO loginUserInfoVO, SystemUser adminUser) { + ComplaintAuditRecord auditRecord = new ComplaintAuditRecord(); + auditRecord.setComplaintId(complaintId); + auditRecord.setLatestFlag(true); + auditRecord.setAuditType(auditType); + auditRecord.setAuditStatus(0); + auditRecord.setComment(comment); + auditRecord.setCreateBy(loginUserInfoVO.getUserId()); + auditRecord.setCreateTime(new Date()); + auditRecord.setUpdateBy(loginUserInfoVO.getUserId()); + auditRecord.setUpdateTime(new Date()); + + String departmentName = ""; + String reporter = loginUserInfoVO.getNickName(); + + if (Objects.nonNull(adminUser) && adminUser.getIsAdmin().equals(1)){ + switch (adminUser.getAccountLevel()) { + case 1: + departmentName = "攀枝花市";//默认市级 + break; + case 2: + departmentName = adminUser.getDistricts(); + break; + case 3: + departmentName = adminUser.getStreet(); + break; + case 4: + departmentName = adminUser.getCommunity(); + break; + } + auditRecord.setDepartmentName(departmentName); + reporter = adminUser.getName(); + } + auditRecord.setReporter(reporter); + save(auditRecord); + } + + @Override + public void audit(ComplaintAuditRecord complaintAuditRecord, Long userId, Integer auditResult, String rejectReason) { + complaintAuditRecord.setAuditStatus(auditResult); + complaintAuditRecord.setRejectReason(rejectReason); + complaintAuditRecord.setAuditorId(userId); + complaintAuditRecord.setUpdateBy(userId); + complaintAuditRecord.setUpdateTime(new Date()); + updateById(complaintAuditRecord); + } } -- Gitblit v1.7.1