From 2b7f4d1d5e7dc15c1c05120f543b61b9db5ca9ea Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 27 三月 2026 14:08:43 +0800
Subject: [PATCH] 新增巡检记录后,创建人未自动生成,未展示备注,且点击通知后无对应的通知消息展示
---
src/main/java/com/ruoyi/production/controller/ProductInspectionRecordController.java | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/controller/ProductInspectionRecordController.java b/src/main/java/com/ruoyi/production/controller/ProductInspectionRecordController.java
index 4548b54..3c46227 100644
--- a/src/main/java/com/ruoyi/production/controller/ProductInspectionRecordController.java
+++ b/src/main/java/com/ruoyi/production/controller/ProductInspectionRecordController.java
@@ -10,6 +10,8 @@
import com.ruoyi.production.dto.ProductInspectionRecordDto;
import com.ruoyi.production.pojo.ProductInspectionRecord;
import com.ruoyi.production.service.ProductInspectionRecordService;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -30,6 +32,8 @@
public class ProductInspectionRecordController {
@Autowired
private ProductInspectionRecordService productInspectionRecordService;
+ @Autowired
+ private ISysUserService sysUserService;
@ApiOperation("宸℃璁板綍 鍒嗛〉鏌ヨ")
@GetMapping("listPage")
@@ -41,7 +45,21 @@
.between(Objects.nonNull(productInspectionRecord.getStartTime()) && Objects.nonNull(productInspectionRecord.getEndTime()),
ProductInspectionRecord::getInspectionTime, productInspectionRecord.getStartTime(),
productInspectionRecord.getEndTime());
- return AjaxResult.success(productInspectionRecordService.page(page, ew));
+ // 鏌ヨ鍒嗛〉鏁版嵁
+ Page<ProductInspectionRecord> resultPage = productInspectionRecordService.page(page, ew);
+
+ List<ProductInspectionRecord> records = resultPage.getRecords();
+ for (ProductInspectionRecord record : records) {
+ if (record.getCreateUser() != null) {
+ Long userId = record.getCreateUser().longValue();
+ SysUser user = sysUserService.selectUserById(userId);
+ if (user != null) {
+ record.setCreateUserName(user.getNickName());
+ }
+ }
+ }
+
+ return AjaxResult.success(resultPage);
}
@ApiOperation("宸℃璁板綍 鏂板")
--
Gitblit v1.9.3