This commit is contained in:
tortoise 2024-09-09 10:48:39 +08:00
parent 31dbdd57e4
commit 17c3e251f2
4 changed files with 19 additions and 3 deletions

View File

@ -101,6 +101,7 @@ RecordController {
}
@AuthAccess(allowRoles = {"admin"})
@Operation(summary = "添加奖惩记录")
@PostMapping("/admin/record")

View File

@ -3,12 +3,14 @@ package top.suyiiyii.sims.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import jakarta.servlet.http.HttpServletRequest;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.suyiiyii.sims.common.AuthAccess;
import top.suyiiyii.sims.common.JwtInterceptor;
import top.suyiiyii.sims.common.Result;
import top.suyiiyii.sims.dto.CommonResponse;
import top.suyiiyii.sims.dto.RecordDto;
@ -45,6 +47,7 @@ public class RevokedController {
CategoryService categoryService;
@Autowired
RecordService recordService;
//TODO 普通成员向管理员申请撤销
@AuthAccess(allowRoles = {"user"})
@Operation(summary = "成员申请撤销")

View File

@ -123,4 +123,15 @@ public class RecordService {
public Integer getCategoryIdById(Integer id) {
return recordMapper.getCategoryIdById(id);
}
public void update(Integer id, String userId, String adminRemark, String reason, Long handleTime) {
Boolean isRevoked=true;
recordMapper.update(id, isRevoked,userId, adminRemark, reason, handleTime);
}
public void revokeUpdate(Integer id, String reason,String userId) {
String revokeReason="申请撤销";
Boolean isRevoked=true;
recordMapper.Rupdate(id, reason,isRevoked,revokeReason,userId);
}
}

View File

@ -36,11 +36,12 @@ public class RevokedService {
}
public void updateRevokeRequest(Integer id, String status, String adminRemark, String reason, Long handleTime) {
mpRevRequestMapper.update(id, status, adminRemark, reason, handleTime);
}
public void addRevokedRecord(Integer id, String userId, String reason, Long handleTime) {
mpRevRecord.addRevokedRecord(id, userId, reason, handleTime);
}
}