From 0b4f853f6b05b28e3201386bdda3e8af0bfcfc7f Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期二, 20 五月 2025 09:28:37 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TQaTestItemController.java |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TQaTestItemController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TQaTestItemController.java
index aee0c0d..28c9ac8 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TQaTestItemController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TQaTestItemController.java
@@ -10,6 +10,7 @@
 import com.ruoyi.common.enums.QATestItemStatusEnum;
 import com.ruoyi.framework.web.service.TokenService;
 import com.ruoyi.system.dto.TQaTestItemDTO;
+import com.ruoyi.system.dto.TQaTestItemEvaluateDTO;
 import com.ruoyi.system.model.TProjectTeamStaff;
 import com.ruoyi.system.model.TQaTestItem;
 import com.ruoyi.system.model.TQaTestItemReport;
@@ -26,6 +27,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.time.LocalDateTime;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -77,6 +79,29 @@
             }
         }
         return R.ok(qaTestItemService.pageList(query));
+    }
+
+    /**
+     * 获取QA检测项管理评定列表
+     */
+    //@PreAuthorize("@ss.hasPermi('system:qaTestItem:evaluateList')")
+    @ApiOperation(value = "获取QA检测项管理评定列表",  response = TQaTestItemQuery.class)
+    @PostMapping(value = "/api/t-qa-test-item/evaluateList")
+    public R<PageInfo<TQaTestItemVO>> evaluateList(@RequestBody String param) {
+        TQaTestItemQuery query = JSON.parseObject(param, TQaTestItemQuery.class);
+        Long userId = tokenService.getLoginUser().getUserId();
+        Integer roleType = tokenService.getLoginUser().getUser().getRoleType();
+        if(roleType != 1){
+            // 查询用户所在项目组
+            List<TProjectTeamStaff> projectTeamStaffs = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class)
+                    .eq(TProjectTeamStaff::getUserId, userId));
+            if(projectTeamStaffs.size() > 0){
+                // 查询项目组id
+                List<String> teamIds = projectTeamStaffs.stream().map(TProjectTeamStaff::getTeamId).distinct().collect(Collectors.toList());
+                query.setTeamIds(teamIds);
+            }
+        }
+        return R.ok(qaTestItemService.evaluateList(query));
     }
 
     /**
@@ -161,5 +186,24 @@
         return R.ok();
     }
 
+    /**
+     * 评定QA检测项管理
+     */
+    //@PreAuthorize("@ss.hasPermi('system:qaTestItem:evaluate')")
+    @Log(title = "QA检测项管理信息-评定QA检测项管理", businessType = BusinessType.UPDATE)
+    @ApiOperation(value = "评定QA检测项管理",response = TQaTestItemEvaluateDTO.class)
+    @PostMapping(value = "/api/t-qa-test-item/evaluate")
+    public R<Boolean> evaluate(@RequestBody String param) {
+        TQaTestItemEvaluateDTO dto = JSON.parseObject(param,TQaTestItemEvaluateDTO.class);
+        Long userId = tokenService.getLoginUser().getUserId();
+        TQaTestItem testItem = qaTestItemService.getById(dto);
+        testItem.setStatus(QATestItemStatusEnum.EVALUATED.getCode());
+        testItem.setEvaluatePersonId(userId);
+        testItem.setEvaluateTime(LocalDateTime.now());
+        testItem.setEvaluateScore(dto.getEvaluateScore());
+        qaTestItemService.updateById(testItem);
+        return R.ok();
+    }
+
 }
 

--
Gitblit v1.7.1