| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | } |
| | | } |
| | | 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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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(); |
| | | } |
| | | |
| | | } |
| | | |