无关风月
2 天以前 ce0651907f18a57dae80065e01589e975530f53e
Merge remote-tracking branch 'origin/master'
28个文件已修改
7个文件已添加
894 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFeasibilityStudyReportController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TProjectApprovalReportController.java 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 194 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/enums/ProjectApprovalReportStatusEnum.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/dto/TProjectApprovalReportDTO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/dto/TTesterOtherTaskDTO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TProjectApprovalReportMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | 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/TProjectApprovalReportQuery.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TTesterOtherTaskQuery.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/TProjectApprovalReportService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/TTesterOtherTaskService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TProjectApprovalReportServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | 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/TProjectApprovalReportVO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | 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 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TExperimentResultReportMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TExperimentSchemeMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TFeasibilityStudyReportMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TInspectionReportMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TProjectApprovalReportMapper.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TProjectProposalMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TQaProduceReportMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TQaTestItemMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TQaTestItemReportMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TResultWorkEvaluateMapper.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TSamplingRecordMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TTestMethodConfirmSheetMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TTestMethodConfirmSheetOriginalMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TTesterOtherTaskMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFeasibilityStudyReportController.java
@@ -129,7 +129,7 @@
            }
        }
        Map<String,Integer> map = feasibilityStudyReportService.evaluateCount(query);
        return R.ok();
        return R.ok(map);
    }
    /**
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TProjectApprovalReportController.java
@@ -1,9 +1,41 @@
package com.ruoyi.web.controller.api;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.FeasibilityReportFileEnum;
import com.ruoyi.common.enums.ProjectApprovalReportStatusEnum;
import com.ruoyi.common.enums.StudyReportTypeEnum;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.AuditStatusDTO;
import com.ruoyi.system.dto.TProjectApprovalReportDTO;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.model.TFeasibilityReportFile;
import com.ruoyi.system.model.TProjectApprovalReport;
import com.ruoyi.system.model.TProjectTeam;
import com.ruoyi.system.model.TProjectTeamStaff;
import com.ruoyi.system.query.TProjectApprovalReportQuery;
import com.ruoyi.system.service.TFeasibilityReportFileService;
import com.ruoyi.system.service.TProjectApprovalReportService;
import com.ruoyi.system.service.TProjectTeamService;
import com.ruoyi.system.service.TProjectTeamStaffService;
import com.ruoyi.system.vo.TProjectApprovalReportVO;
import io.jsonwebtoken.lang.Collections;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
 * <p>
@@ -15,8 +47,202 @@
 */
@Api(tags = "立项报告管理")
@RestController
@RequestMapping("/t-project-approval-report")
@RequestMapping("")
public class TProjectApprovalReportController {
    private final TProjectApprovalReportService projectApprovalReportService;
    private final TFeasibilityReportFileService feasibilityReportFileService;
    private final TokenService tokenService;
    private final TProjectTeamService projectTeamService;
    private final TProjectTeamStaffService projectTeamStaffService;
    private final SysUserMapper sysUserMapper;
    @Autowired
    public TProjectApprovalReportController(TProjectApprovalReportService projectApprovalReportService, TFeasibilityReportFileService feasibilityReportFileService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, SysUserMapper sysUserMapper) {
        this.projectApprovalReportService = projectApprovalReportService;
        this.feasibilityReportFileService = feasibilityReportFileService;
        this.tokenService = tokenService;
        this.projectTeamService = projectTeamService;
        this.projectTeamStaffService = projectTeamStaffService;
        this.sysUserMapper = sysUserMapper;
    }
    /**
     * 获取立项报告列表
     */
    //@PreAuthorize("@ss.hasPermi('system:projectApprovalReport:list')")
    @ApiOperation(value = "获取立项报告分页列表",response = TProjectApprovalReportQuery.class)
    @PostMapping(value = "/api/t-project-approval-report/pageList")
    public R<PageInfo<TProjectApprovalReportVO>> pageList(@RequestBody String param) {
        TProjectApprovalReportQuery query = JSON.parseObject(param, TProjectApprovalReportQuery.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(projectApprovalReportService.pageList(query));
    }
    /**
     * 添加立项报告管理
     */
    //@PreAuthorize("@ss.hasPermi('system:projectApprovalReport:add')")
    @Log(title = "立项报告信息-新增立项报告", businessType = BusinessType.INSERT)
    @ApiOperation(value = "添加立项报告",response = TProjectApprovalReportDTO.class)
    @PostMapping(value = "/api/t-project-approval-report/add")
    public R<Boolean> add(@RequestBody String param) {
        TProjectApprovalReportDTO dto = JSON.parseObject(param,TProjectApprovalReportDTO.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("当前用户未分配项目组,无法创建项目课题方案");
        }
        // 查询项目组
        TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId());
        if(Objects.isNull(projectTeam)){
            return R.fail("项目组不存在");
        }
        if(projectTeam.getStatus() == 2){
            return R.fail("项目组已封存,无法创建项目课题方案");
        }
        // 生成可研、可行、工艺开发工具、验证发布报告编号
        String reportCode = projectTeam.getTeamName() + "-" + StudyReportTypeEnum.VERIFICATION_RELEASE.getCode();
        // 查询上个项目课题方案的序号
        long count = projectApprovalReportService.count(Wrappers.lambdaQuery(TProjectApprovalReport.class)
                .like(TProjectApprovalReport::getReportCode, reportCode));
        reportCode = reportCode + "-" + String.format("%03d", count+1);
        dto.setReportCode(reportCode);
        projectApprovalReportService.save(dto);
        // 添加检测报告文件
        List<TFeasibilityReportFile> feasibilityReportFiles = dto.getFeasibilityReportFiles();
        if(!Collections.isEmpty(feasibilityReportFiles)){
            for (TFeasibilityReportFile feasibilityReportFile : feasibilityReportFiles) {
                feasibilityReportFile.setReportId(dto.getId());
                feasibilityReportFile.setReportType(FeasibilityReportFileEnum.PROJECT_PROPOSAL.getCode());
            }
        }
        feasibilityReportFileService.saveBatch(feasibilityReportFiles);
        return R.ok();
    }
    /**
     * 修改立项报告
     */
    //@PreAuthorize("@ss.hasPermi('system:projectApprovalReport:edit')")
    @Log(title = "立项报告信息-修改立项报告", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "修改立项报告")
    @PostMapping(value = "/api/t-project-approval-report/update")
    public R<Boolean> update(@RequestBody String param) {
        TProjectApprovalReportDTO dto = JSON.parseObject(param,TProjectApprovalReportDTO.class);
        projectApprovalReportService.updateById(dto);
        feasibilityReportFileService.remove(Wrappers.lambdaQuery(TFeasibilityReportFile.class)
                .eq(TFeasibilityReportFile::getReportId, dto.getId()));
        // 添加检测报告文件
        List<TFeasibilityReportFile> feasibilityReportFiles = dto.getFeasibilityReportFiles();
        if(!Collections.isEmpty(feasibilityReportFiles)){
            for (TFeasibilityReportFile feasibilityReportFile : feasibilityReportFiles) {
                feasibilityReportFile.setReportId(dto.getId());
                feasibilityReportFile.setReportType(FeasibilityReportFileEnum.PROJECT_PROPOSAL.getCode());
            }
        }
        feasibilityReportFileService.saveBatch(feasibilityReportFiles);
        return R.ok();
    }
    /**
     * 查看立项报告详情
     */
    //@PreAuthorize("@ss.hasPermi('system:projectApprovalReport:detail')")
    @ApiOperation(value = "查看立项报告详情")
    @GetMapping(value = "/open/t-project-approval-report/getDetailById")
    public R<TProjectApprovalReportVO> getDetailById(@RequestParam String id) {
        TProjectApprovalReport projectApprovalReport = projectApprovalReportService.getById(id);
        TProjectApprovalReportVO projectApprovalReportVO = new TProjectApprovalReportVO();
        BeanUtils.copyProperties(projectApprovalReport, projectApprovalReportVO);
        // 查询检测报告文件
        List<TFeasibilityReportFile> feasibilityReportFiles = feasibilityReportFileService.list(Wrappers.lambdaQuery(TFeasibilityReportFile.class)
                .eq(TFeasibilityReportFile::getReportId, id));
        projectApprovalReportVO.setFeasibilityReportFiles(feasibilityReportFiles);
        // 查询项目组
        TProjectTeam projectTeam = projectTeamService.getById(projectApprovalReport.getTeamId());
        // 查询项目组成员
        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());
        List<SysUser> sysUsers = sysUserMapper.selectUserByIds(userIds);
        projectApprovalReportVO.setStaffNames(sysUsers.stream().map(SysUser::getNickName).collect(Collectors.joining(",")));
        projectApprovalReportVO.setProjectTeam(projectTeam);
        return R.ok(projectApprovalReportVO);
    }
    /**
     * 删除立项报告
     */
    //@PreAuthorize("@ss.hasPermi('system:projectApprovalReport:delete')")
    @Log(title = "立项报告信息-删除立项报告", businessType = BusinessType.DELETE)
    @ApiOperation(value = "删除立项报告")
    @DeleteMapping(value = "/open/t-project-approval-report/deleteById")
    public R<Boolean> deleteById(@RequestParam String id) {
        // 删除可研、可行、工艺开发工具、验证发布报告文件
        feasibilityReportFileService.remove(Wrappers.lambdaQuery(TFeasibilityReportFile.class).eq(TFeasibilityReportFile::getReportId, id));
        return R.ok(projectApprovalReportService.removeById(id));
    }
    /**
     * 批量删除立项报告
     */
    //@PreAuthorize("@ss.hasPermi('system:projectApprovalReport:delete')")
    @Log(title = "立项报告信息-删除立项报告", businessType = BusinessType.DELETE)
    @ApiOperation(value = "批量删除立项报告")
    @DeleteMapping(value = "/open/t-project-approval-report/deleteByIds")
    public R<Boolean> deleteByIds(@RequestBody List<String> ids) {
        // 删除可研、可行、工艺开发工具、验证发布报告文件
        feasibilityReportFileService.remove(Wrappers.lambdaQuery(TFeasibilityReportFile.class).in(TFeasibilityReportFile::getReportId, ids));
        return R.ok(projectApprovalReportService.removeByIds(ids));
    }
    /**
     * 撤销立项报告
     */
    //@PreAuthorize("@ss.hasPermi('system:projectApprovalReport:revokedReport')")
    @Log(title = "立项报告信息-撤销立项报告状态", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "撤销立项报告状态")
    @PutMapping(value = "/open/t-project-approval-report/revokedReport")
    public R<Boolean> revokedReport(@RequestParam String id) {
        TProjectApprovalReport projectApprovalReport = projectApprovalReportService.getById(id);
        projectApprovalReport.setStatus(ProjectApprovalReportStatusEnum.REVOKED.getCode());
        projectApprovalReportService.updateById(projectApprovalReport);
        return R.ok();
    }
    /**
     * 审核立项报告
     */
    //@PreAuthorize("@ss.hasPermi('system:projectApprovalReport:auditReport')")
    @Log(title = "立项报告信息-审核立项报告状态", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "审核立项报告状态")
    @PostMapping(value = "/api/t-project-approval-report/auditReport")
    public R<Boolean> auditReport(@RequestBody String param) {
        Long userId = tokenService.getLoginUser().getUserId();
        AuditStatusDTO dto = JSON.parseObject(param,AuditStatusDTO.class);
        TProjectApprovalReport projectApprovalReport = projectApprovalReportService.getById(dto.getId());
        projectApprovalReport.setStatus(dto.getAuditStatus());
        projectApprovalReport.setAuditRemark(dto.getAuditRemark());
        projectApprovalReport.setAuditPersonId(userId);
        projectApprovalReport.setAuditTime(LocalDateTime.now());
        projectApprovalReportService.updateById(projectApprovalReport);
        return R.ok();
    }
}
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>
@@ -40,62 +40,62 @@
 */
@Api(tags = "实验员其他任务管理")
@RestController
@RequestMapping("/t-tester-other-task")
@RequestMapping("")
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-common/src/main/java/com/ruoyi/common/enums/ProjectApprovalReportStatusEnum.java
New file
@@ -0,0 +1,47 @@
package com.ruoyi.common.enums;
import lombok.Getter;
/**
 * @author xiaochen
 * @ClassName Disable
 * @Description
 * @date 2022-06-08 16:55
 */
public enum ProjectApprovalReportStatusEnum {
    /*状态 -1=草稿箱 1=待审核 2=已通过 3=已驳回 4=已撤回*/
    DRAFTS(-1, "草稿箱"),
    PENDING_APPROVAL(1, "待审核"),
    PASSED(2, "已通过"),
    REJECTED(3, "已驳回"),
    REVOKED(4, "已撤销");
    @Getter
    private String desc;
    @Getter
    private int code;
    ProjectApprovalReportStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static ProjectApprovalReportStatusEnum fromCode(Integer code) {
        ProjectApprovalReportStatusEnum[] resultTypes = ProjectApprovalReportStatusEnum.values();
        for (ProjectApprovalReportStatusEnum resultType : resultTypes) {
            if (code.equals(resultType.getCode())) {
                return resultType;
            }
        }
        return null;
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/dto/TProjectApprovalReportDTO.java
New file
@@ -0,0 +1,18 @@
package com.ruoyi.system.dto;
import com.ruoyi.system.model.TFeasibilityReportFile;
import com.ruoyi.system.model.TProjectApprovalReport;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "立项报告新增编辑DTO")
public class TProjectApprovalReportDTO extends TProjectApprovalReport {
    @ApiModelProperty(value = "立项报告文件集合")
    private List<TFeasibilityReportFile> feasibilityReportFiles;
}
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/TProjectApprovalReportMapper.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.TProjectApprovalReport;
import com.ruoyi.system.query.TProjectApprovalReportQuery;
import com.ruoyi.system.vo.TProjectApprovalReportVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
@@ -13,4 +19,11 @@
 */
public interface TProjectApprovalReportMapper extends BaseMapper<TProjectApprovalReport> {
    /**
     *  分页查询列表
     * @param query
     * @param pageInfo
     * @return
     */
    List<TProjectApprovalReportVO> pageList(@Param("query") TProjectApprovalReportQuery query, @Param("pageInfo")PageInfo<TProjectApprovalReportVO> pageInfo);
}
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/TProjectApprovalReportQuery.java
New file
@@ -0,0 +1,27 @@
package com.ruoyi.system.query;
import com.ruoyi.common.core.domain.model.TimeRangeQueryBody;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "立项报告信息查询对象query")
public class TProjectApprovalReportQuery extends TimeRangeQueryBody {
    @ApiModelProperty(value = "项目组名称")
    private String teamName;
    @ApiModelProperty(value = "报告标题")
    private String reportName;
    @ApiModelProperty(value = "报告编号")
    private String reportCode;
    @ApiModelProperty(value = "状态 -1=草稿箱 1=待审核 2=待评定 3=已评定 4=已驳回 5=已撤回")
    private Integer status;
    @ApiModelProperty(value = "项目组id集合 前端忽略")
    private List<String> teamIds;
}
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/TProjectApprovalReportService.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.TProjectApprovalReport;
import com.ruoyi.system.query.TProjectApprovalReportQuery;
import com.ruoyi.system.vo.TProjectApprovalReportVO;
/**
 * <p>
@@ -13,4 +16,11 @@
 */
public interface TProjectApprovalReportService extends IService<TProjectApprovalReport> {
    /**
     * 获取立项报告分页列表
     * @param query
     * @return
     */
    PageInfo<TProjectApprovalReportVO> pageList(TProjectApprovalReportQuery query);
}
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/TProjectApprovalReportServiceImpl.java
@@ -1,10 +1,18 @@
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.TProjectApprovalReportMapper;
import com.ruoyi.system.model.TProjectApprovalReport;
import com.ruoyi.system.query.TProjectApprovalReportQuery;
import com.ruoyi.system.service.TProjectApprovalReportService;
import com.ruoyi.system.vo.SysOperLogVO;
import com.ruoyi.system.vo.TFeasibilityStudyReportVO;
import com.ruoyi.system.vo.TProjectApprovalReportVO;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
 * <p>
@@ -17,4 +25,12 @@
@Service
public class TProjectApprovalReportServiceImpl extends ServiceImpl<TProjectApprovalReportMapper, TProjectApprovalReport> implements TProjectApprovalReportService {
    @Override
    public PageInfo<TProjectApprovalReportVO> pageList(TProjectApprovalReportQuery query) {
        PageInfo<TProjectApprovalReportVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TProjectApprovalReportVO> list = this.baseMapper.pageList(query,pageInfo);
        pageInfo.setRecords(list);
        return pageInfo;
    }
}
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/TProjectApprovalReportVO.java
New file
@@ -0,0 +1,28 @@
package com.ruoyi.system.vo;
import com.ruoyi.system.model.TFeasibilityReportFile;
import com.ruoyi.system.model.TProjectApprovalReport;
import com.ruoyi.system.model.TProjectTeam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "立项报告信息VO")
public class TProjectApprovalReportVO extends TProjectApprovalReport {
    @ApiModelProperty(value = "项目组名称")
    private String teamName;
    @ApiModelProperty(value = "项目组信息")
    private TProjectTeam projectTeam;
    @ApiModelProperty(value = "项目组成员名称拼接")
    private String staffNames;
    @ApiModelProperty(value = "立项报告文件")
    private List<TFeasibilityReportFile> feasibilityReportFiles;
}
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
@@ -38,9 +38,12 @@
            <if test="query.experimentCode != null and query.experimentCode != ''">
                and ted.experiment_code like concat('%',#{query.experimentCode},'%')
            </if>
            <if test="query.status !=null">
            <if test="query.status !=null and query.status != -1">
                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
@@ -45,9 +45,12 @@
            <if test="query.experimentName != null and query.experimentName != ''">
                and ted.experiment_name like concat('%', #{query.experimentName}, '%')
            </if>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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
@@ -43,9 +43,12 @@
        left join t_experiment_dispatch ted on tes.dispatch_id = ted.id
        left join t_project_proposal tpp on ted.proposal_id = tpp.id
        <where>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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>
@@ -79,8 +82,11 @@
            <if test="query.teamName != null and query.teamName != ''">
                and tpt.team_name like concat('%', #{query.teamName})
            </if>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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}
@@ -97,6 +103,7 @@
                    #{teamId}
                </foreach>
            </if>
            and tfsr.status in (2,3)
            AND tfsr.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY tfsr.create_time DESC
@@ -118,9 +125,12 @@
            <if test="query.teamName != null and query.teamName != ''">
                and tpt.team_name like concat('%', #{query.teamName})
            </if>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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
@@ -38,9 +38,12 @@
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND tir.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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/TProjectApprovalReportMapper.xml
@@ -24,5 +24,38 @@
    <sql id="Base_Column_List">
        id, team_id, report_code, report_name, report_text, status, audit_person_id, audit_time, audit_remark, create_time, update_time, create_by, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.TProjectApprovalReportVO">
        select id, team_id, report_code, report_name, report_text, status, audit_person_id, audit_time, audit_remark, create_time, update_time, create_by, update_by, disabled
        from t_project_approval_report tpar
        left join t_project_team tpt on tpt.id = tpar.team_id
        <where>
            <if test="query.teamIds != null and query.teamIds.size() > 0">
                and tpt.id in
                <foreach item="item" collection="query.teamIds" separator="," open="(" close=")" index="">
                    #{item}
                </foreach>
            </if>
            <if test="query.teamName != null and query.teamName != ''">
                and tpt.team_name like concat('%',#{query.teamName},'%')
            </if>
            <if test="query.reportCode != null and query.reportCode != ''">
                and tpar.report_code like concat('%',#{query.reportCode},'%')
            </if>
            <if test="query.reportName != null and query.reportName != ''">
                and tpar.report_name like concat('%',#{query.reportName},'%')
            </if>
            <if test="query.status != null and query.status != -1">
                and tpar.status = #{query.status}
            </if>
            <if test="query.status == null">
                and tpar.status != -1
            </if>
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND tpar.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            AND tpar.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        ORDER BY tpar.create_time DESC
    </select>
</mapper>
ruoyi-system/src/main/resources/mapper/system/TProjectProposalMapper.xml
@@ -55,9 +55,12 @@
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND tpp.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.auditStatus != null">
            <if test="query.auditStatus != null and query.auditStatus != -1">
                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
@@ -47,9 +47,12 @@
            <if test="query.teamName != null and query.teamName != ''">
                and tpt.team_name like concat('%', #{query.teamName}, '%')
            </if>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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
@@ -41,9 +41,12 @@
            <if test="query.itemCode != null and query.itemCode != ''">
               and tqti.item_code like concat('%', #{query.itemCode})
            </if>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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
@@ -54,9 +54,12 @@
            <if test="query.reportContent != null and query.reportContent != ''">
                and tqtir.report_content = #{query.reportContent}
            </if>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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
@@ -40,8 +40,11 @@
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND t1.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.status != null">
                AND t1.audit_status = #{query.auditStatus}
            <if test="query.status != null and query.status != -1">
                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
@@ -41,9 +41,12 @@
            <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''">
                AND tsr.create_time BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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 query.auditStatus != -1">
                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
@@ -44,9 +44,12 @@
            <if test="query.createBy != null and query.createBy != ''">
                and ttmcso.create_by like concat('%', #{query.createBy}, '%')
            </if>
            <if test="query.status != null">
            <if test="query.status != null and query.status != -1">
                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>