xuhy
8 天以前 ec213a71112c17cb268ae2c5336348f496e7b3ae
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TQaTestItemReportController.java
@@ -13,8 +13,10 @@
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.AuditStatusDTO;
import com.ruoyi.system.dto.TQaTestItemReportDTO;
import com.ruoyi.system.mapper.TQaReportFileMapper;
import com.ruoyi.system.model.*;
import com.ruoyi.system.model.TProjectTeam;
import com.ruoyi.system.model.TProjectTeamStaff;
import com.ruoyi.system.model.TQaReportFile;
import com.ruoyi.system.model.TQaTestItemReport;
import com.ruoyi.system.query.TQaTestItemReportQuery;
import com.ruoyi.system.service.TProjectTeamService;
import com.ruoyi.system.service.TProjectTeamStaffService;
@@ -25,7 +27,6 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
@@ -63,18 +64,30 @@
    /**
     * 获取QA检测项报告管理列表
     */
    @PreAuthorize("@ss.hasPermi('system:qaTestItemReport:list')")
    //@PreAuthorize("@ss.hasPermi('system:qaTestItemReport:list')")
    @ApiOperation(value = "获取QA检测项报告管理分页列表-工艺工程师使用", response = TQaTestItemReportQuery.class)
    @PostMapping(value = "/api/t-qa-test-item-report/pageList")
    public R<PageInfo<TQaTestItemReportVO>> pageList(@RequestBody String param) {
        TQaTestItemReportQuery query = JSON.parseObject(param, TQaTestItemReportQuery.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(qaTestItemReportService.pageList(query));
    }
    /**
     * 获取QA检测项报告管理列表
     */
    @ApiOperation(value = "获取QA检测项报告管理下拉列表-化验师使用")
    @ApiOperation(value = "获取QA检测项报告管理下拉列表-化验师使用、评定使用")
    @GetMapping(value = "/open/t-qa-test-item-report/getListByItemId")
    public R<List<TQaTestItemReport>> getListByItemId(@RequestParam String itemId) {
        List<TQaTestItemReport> list = qaTestItemReportService.list(Wrappers.lambdaQuery(TQaTestItemReport.class)
@@ -85,7 +98,7 @@
    /**
     * 添加QA检测项报告管理管理
     */
    @PreAuthorize("@ss.hasPermi('system:qaTestItemReport:add')")
    //@PreAuthorize("@ss.hasPermi('system:qaTestItemReport:add')")
    @Log(title = "QA检测项报告管理信息-新增QA检测项报告管理", businessType = BusinessType.INSERT)
    @ApiOperation(value = "添加QA检测项报告管理",response = TQaTestItemReportDTO.class)
    @PostMapping(value = "/api/t-qa-test-item-report/add")
@@ -130,7 +143,7 @@
    /**
     * 修改QA检测项报告管理
     */
    @PreAuthorize("@ss.hasPermi('system:qaTestItemReport:edit')")
    //@PreAuthorize("@ss.hasPermi('system:qaTestItemReport:edit')")
    @Log(title = "QA检测项报告管理信息-修改QA检测项报告管理", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "修改QA检测项报告管理")
    @PostMapping(value = "/api/t-qa-test-item-report/update")
@@ -152,7 +165,7 @@
    /**
     * 查看QA检测项报告管理详情
     */
    @PreAuthorize("@ss.hasPermi('system:qaTestItemReport:detail')")
    //@PreAuthorize("@ss.hasPermi('system:qaTestItemReport:detail')")
    @ApiOperation(value = "查看QA检测项报告管理详情")
    @GetMapping(value = "/open/t-qa-test-item-report/getDetailById")
    public R<TQaTestItemReportVO> getDetailById(@RequestParam String id) {
@@ -170,7 +183,7 @@
    /**
     * 删除QA检测项报告管理
     */
    @PreAuthorize("@ss.hasPermi('system:qaTestItemReport:delete')")
    //@PreAuthorize("@ss.hasPermi('system:qaTestItemReport:delete')")
    @Log(title = "QA检测项报告管理信息-删除QA检测项报告管理", businessType = BusinessType.DELETE)
    @ApiOperation(value = "删除QA检测项报告管理")
    @DeleteMapping(value = "/open/t-qa-test-item-report/deleteById")
@@ -184,7 +197,7 @@
    /**
     * 批量删除QA检测项报告管理
     */
    @PreAuthorize("@ss.hasPermi('system:qaTestItemReport:delete')")
    //@PreAuthorize("@ss.hasPermi('system:qaTestItemReport:delete')")
    @Log(title = "QA检测项报告管理信息-删除QA检测项报告管理", businessType = BusinessType.DELETE)
    @ApiOperation(value = "批量删除QA检测项报告管理")
    @DeleteMapping(value = "/open/t-qa-test-item-report/deleteByIds")
@@ -198,7 +211,7 @@
    /**
     * 撤销QA检测项报告管理
     */
    @PreAuthorize("@ss.hasPermi('system:qaTestItemReport:revokedReport')")
    //@PreAuthorize("@ss.hasPermi('system:qaTestItemReport:revokedReport')")
    @Log(title = "QA检测项报告管理信息-撤销QA检测项报告管理状态", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "撤销QA检测项报告管理状态")
    @PutMapping(value = "/open/t-qa-test-item-report/revokedReport")
@@ -212,7 +225,7 @@
    /**
     * 审核QA检测项报告管理
     */
    @PreAuthorize("@ss.hasPermi('system:qaTestItemReport:auditReport')")
    //@PreAuthorize("@ss.hasPermi('system:qaTestItemReport:auditReport')")
    @Log(title = "QA检测项报告管理信息-审核QA检测项报告管理状态", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "审核QA检测项报告管理状态")
    @PostMapping(value = "/api/t-qa-test-item-report/auditReport")