| | |
| | | package com.panzhihua.sangeshenbian.service.impl; |
| | | |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | 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> |
| | |
| | | public class ComplaintAuditRecordServiceImpl extends ServiceImpl<ComplaintAuditRecordMapper, ComplaintAuditRecord> implements IComplaintAuditRecordService { |
| | | |
| | | @Override |
| | | public void createComplaintAuditRecord(Long complaintId, Integer auditType, String comment, Long userId) { |
| | | 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(1); |
| | | auditRecord.setAuditType(auditType); |
| | | auditRecord.setAuditStatus(0); |
| | | auditRecord.setComment(comment); |
| | | auditRecord.setCreateBy(userId); |
| | | auditRecord.setCreateTime(DateUtils.getCurrentDate()); |
| | | auditRecord.setUpdateBy(userId); |
| | | auditRecord.setUpdateTime(DateUtils.getCurrentDate()); |
| | | 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(Long id, Long userId, Integer auditResult, String rejectReason) { |
| | | ComplaintAuditRecord auditRecord = getById(id); |
| | | if (auditRecord == null) { |
| | | throw new RuntimeException("审核记录不存在"); |
| | | } |
| | | auditRecord.setAuditStatus(auditResult); |
| | | auditRecord.setRejectReason(rejectReason); |
| | | auditRecord.setUpdateBy(userId); |
| | | auditRecord.setUpdateTime(DateUtils.getCurrentDate()); |
| | | save(auditRecord); |
| | | 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); |
| | | } |
| | | } |