From 8ad863082097ffdcab4a8e7f426d344a1fe6f892 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期六, 07 十一月 2026 00:27:02 +0800
Subject: [PATCH] 修复人员管理接口校验与导出,完善设备保养计划与文件受控功能
---
cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonPostAuthorizationRecordController.java | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonPostAuthorizationRecordController.java b/cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonPostAuthorizationRecordController.java
index d5b5893..ea8e9fd 100644
--- a/cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonPostAuthorizationRecordController.java
+++ b/cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonPostAuthorizationRecordController.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.Result;
+import com.ruoyi.framework.exception.ErrorException;
import com.ruoyi.common.utils.FileSaveUtil;
import com.ruoyi.personnel.dto.PersonPostAuthorizationRecordDto;
import com.ruoyi.personnel.pojo.PersonPostAuthorizationRecord;
@@ -33,6 +34,16 @@
@Operation(summary = "鏂板/鏇存柊 浠昏亴鎺堟潈璁板綍")
@PostMapping("/addOrUpdatePersonPostAuthorizationRecord")
public Result<?> addOrUpdatePersonPostAuthorizationRecord(@RequestBody PersonPostAuthorizationRecord personRewardPunishmentRecord) {
+ if (personRewardPunishmentRecord == null || personRewardPunishmentRecord.getUserId() == null) {
+ throw new ErrorException("璇烽�夋嫨琚换鑱屼汉鍛�");
+ }
+ if (personRewardPunishmentRecord.getPost() == null || personRewardPunishmentRecord.getPost().trim().isEmpty()) {
+ throw new ErrorException("璇疯緭鍏ヤ换鑱屽矖浣�");
+ }
+ if (personRewardPunishmentRecord.getId() != null
+ && personPostAuthorizationRecordService.getById(personRewardPunishmentRecord.getId()) == null) {
+ throw new ErrorException("浠昏亴鎺堟潈璁板綍涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎");
+ }
personPostAuthorizationRecordService.saveOrUpdate(personRewardPunishmentRecord);
return Result.success();
}
@@ -40,8 +51,11 @@
@Operation(summary = "鍒犻櫎 浠昏亴鎺堟潈璁板綍")
@DeleteMapping("/deletePersonPostAuthorizationRecord")
public Result<?> deletePersonPostAuthorizationRecord(@RequestParam("id") Integer id) {
- // 鍒犻櫎鏂囦欢
PersonPostAuthorizationRecord postAuthorizationRecord = personPostAuthorizationRecordService.getById(id);
+ if (postAuthorizationRecord == null) {
+ throw new ErrorException("浠昏亴鎺堟潈璁板綍涓嶅瓨鍦ㄦ垨宸茶鍒犻櫎");
+ }
+ // 鍒犻櫎鏂囦欢
FileSaveUtil.DeleteFile(postAuthorizationRecord.getSystemFileName());
// 鍒犻櫎鏁版嵁
personPostAuthorizationRecordService.removeById(id);
--
Gitblit v1.9.3