xuhy
2025-05-20 a0c2e172574bdf5c50fe31803756a3f0c869a9dd
测评接口,草稿箱修改
3个文件已添加
22个文件已修改
439 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSamplingRecordController.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTesterOtherTaskController.java 192 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/dto/TTesterOtherTaskDTO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTesterOtherTaskMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/model/TSamplingRecordOperation.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TTesterOtherTaskQuery.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/TTesterOtherTaskService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSamplingRecordServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTesterOtherTaskServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/TSamplingRecordVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/TTesterOtherTaskVO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TExperimentDispatchMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TExperimentResultReportMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TExperimentSchemeMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TFeasibilityStudyReportMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TInspectionReportMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TProjectProposalMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TQaProduceReportMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TQaTestItemMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TQaTestItemReportMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TResultWorkEvaluateMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TSamplingRecordMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TTestMethodConfirmSheetMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TTestMethodConfirmSheetOriginalMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TTesterOtherTaskMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSamplingRecordController.java
@@ -6,6 +6,7 @@
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.TokenService;
@@ -28,6 +29,7 @@
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
 * <p>
@@ -51,8 +53,9 @@
    private final TProjectProposalService projectProposalService;
    private final TProjectTeamService projectTeamService;
    private final TProjectTeamStaffService projectTeamStaffService;
    private final TExperimentDispatchParticipantsService experimentDispatchParticipantsService;
    @Autowired
    public TSamplingRecordController(TSamplingRecordService samplingRecordService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TSamplingRecordOperationService samplingRecordOperationService, TExperimentDispatchService experimentDispatchService, TProjectProposalService projectProposalService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) {
    public TSamplingRecordController(TSamplingRecordService samplingRecordService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TSamplingRecordOperationService samplingRecordOperationService, TExperimentDispatchService experimentDispatchService, TProjectProposalService projectProposalService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService) {
        this.samplingRecordService = samplingRecordService;
        this.tokenService = tokenService;
        this.sysUserService = sysUserService;
@@ -62,6 +65,7 @@
        this.projectProposalService = projectProposalService;
        this.projectTeamService = projectTeamService;
        this.projectTeamStaffService = projectTeamStaffService;
        this.experimentDispatchParticipantsService = experimentDispatchParticipantsService;
    }
    /**
@@ -130,12 +134,12 @@
    public R<Boolean> update(@RequestBody String param) {
        TSamplingRecordDTO dto = JSON.parseObject(param,TSamplingRecordDTO.class);
        samplingRecordService.updateById(dto);
        samplingRecordOperationService.remove(Wrappers.lambdaQuery(TSamplingRecordOperation.class).eq(TSamplingRecordOperation::getSamplingId,dto.getId()));
//        samplingRecordOperationService.remove(Wrappers.lambdaQuery(TSamplingRecordOperation.class).eq(TSamplingRecordOperation::getSamplingId,dto.getId()));
        List<TSamplingRecordOperation> samplingRecordOperations = dto.getSamplingRecordOperations();
        samplingRecordOperations.forEach(samplingRecordOperation -> {
            samplingRecordOperation.setSamplingId(dto.getId());
        });
        samplingRecordOperationService.saveBatch(samplingRecordOperations);
        samplingRecordOperationService.saveOrUpdateBatch(samplingRecordOperations);
        return R.ok();
    }
@@ -169,6 +173,8 @@
        Long userId = tokenService.getLoginUser().getUserId();
        samplingRecord.setCommitPersonId(userId);
        samplingRecord.setStatus(2);
        samplingRecord.setCommitSign(samplingRecord.getCommitSign());
        samplingRecord.setRemark(samplingRecord.getRemark());
        samplingRecord.setCommitTime(LocalDateTime.now());
        samplingRecordService.updateById(samplingRecord);
        return R.ok();
@@ -186,10 +192,42 @@
        BeanUtils.copyProperties(samplingRecord, samplingRecordVO);
        // 查询取样操作记录
        samplingRecordVO.setSamplingRecordOperations(samplingRecordOperationService.list(Wrappers.lambdaQuery(TSamplingRecordOperation.class).eq(TSamplingRecordOperation::getSamplingId, id)));
        List<TSamplingRecordOperation> samplingRecordOperations = samplingRecordOperationService.list(Wrappers.lambdaQuery(TSamplingRecordOperation.class).eq(TSamplingRecordOperation::getSamplingId, id));
        List<Long> userIds = samplingRecordOperations.stream().map(TSamplingRecordOperation::getHandlePersonId).collect(Collectors.toList());
        List<Long> sendUserIds = samplingRecordOperations.stream().map(TSamplingRecordOperation::getSendPersonId).collect(Collectors.toList());
        List<Long> receiptsUserIds = samplingRecordOperations.stream().map(TSamplingRecordOperation::getReceiptsPersonId).collect(Collectors.toList());
        userIds.addAll(sendUserIds);
        userIds.addAll(receiptsUserIds);
        List<SysUser> sysUsers = sysUserMapper.selectUserByIds(userIds);
        samplingRecordOperations.forEach(samplingRecordOperation -> {
            if(Objects.nonNull(samplingRecordOperation.getHandlePersonId())){
                samplingRecordOperation.setHandlePersonName(Objects.requireNonNull(sysUsers.stream().filter(user -> user.getUserId().equals(samplingRecordOperation.getHandlePersonId())).findFirst().orElse(null)).getNickName());
            }
            if(Objects.nonNull(samplingRecordOperation.getSendPersonId())){
                samplingRecordOperation.setSendPersonName(Objects.requireNonNull(sysUsers.stream().filter(user -> user.getUserId().equals(samplingRecordOperation.getSendPersonId())).findFirst().orElse(null)).getNickName());
            }
            if(Objects.nonNull(samplingRecordOperation.getReceiptsPersonId())){
                samplingRecordOperation.setReceiptsPersonName(Objects.requireNonNull(sysUsers.stream().filter(user -> user.getUserId().equals(samplingRecordOperation.getReceiptsPersonId())).findFirst().orElse(null)).getNickName());
            }
        });
        samplingRecordVO.setSamplingRecordOperations(samplingRecordOperations);
        // 查询实验调度信息
        TExperimentDispatch experimentDispatch = experimentDispatchService.getById(samplingRecordVO.getDispatchId());
        if(Objects.nonNull(experimentDispatch)){
            List<TExperimentDispatchParticipants> tExperimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class)
                    .eq(TExperimentDispatchParticipants::getDispatchId, experimentDispatch.getId()));
            List<Long> userIdList = tExperimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getUserId).collect(Collectors.toList());
            List<SysUser> sysUserList = sysUserMapper.selectUserByIds(userIdList);
            tExperimentDispatchParticipants.forEach(tExperimentDispatchParticipant -> {
                SysUser sysUser = sysUserList.stream().filter(user -> user.getUserId().equals(tExperimentDispatchParticipant.getUserId())).findFirst().orElse(null);
                if(sysUser != null){
                    tExperimentDispatchParticipant.setNickName(sysUser.getNickName());
                }
            });
            String participantsName = tExperimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getNickName).collect(Collectors.joining(";"));
            experimentDispatch.setParticipantsName(participantsName);
            // 查询课题方案名称
            TProjectProposal projectProposal = projectProposalService.getById(experimentDispatch.getProposalId());
            if(Objects.nonNull(projectProposal)){
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TTesterOtherTaskController.java
@@ -6,21 +6,20 @@
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.enums.QaReportFileEnum;
import com.ruoyi.common.enums.QaReportTypeEnum;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.TQaTestItemReportDTO;
import com.ruoyi.system.dto.TTesterOtherTaskDTO;
import com.ruoyi.system.mapper.SysUserMapper;
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.model.TTesterOtherTask;
import com.ruoyi.system.query.TTesterOtherTaskQuery;
import com.ruoyi.system.service.TProjectTeamService;
import com.ruoyi.system.service.TProjectTeamStaffService;
import com.ruoyi.system.service.TQaReportFileService;
import com.ruoyi.system.service.TQaTestItemReportService;
import com.ruoyi.system.vo.TQaTestItemReportVO;
import com.ruoyi.system.service.TTesterOtherTaskService;
import com.ruoyi.system.vo.TProjectTeamVO;
import com.ruoyi.system.vo.TTesterOtherTaskVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
@@ -29,6 +28,7 @@
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
 * <p>
@@ -43,59 +43,59 @@
@RequestMapping("/t-tester-other-task")
public class TTesterOtherTaskController {
    private final TQaTestItemReportService qaTestItemReportService;
    private final TQaReportFileService qaReportFileService;
    private final TTesterOtherTaskService testerOtherTaskService;
    private final TokenService tokenService;
    private final TProjectTeamService projectTeamService;
    private final TProjectTeamStaffService projectTeamStaffService;
    private final SysUserMapper sysUserMapper;
    @Autowired
    public TTesterOtherTaskController(TQaTestItemReportService qaTestItemReportService, TQaReportFileService qaReportFileService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) {
        this.qaTestItemReportService = qaTestItemReportService;
        this.qaReportFileService = qaReportFileService;
    public TTesterOtherTaskController(TTesterOtherTaskService testerOtherTaskService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, SysUserMapper sysUserMapper) {
        this.testerOtherTaskService = testerOtherTaskService;
        this.tokenService = tokenService;
        this.projectTeamService = projectTeamService;
        this.projectTeamStaffService = projectTeamStaffService;
        this.sysUserMapper = sysUserMapper;
    }
    /**
     * 获取QA检测项报告管理列表
     * 实验员其他任务管理列表
     */
    //@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);
        return R.ok(qaTestItemReportService.pageList(query));
    //@PreAuthorize("@ss.hasPermi('system:testerOtherTask:list')")
    @ApiOperation(value = "实验员其他任务管理分页列表", response = TTesterOtherTaskQuery.class)
    @PostMapping(value = "/api/t-tester-other-task/pageList")
    public R<PageInfo<TTesterOtherTaskVO>> pageList(@RequestBody String param) {
        TTesterOtherTaskQuery query = JSON.parseObject(param, TTesterOtherTaskQuery.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(testerOtherTaskService.pageList(query));
    }
    /**
     * 获取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)
                .eq(TQaTestItemReport::getItemId, itemId));
        return R.ok(list);
    }
    /**
     * 添加QA检测项报告管理管理
     */
    //@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")
    //@PreAuthorize("@ss.hasPermi('system:testerOtherTask:add')")
    @Log(title = "实验员其他任务管理信息-新增实验员其他任务管理", businessType = BusinessType.INSERT)
    @ApiOperation(value = "添加实验员其他任务管理",response = TTesterOtherTaskDTO.class)
    @PostMapping(value = "/api/t-tester-other-task/add")
    public R<Boolean> add(@RequestBody String param) {
        TQaTestItemReportDTO dto = JSON.parseObject(param,TQaTestItemReportDTO.class);
        TTesterOtherTaskDTO dto = JSON.parseObject(param,TTesterOtherTaskDTO.class);
        // 通过当前用户查询项目组
        Long userId = tokenService.getLoginUser().getUserId();
        TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class)
                .eq(TProjectTeamStaff::getUserId, userId)
                .last("LIMIT 1"));
        if(Objects.isNull(projectTeamStaff)){
            return R.fail("当前用户未分配项目组,无法创建项目课题方案");
            return R.fail("当前用户未分配项目组,无法创建实验员其他任务");
        }
        // 查询项目组
        TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId());
@@ -105,92 +105,74 @@
        if(projectTeam.getStatus() == 2){
            return R.fail("项目组已封存,无法创建项目课题方案");
        }
        // 生成中试、生产验证编号
        String reportCode = projectTeam.getTeamName() + "-" + QaReportTypeEnum.TEST_REPORT.getCode();
        // 查询上个项目课题方案的序号
        long count = qaTestItemReportService.count(Wrappers.lambdaQuery(TQaTestItemReport.class)
                .like(TQaTestItemReport::getReportCode, reportCode));
        reportCode = reportCode + "-" + String.format("%03d", count+1);
        dto.setReportCode(reportCode);
        qaTestItemReportService.save(dto);
        // 添加检测报告文件
        List<TQaReportFile> qaReportFiles = dto.getQaReportFiles();
        for (TQaReportFile qaReportFile : qaReportFiles) {
            qaReportFile.setReportId(dto.getId());
            qaReportFile.setReportType(QaReportFileEnum.TEST_REPORT.getCode());
        }
        qaReportFileService.saveBatch(qaReportFiles);
        testerOtherTaskService.save(dto);
        return R.ok();
    }
    /**
     * 修改QA检测项报告管理
     * 修改实验员其他任务管理
     */
    //@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")
    //@PreAuthorize("@ss.hasPermi('system:testerOtherTask:edit')")
    @Log(title = "实验员其他任务管理信息-修改实验员其他任务管理", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "修改实验员其他任务管理")
    @PostMapping(value = "/api/t-tester-other-task/update")
    public R<Boolean> update(@RequestBody String param) {
        TQaTestItemReportDTO dto = JSON.parseObject(param,TQaTestItemReportDTO.class);
        qaTestItemReportService.updateById(dto);
        qaReportFileService.remove(Wrappers.lambdaQuery(TQaReportFile.class)
                .eq(TQaReportFile::getReportId, dto.getId()));
        // 添加检测报告文件
        List<TQaReportFile> qaReportFiles = dto.getQaReportFiles();
        for (TQaReportFile qaReportFile : qaReportFiles) {
            qaReportFile.setReportId(dto.getId());
            qaReportFile.setReportType(QaReportFileEnum.TEST_REPORT.getCode());
        }
        qaReportFileService.saveBatch(qaReportFiles);
        TTesterOtherTaskDTO dto = JSON.parseObject(param,TTesterOtherTaskDTO.class);
        testerOtherTaskService.updateById(dto);
        return R.ok();
    }
    /**
     * 查看QA检测项报告管理详情
     * 查看实验员其他任务管理详情
     */
    //@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) {
        TQaTestItemReport testItemReport = qaTestItemReportService.getById(id);
        TQaTestItemReportVO testItemReportVO = new TQaTestItemReportVO();
        BeanUtils.copyProperties(testItemReport, testItemReportVO);
        // 查询检测报告文件
        List<TQaReportFile> qaReportFiles = qaReportFileService.list(Wrappers.lambdaQuery(TQaReportFile.class)
                .eq(TQaReportFile::getReportId, id)
                .eq(TQaReportFile::getReportType, QaReportFileEnum.TEST_REPORT.getCode()));
        testItemReportVO.setQaReportFileList(qaReportFiles);
        return R.ok(testItemReportVO);
    //@PreAuthorize("@ss.hasPermi('system:testerOtherTask:detail')")
    @ApiOperation(value = "查看实验员其他任务管理详情")
    @GetMapping(value = "/open/t-tester-other-task/getDetailById")
    public R<TTesterOtherTaskVO> getDetailById(@RequestParam String id) {
        TTesterOtherTask testerOtherTask = testerOtherTaskService.getById(id);
        TTesterOtherTaskVO testerOtherTaskVO = new TTesterOtherTaskVO();
        BeanUtils.copyProperties(testerOtherTask, testerOtherTaskVO);
        // 查询项目组信息
        TProjectTeam projectTeam = projectTeamService.getById(testerOtherTask.getTeamId());
        TProjectTeamVO projectTeamVO = new TProjectTeamVO();
        BeanUtils.copyProperties(projectTeam, projectTeamVO);
        // 查询项目组成员
        List<TProjectTeamStaff> projectTeamStaffs = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class)
                .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()));
        List<Long> userIds = projectTeamStaffs.stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList());
        userIds = userIds.stream().distinct().collect(Collectors.toList());
        List<SysUser> sysUsers = sysUserMapper.selectUserByIds(userIds);
        // 拼接项目组成员名称
        projectTeamVO.setStaffName(sysUsers.stream().map(SysUser::getNickName).collect(Collectors.joining(",")));
        testerOtherTaskVO.setProjectTeam(projectTeamVO);
        // 查询是演员信息
        SysUser sysUser = sysUserMapper.selectUserById(testerOtherTaskVO.getTesterId());
        if(Objects.nonNull(sysUser)){
            testerOtherTaskVO.setTesterName(sysUser.getNickName());
        }
        return R.ok(testerOtherTaskVO);
    }
    /**
     * 删除QA检测项报告管理
     * 删除实验员其他任务管理
     */
    //@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")
    //@PreAuthorize("@ss.hasPermi('system:testerOtherTask:delete')")
    @Log(title = "实验员其他任务管理信息-删除实验员其他任务管理", businessType = BusinessType.DELETE)
    @ApiOperation(value = "删除实验员其他任务管理")
    @DeleteMapping(value = "/open/t-tester-other-task/deleteById")
    public R<Boolean> deleteById(@RequestParam String id) {
        // 删除QA检测项报告文件
        qaReportFileService.remove(Wrappers.lambdaQuery(TQaReportFile.class).eq(TQaReportFile::getReportId, id)
                .in(TQaReportFile::getReportType, QaReportFileEnum.TEST_REPORT.getCode()));
        return R.ok(qaTestItemReportService.removeById(id));
        return R.ok(testerOtherTaskService.removeById(id));
    }
    /**
     * 批量删除QA检测项报告管理
     * 批量删除实验员其他任务管理
     */
    //@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")
    //@PreAuthorize("@ss.hasPermi('system:testerOtherTask:delete')")
    @Log(title = "实验员其他任务管理信息-删除实验员其他任务管理", businessType = BusinessType.DELETE)
    @ApiOperation(value = "批量删除实验员其他任务管理")
    @DeleteMapping(value = "/open/t-tester-other-task/deleteByIds")
    public R<Boolean> deleteByIds(@RequestBody List<String> ids) {
        // 删除QA检测项报告检测报告文件
        qaReportFileService.remove(Wrappers.lambdaQuery(TQaReportFile.class).in(TQaReportFile::getReportId, ids)
                .in(TQaReportFile::getReportType, QaReportFileEnum.TEST_REPORT.getCode()));
        return R.ok(qaTestItemReportService.removeByIds(ids));
        return R.ok(testerOtherTaskService.removeByIds(ids));
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/dto/TTesterOtherTaskDTO.java
New file
@@ -0,0 +1,10 @@
package com.ruoyi.system.dto;
import com.ruoyi.system.model.TTesterOtherTask;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(value = "实验员其他任务新增编辑DTO")
public class TTesterOtherTaskDTO extends TTesterOtherTask {
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TTesterOtherTaskMapper.java
@@ -1,7 +1,13 @@
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.TTesterOtherTask;
import com.ruoyi.system.query.TTesterOtherTaskQuery;
import com.ruoyi.system.vo.TTesterOtherTaskVO;
import io.lettuce.core.dynamic.annotation.Param;
import java.util.List;
/**
 * <p>
@@ -13,4 +19,11 @@
 */
public interface TTesterOtherTaskMapper extends BaseMapper<TTesterOtherTask> {
    /**
     * 分页列表
     * @param query
     * @param pageInfo
     * @return
     */
    List<TTesterOtherTaskVO> pageList(@Param("query")TTesterOtherTaskQuery query, @Param("pageInfo")PageInfo<TTesterOtherTaskVO> pageInfo);
}
ruoyi-system/src/main/java/com/ruoyi/system/model/TSamplingRecordOperation.java
@@ -147,5 +147,16 @@
    @TableField("receipts_time")
    private LocalDateTime receiptsTime;
    @ApiModelProperty(value = "操作人姓名")
    @TableField(exist = false)
    private String handlePersonName;
    @ApiModelProperty(value = "送样人姓名")
    @TableField(exist = false)
    private String sendPersonName;
    @ApiModelProperty(value = "接收人姓名")
    @TableField(exist = false)
    private String receiptsPersonName;
}
ruoyi-system/src/main/java/com/ruoyi/system/query/TTesterOtherTaskQuery.java
New file
@@ -0,0 +1,21 @@
package com.ruoyi.system.query;
import com.ruoyi.common.core.domain.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "实验员其他任务管理查询参数query")
public class TTesterOtherTaskQuery extends BasePage {
    @ApiModelProperty(value = "项目组名称")
    private String teamName;
    @ApiModelProperty(value = "任务内容")
    private String taskContent;
    @ApiModelProperty(value = "项目组id集合 前端忽略")
    private List<String> teamIds;
}
ruoyi-system/src/main/java/com/ruoyi/system/service/TTesterOtherTaskService.java
@@ -1,7 +1,10 @@
package com.ruoyi.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.model.TTesterOtherTask;
import com.ruoyi.system.query.TTesterOtherTaskQuery;
import com.ruoyi.system.vo.TTesterOtherTaskVO;
/**
 * <p>
@@ -13,4 +16,10 @@
 */
public interface TTesterOtherTaskService extends IService<TTesterOtherTask> {
    /**
     * 实验员其他任务管理列表
     * @param query
     * @return
     */
    PageInfo<TTesterOtherTaskVO> pageList(TTesterOtherTaskQuery query);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TSamplingRecordServiceImpl.java
@@ -1,16 +1,21 @@
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.mapper.TSamplingRecordMapper;
import com.ruoyi.system.mapper.TSamplingRecordOperationMapper;
import com.ruoyi.system.model.TSamplingRecord;
import com.ruoyi.system.model.TSamplingRecordOperation;
import com.ruoyi.system.query.TSamplingRecordQuery;
import com.ruoyi.system.service.TSamplingRecordService;
import com.ruoyi.system.vo.SysOperLogVO;
import com.ruoyi.system.vo.TSamplingRecordVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.stream.Collectors;
/**
 * <p>
@@ -23,10 +28,27 @@
@Service
public class TSamplingRecordServiceImpl extends ServiceImpl<TSamplingRecordMapper, TSamplingRecord> implements TSamplingRecordService {
    @Autowired
    private TSamplingRecordOperationMapper samplingRecordOperationMapper;
    @Override
    public PageInfo<TSamplingRecordVO> pageList(TSamplingRecordQuery query) {
        PageInfo<TSamplingRecordVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TSamplingRecordVO> list = this.baseMapper.pageList(query,pageInfo);
        if(CollectionUtils.isEmpty(list)){
            return pageInfo;
        }
        List<String> recordIds = list.stream().map(TSamplingRecordVO::getId).collect(Collectors.toList());
        List<TSamplingRecordOperation> recordOperationList = samplingRecordOperationMapper.selectList(Wrappers.lambdaQuery(TSamplingRecordOperation.class)
                .in(TSamplingRecordOperation::getSamplingId, recordIds));
        list.forEach(item->{
            item.setSendCount(recordOperationList.stream().filter(recordOperation -> recordOperation.getSamplingId().equals(item.getId()) && recordOperation.getStatus() == 1).count());
            item.setReceiveCount(recordOperationList.stream().filter(recordOperation -> recordOperation.getSamplingId().equals(item.getId()) && recordOperation.getStatus() == 2).count());
            item.setReceivedCount(recordOperationList.stream().filter(recordOperation -> recordOperation.getSamplingId().equals(item.getId()) && recordOperation.getStatus() == 3).count());
        });
        pageInfo.setRecords(list);
        return pageInfo;
    }
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTesterOtherTaskServiceImpl.java
@@ -1,10 +1,16 @@
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.system.mapper.TTesterOtherTaskMapper;
import com.ruoyi.system.model.TTesterOtherTask;
import com.ruoyi.system.query.TTesterOtherTaskQuery;
import com.ruoyi.system.service.TTesterOtherTaskService;
import com.ruoyi.system.vo.TQaProduceReportVO;
import com.ruoyi.system.vo.TTesterOtherTaskVO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
@@ -17,4 +23,11 @@
@Service
public class TTesterOtherTaskServiceImpl extends ServiceImpl<TTesterOtherTaskMapper, TTesterOtherTask> implements TTesterOtherTaskService {
    @Override
    public PageInfo<TTesterOtherTaskVO> pageList(TTesterOtherTaskQuery query) {
        PageInfo<TTesterOtherTaskVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TTesterOtherTaskVO> list = this.baseMapper.pageList(query,pageInfo);
        pageInfo.setRecords(list);
        return pageInfo;
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/TSamplingRecordVO.java
@@ -20,9 +20,20 @@
    @ApiModelProperty(value = "实验名称")
    private String experimentName;
    @ApiModelProperty(value = "取样操作记录集合")
    private List<TSamplingRecordOperation> samplingRecordOperations;
    @ApiModelProperty(value = "实验调度信息")
    private TExperimentDispatch experimentDispatch;
    @ApiModelProperty(value = "已发送数量")
    private Long sendCount;
    @ApiModelProperty(value = "待接收数量")
    private Long receiveCount;
    @ApiModelProperty(value = "已接收数量")
    private Long receivedCount;
}
ruoyi-system/src/main/java/com/ruoyi/system/vo/TTesterOtherTaskVO.java
New file
@@ -0,0 +1,18 @@
package com.ruoyi.system.vo;
import com.ruoyi.system.model.TTesterOtherTask;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "实验员其他任务管理VO")
public class TTesterOtherTaskVO extends TTesterOtherTask {
    @ApiModelProperty(value = "项目组信息")
    private TProjectTeamVO projectTeam;
    @ApiModelProperty(value = "实验员姓名")
    private String testerName;
}
ruoyi-system/src/main/resources/mapper/system/TExperimentDispatchMapper.xml
@@ -41,6 +41,9 @@
            <if test="query.status !=null">
                and ted.status = #{query.status}
            </if>
            <if test="query.status ==null">
                and ted.status != -1
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND ted.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
ruoyi-system/src/main/resources/mapper/system/TExperimentResultReportMapper.xml
@@ -48,6 +48,9 @@
            <if test="query.status != null">
                and terr.status = #{query.status}
            </if>
            <if test="query.status == null">
                and terr.status != -1
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND terr.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
ruoyi-system/src/main/resources/mapper/system/TExperimentSchemeMapper.xml
@@ -46,6 +46,9 @@
            <if test="query.status != null">
                and tes.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tes.status != -1
            </if>
            <if test="query.projectName != null and query.projectName != ''">
                and tpp.project_name like concat('%', #{query.projectName}, '%')
            </if>
ruoyi-system/src/main/resources/mapper/system/TFeasibilityStudyReportMapper.xml
@@ -47,6 +47,9 @@
            <if test="query.status != null">
                and tfsr.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tfsr.status != -1
            </if>
            <if test="query.reportType != null">
                and tfsr.report_type = #{query.reportType}
            </if>
@@ -81,6 +84,9 @@
            </if>
            <if test="query.status != null">
                and tfsr.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tfsr.status != -1
            </if>
            <if test="query.reportType != null">
                and tfsr.report_type = #{query.reportType}
@@ -121,6 +127,9 @@
            <if test="query.status != null">
                and tfsr.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tfsr.status != -1
            </if>
            <if test="query.reportType != null">
                and tfsr.report_type = #{query.reportType}
            </if>
ruoyi-system/src/main/resources/mapper/system/TInspectionReportMapper.xml
@@ -41,6 +41,9 @@
            <if test="query.status != null">
                and tir.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tir.status != -1
            </if>
            <if test="query.createBy != null and query.createBy != ''">
                and tir.create_by = #{query.createBy}
            </if>
ruoyi-system/src/main/resources/mapper/system/TProjectProposalMapper.xml
@@ -58,6 +58,9 @@
            <if test="query.auditStatus != null">
                AND tpp.audit_status = #{query.auditStatus}
            </if>
            <if test="query.auditStatus == null">
                AND tpp.audit_status != -1
            </if>
            AND tpp.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY tpp.create_time DESC
ruoyi-system/src/main/resources/mapper/system/TQaProduceReportMapper.xml
@@ -50,6 +50,9 @@
            <if test="query.status != null">
                and tqpr.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tqpr.status != -1
            </if>
            <if test="query.teamIds != null and query.teamIds.size() > 0">
                and tqpr.team_id in
                <foreach collection="query.teamIds" item="teamId" open="(" separator="," close=")">
ruoyi-system/src/main/resources/mapper/system/TQaTestItemMapper.xml
@@ -44,6 +44,9 @@
            <if test="query.status != null">
                and tqti.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tqti.status != -1
            </if>
            <if test="query.teamIds != null and query.teamIds.size() > 0">
                and tqti.team_id in
                <foreach collection="query.teamIds" item="teamId" open="(" separator="," close=")">
ruoyi-system/src/main/resources/mapper/system/TQaTestItemReportMapper.xml
@@ -57,6 +57,9 @@
            <if test="query.status != null">
                and tqtir.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tqtir.status != -1
            </if>
            AND tqtir.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY tqtir.create_time DESC
ruoyi-system/src/main/resources/mapper/system/TResultWorkEvaluateMapper.xml
@@ -41,7 +41,10 @@
                AND t1.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.status != null">
                AND t1.audit_status = #{query.auditStatus}
                AND t1.status = #{query.status}
            </if>
            <if test="query.status == null">
                AND t1.status != -1
            </if>
            <if test="query.teamIds != null and query.teamIds > 0">
                AND t1.team_id in
ruoyi-system/src/main/resources/mapper/system/TSamplingRecordMapper.xml
@@ -44,6 +44,9 @@
            <if test="query.status != null">
                and tsr.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tsr.status != -1
            </if>
            <if test="query.createBy != null and query.createBy !=''">
                and tsr.create_by like concat('%', #{query.createBy}, '%')
            </if>
ruoyi-system/src/main/resources/mapper/system/TTestMethodConfirmSheetMapper.xml
@@ -40,9 +40,12 @@
            <if test="query.experimentCode != null and query.experimentCode !=''">
                and ted.experiment_code like concat('%', #{query.experimentCode}, '%')
            </if>
            <if test="query.auditStatus != null and query.auditStatus != ''">
            <if test="query.auditStatus != null">
                and tmcs.audit_status = #{query.auditStatus}
            </if>
            <if test="query.auditStatus == null">
                and tmcs.audit_status != -1
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND tmcs.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
ruoyi-system/src/main/resources/mapper/system/TTestMethodConfirmSheetOriginalMapper.xml
@@ -47,6 +47,9 @@
            <if test="query.status != null">
                and ttmcso.status = #{query.status}
            </if>
            <if test="query.status == null">
                and ttmcso.status != -1
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND ttmcso.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
ruoyi-system/src/main/resources/mapper/system/TTesterOtherTaskMapper.xml
@@ -22,5 +22,27 @@
    <sql id="Base_Column_List">
        id, team_id,tester_id, task_content, task_time, evaluate_score, evaluate_time, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TTesterOtherTaskVO">
        select ttot.id, ttot.team_id,ttot.tester_id, ttot.task_content, ttot.task_time, ttot.evaluate_score, ttot.evaluate_time,
        ttot.create_time, ttot.update_time, ttot.create_by, ttot.update_by, ttot.disabled,tpt.team_name as teamName
        from t_tester_other_task ttot
        left join t_project_team tpt on ttot.team_id = tpt.id
        <where>
            <if test="query.teamName != null and query.teamName != ''">
                and tpt.team_name like concat('%',#{query.teamName},'%')
            </if>
            <if test="query.taskContent != null and query.taskContent != ''">
                and ttot.task_content like concat('%',#{query.taskContent},'%')
            </if>
            <if test="query.teamIds != null and query.teamIds.size() > 0">
                and ttot.team_id in
                <foreach item="teamId" collection="query.teamIds" index="index" open="(" close=")" separator=",">
                    #{teamId}
                </foreach>
            </if>
            AND ttot.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY ttot.create_time DESC
    </select>
</mapper>