无关风月
3 天以前 c58bd98e23d43f8ff92b9b897999689a80b607e1
项目总积分
2个文件已修改
414 ■■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TResultWorkEvaluateController.java 412 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TResultWorkEvaluateQuery.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TResultWorkEvaluateController.java
@@ -36,7 +36,6 @@
 * @author xiaochen
 * @since 2025-04-08
 */
@Api(tags = "实验员工作评定管理")
@RestController
@RequestMapping("/t-result-work-evaluate")
public class TResultWorkEvaluateController {
@@ -67,7 +66,7 @@
        this.projectTeamStaffService = projectTeamStaffService;
        this.sysUserService = sysUserService;
    }
    @ApiOperation(value = "实验员工作评定管理分页列表", response = TQaTestItemReportQuery.class)
    @ApiOperation(value = "项目组总积分分页列表",tags = "项目组总积分",response = TQaTestItemReportQuery.class)
    @PostMapping(value = "/api/t-result-work-evaluate/pageList")
    public R<PageInfo<TResultWorkEvaluateVO>> pageList(@RequestBody String param) {
        LoginUser loginUser = tokenService.getLoginUser();
@@ -87,7 +86,7 @@
     * 查看取样记录详情
     */
    //@PreAuthorize("@ss.hasPermi('system:samplingRecord:detail')")
    @ApiOperation(value = "查看详情")
    @ApiOperation(value = "查看详情-顶部数据")
    @GetMapping(value = "/open/t-result-work-evaluate/getDetailById")
    public R<TResultWorkEvaluateDetailVO> getDetailById(@RequestParam String id) {
        TResultWorkEvaluateDetailVO tResultWorkEvaluateDetailVO = new TResultWorkEvaluateDetailVO();
@@ -95,8 +94,27 @@
        TResultWorkEvaluate resultWorkEvaluate = tResultWorkEvaluateService.getById(id);
        TProjectTeam projectTeam = projectTeamService.getById(resultWorkEvaluate.getTeamId());
        tResultWorkEvaluateDetailVO.setStartTime(projectTeam.getCreateTime());
        TProjectTeamStaff one = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getRoleType, 3).last("limit 1").one();
        Long userId = one.getUserId();
        TProjectTeamStaff one = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).eq(TProjectTeamStaff::getRoleType, 3).last("limit 1").one();
        List<Long> role4 = projectTeamStaffService.lambdaQuery()
                .eq(TProjectTeamStaff::getRoleType, 4).eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).list()
                .stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList());
        List<Long> role5 = projectTeamStaffService.lambdaQuery()
                .eq(TProjectTeamStaff::getRoleType, 5).eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).list()
                .stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList());
        List<SysUser> user4 = new ArrayList<>();
        List<SysUser> user5 = new ArrayList<>();
        for (Long l : role4) {
            SysUser sysUser = sysUserService.selectUserById(l);
            if (sysUser!=null){
                user4.add(sysUser);
            }
        }
        for (Long l : role5) {
            SysUser sysUser = sysUserService.selectUserById(l);
            if (sysUser!=null){
                user5.add(sysUser);
            }
        }
        List<TResultWorkEvaluate> list = tResultWorkEvaluateService.lambdaQuery().eq(TResultWorkEvaluate::getTeamId, resultWorkEvaluate.getTeamId())
                .eq(TResultWorkEvaluate::getStatus,1).orderByDesc(TResultWorkEvaluate::getEvaluateTime).list();
        int temp1=0;
@@ -266,6 +284,43 @@
        if (!list.isEmpty()){
            tResultWorkEvaluateDetailVO.setEndTime(list.get(0).getEvaluateTime());
        }
        return R.ok(tResultWorkEvaluateDetailVO);
    }
    @ApiOperation(value = "查看详情-左侧数据-工艺工程师工作内容评定")
    @GetMapping(value = "/open/t-result-work-evaluate/getDetailByIdLeftOne")
    public R<TResultWorkEvaluateDetailVO> getDetailByIdLeftOne(@RequestParam String id) {
        TResultWorkEvaluateDetailVO tResultWorkEvaluateDetailVO = new TResultWorkEvaluateDetailVO();
        TResultWorkEvaluate resultWorkEvaluate = tResultWorkEvaluateService.getById(id);
        TProjectTeam projectTeam = projectTeamService.getById(resultWorkEvaluate.getTeamId());
        TProjectTeamStaff one = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).eq(TProjectTeamStaff::getRoleType, 3).last("limit 1")
                .one();
        tResultWorkEvaluateDetailVO.setStartTime(projectTeam.getCreateTime());
        List<Long> role4 = projectTeamStaffService.lambdaQuery()
                .eq(TProjectTeamStaff::getRoleType, 4).eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).list()
                .stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList());
        List<Long> role5 = projectTeamStaffService.lambdaQuery()
                .eq(TProjectTeamStaff::getRoleType, 5).eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).list()
                .stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList());
        List<SysUser> user4 = new ArrayList<>();
        List<SysUser> user5 = new ArrayList<>();
        for (Long l : role4) {
            SysUser sysUser = sysUserService.selectUserById(l);
            if (sysUser != null) {
                user4.add(sysUser);
            }
        }
        for (Long l : role5) {
            SysUser sysUser = sysUserService.selectUserById(l);
            if (sysUser != null) {
                user5.add(sysUser);
            }
        }
        Long userId = one.getUserId();
        List<TFeasibilityStudyReport> total = feasibilityStudyReportService.lambdaQuery()
                .eq(TFeasibilityStudyReport::getStatus,3)
                .eq(TFeasibilityStudyReport::getEvaluatePersonId, userId).list();
@@ -311,9 +366,356 @@
        // 开发阶段
        TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO2 = new TResultWorkEvaluateDetailEngineerVO();
        List<Integer> status = new ArrayList<>();
        status.add(-1);
        status.add(1);
        status.add(3);
        status.add(4);
        status.add(5);
        List<TProjectProposal> list2 = projectProposalService.lambdaQuery().eq(TProjectProposal::getCommitUserId, userId)
                .notIn(TProjectProposal::getAuditStatus, status).list();
        List<String> collect5 = list2.stream().filter(e -> e.getProjectStage().equals(1)).map(TProjectProposal::getId).collect(Collectors.toList());
        if (collect5.isEmpty()){
            collect5.add("0");
        }
        List<String> collect6 = experimentDispatchService.lambdaQuery().in(TExperimentDispatch::getProposalId, collect5)
                .ne(TExperimentDispatch::getStatus, -1)
                .ne(TExperimentDispatch::getStatus, 1).list().stream().map(TExperimentDispatch::getId).collect(Collectors.toList());
        if (collect6.isEmpty()){
            collect6.add("0");
        }
        List<Integer> status1 = new ArrayList<>();
        status1.add(-1);
        status1.add(1);
        status1.add(2);
        status1.add(4);
        List<TResultWorkEvaluate> list1 = tResultWorkEvaluateService.lambdaQuery().in(TResultWorkEvaluate::getDispatchId, collect6).list();
        int tempDetail2 = 0;
        for (TResultWorkEvaluate tResultWorkEvaluate : list1) {
            Integer evaluateOne = tResultWorkEvaluate.getEvaluateOne();
            switch (evaluateOne){
                case 1:
                    tempDetail2+=2;
                    break;
                case 2:
                    tempDetail2+=1;
                    break;
            }
            Integer evaluateTwo = tResultWorkEvaluate.getEvaluateTwo();
            switch (evaluateTwo){
                case 1:
                    tempDetail2+=2;
                    break;
                case 2:
                    tempDetail2+=1;
                    break;
            }
            Integer evaluateThree = tResultWorkEvaluate.getEvaluateThree();
            switch (evaluateThree){
                case 1:
                    tempDetail2+=2;
                    break;
                case 2:
                    tempDetail2+=1;
                    break;
            }
            Integer evaluateFour = tResultWorkEvaluate.getEvaluateFour();
            switch (evaluateFour){
                case 1:
                    tempDetail2+=2;
                    break;
                case 2:
                    tempDetail2+=1;
                    break;
            }
            Integer evaluateFive = tResultWorkEvaluate.getEvaluateFive();
            switch (evaluateFive){
                case 1:
                    tempDetail2+=2;
                    break;
                case 2:
                    tempDetail2+=1;
                    break;
            }
            Integer evaluateSix = tResultWorkEvaluate.getEvaluateSix();
            switch (evaluateSix){
                case 1:
                    tempDetail2-=3;
                    break;
            }
        }
        if (!list1.isEmpty()){
            tResultWorkEvaluateDetailEngineerVO2.setEndTime(list1.get(list1.size()-1).getEvaluateTime());
        }
        tResultWorkEvaluateDetailEngineerVO2.setStartTime(projectTeam.getCreateTime());
        tResultWorkEvaluateDetailEngineerVO2.setCount(list1.size());
        tResultWorkEvaluateDetailEngineerVO2.setIntegral(tempDetail2);
        tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO2);
        // 中试试验阶段
        TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO3 = new TResultWorkEvaluateDetailEngineerVO();
        List<String> collect7 = list2.stream().filter(e -> e.getProjectStage().equals(2)).map(TProjectProposal::getId).collect(Collectors.toList());
        if (collect7.isEmpty()){
            collect7.add("0");
        }
        List<String> collect8 = experimentDispatchService.lambdaQuery().in(TExperimentDispatch::getProposalId, collect7)
                .ne(TExperimentDispatch::getStatus, -1)
                .ne(TExperimentDispatch::getStatus, 1).list().stream().map(TExperimentDispatch::getId).collect(Collectors.toList());
        if (collect8.isEmpty()){
            collect8.add("0");
        }
        List<Integer> status2 = new ArrayList<>();
        status2.add(-1);
        status2.add(1);
        status2.add(2);
        status2.add(4);
        List<TResultWorkEvaluate> list3 = tResultWorkEvaluateService.lambdaQuery().in(TResultWorkEvaluate::getDispatchId, collect8).list();
        int tempDetail3 = 0;
        for (TResultWorkEvaluate tResultWorkEvaluate : list3) {
            Integer evaluateOne = tResultWorkEvaluate.getEvaluateOne();
            switch (evaluateOne){
                case 1:
                    tempDetail3+=2;
                    break;
                case 2:
                    tempDetail3+=1;
                    break;
            }
            Integer evaluateTwo = tResultWorkEvaluate.getEvaluateTwo();
            switch (evaluateTwo){
                case 1:
                    tempDetail3+=2;
                    break;
                case 2:
                    tempDetail3+=1;
                    break;
            }
            Integer evaluateThree = tResultWorkEvaluate.getEvaluateThree();
            switch (evaluateThree){
                case 1:
                    tempDetail3+=2;
                    break;
                case 2:
                    tempDetail3+=1;
                    break;
            }
            Integer evaluateFour = tResultWorkEvaluate.getEvaluateFour();
            switch (evaluateFour){
                case 1:
                    tempDetail3+=2;
                    break;
                case 2:
                    tempDetail3+=1;
                    break;
            }
            Integer evaluateFive = tResultWorkEvaluate.getEvaluateFive();
            switch (evaluateFive){
                case 1:
                    tempDetail3+=2;
                    break;
                case 2:
                    tempDetail3+=1;
                    break;
            }
            Integer evaluateSix = tResultWorkEvaluate.getEvaluateSix();
            switch (evaluateSix){
                case 1:
                    tempDetail3-=3;
                    break;
            }
        }
        if (!list3.isEmpty()){
            tResultWorkEvaluateDetailEngineerVO3.setStartTime(list3.get(0).getEvaluateTime());
            tResultWorkEvaluateDetailEngineerVO3.setEndTime(list3.get(list3.size()-1).getEvaluateTime());
        }
        tResultWorkEvaluateDetailEngineerVO3.setCount(list3.size());
        tResultWorkEvaluateDetailEngineerVO3.setIntegral(tempDetail3);
        tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO3);
        // 验证试验阶段
        TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO4 = new TResultWorkEvaluateDetailEngineerVO();
        List<String> collect10 = list2.stream().filter(e -> e.getProjectStage().equals(2)).map(TProjectProposal::getId).collect(Collectors.toList());
        if (collect10.isEmpty()){
            collect10.add("0");
        }
        List<String> collect11 = experimentDispatchService.lambdaQuery().in(TExperimentDispatch::getProposalId, collect10)
                .ne(TExperimentDispatch::getStatus, -1)
                .ne(TExperimentDispatch::getStatus, 1).list().stream().map(TExperimentDispatch::getId).collect(Collectors.toList());
        if (collect11.isEmpty()){
            collect11.add("0");
        }
        List<TResultWorkEvaluate> list4 = tResultWorkEvaluateService.lambdaQuery().in(TResultWorkEvaluate::getDispatchId, collect11).list();
        int tempDetail4 = 0;
        for (TResultWorkEvaluate tResultWorkEvaluate : list4) {
            Integer evaluateOne = tResultWorkEvaluate.getEvaluateOne();
            switch (evaluateOne){
                case 1:
                    tempDetail4+=2;
                    break;
                case 2:
                    tempDetail4+=1;
                    break;
            }
            Integer evaluateTwo = tResultWorkEvaluate.getEvaluateTwo();
            switch (evaluateTwo){
                case 1:
                    tempDetail4+=2;
                    break;
                case 2:
                    tempDetail4+=1;
                    break;
            }
            Integer evaluateThree = tResultWorkEvaluate.getEvaluateThree();
            switch (evaluateThree){
                case 1:
                    tempDetail4+=2;
                    break;
                case 2:
                    tempDetail4+=1;
                    break;
            }
            Integer evaluateFour = tResultWorkEvaluate.getEvaluateFour();
            switch (evaluateFour){
                case 1:
                    tempDetail4+=2;
                    break;
                case 2:
                    tempDetail4+=1;
                    break;
            }
            Integer evaluateFive = tResultWorkEvaluate.getEvaluateFive();
            switch (evaluateFive){
                case 1:
                    tempDetail4+=2;
                    break;
                case 2:
                    tempDetail4+=1;
                    break;
            }
            Integer evaluateSix = tResultWorkEvaluate.getEvaluateSix();
            switch (evaluateSix){
                case 1:
                    tempDetail4-=3;
                    break;
            }
        }
        if (!list4.isEmpty()){
            tResultWorkEvaluateDetailEngineerVO4.setStartTime(list4.get(0).getEvaluateTime());
            tResultWorkEvaluateDetailEngineerVO4.setEndTime(list4.get(list4.size()-1).getEvaluateTime());
        }
        tResultWorkEvaluateDetailEngineerVO4.setCount(list4.size());
        tResultWorkEvaluateDetailEngineerVO4.setIntegral(tempDetail4);
        tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO4);
        // 工艺开发工具
        TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO5 = new TResultWorkEvaluateDetailEngineerVO();
        List<TFeasibilityStudyReport> collect12 = total.stream().filter(e -> e.getReportType().equals(3)).collect(Collectors.toList());
        int  tempDetail15= 0 ;
        for (TFeasibilityStudyReport tFeasibilityStudyReport : collect12) {
            if (StringUtils.hasLength(tFeasibilityStudyReport.getEvaluateScore())){
                for (String s : tFeasibilityStudyReport.getEvaluateScore().split(",")) {
                    tempDetail15+=Integer.parseInt(s);
                }
            }
        }
        tResultWorkEvaluateDetailEngineerVO5.setCount(collect12.size());
        tResultWorkEvaluateDetailEngineerVO5.setIntegral(tempDetail15);
        if (!collect12.isEmpty()){
            tResultWorkEvaluateDetailEngineerVO5.setStartTime(collect12.get(0).getEvaluateTime());
            tResultWorkEvaluateDetailEngineerVO5.setEndTime(collect12.get(collect12.size()-1).getEvaluateTime());
        }
        tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO5);
        // 验证与发布
        TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO6 = new TResultWorkEvaluateDetailEngineerVO();
        List<TFeasibilityStudyReport> collect13 = total.stream().filter(e -> e.getReportType().equals(3)).collect(Collectors.toList());
        int  tempDetail16= 0 ;
        for (TFeasibilityStudyReport tFeasibilityStudyReport : collect13) {
            if (StringUtils.hasLength(tFeasibilityStudyReport.getEvaluateScore())){
                for (String s : tFeasibilityStudyReport.getEvaluateScore().split(",")) {
                    tempDetail16+=Integer.parseInt(s);
                }
            }
        }
        tResultWorkEvaluateDetailEngineerVO6.setCount(collect13.size());
        tResultWorkEvaluateDetailEngineerVO6.setIntegral(tempDetail16);
        if (!collect13.isEmpty()){
            tResultWorkEvaluateDetailEngineerVO6.setStartTime(collect13.get(0).getEvaluateTime());
            tResultWorkEvaluateDetailEngineerVO6.setEndTime(collect13.get(collect13.size()-1).getEvaluateTime());
        }
        tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO6);
        // 立项报告
        List<TProjectApprovalReport> list5 = projectApprovalReportService.lambdaQuery().orderByDesc(BaseModel::getCreateTime).eq(TProjectApprovalReport::getTeamId, projectTeam.getId()).eq(TProjectApprovalReport::getStatus, 2).list();
        TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO7 = new TResultWorkEvaluateDetailEngineerVO();
        tResultWorkEvaluateDetailEngineerVO7.setCount(list5.size());
        if (!list5.isEmpty()){
            tResultWorkEvaluateDetailEngineerVO7.setEndTime(list5.get(list5.size()-1).getAuditTime());
        }
        tResultWorkEvaluateDetailEngineerVO7.setStartTime(projectTeam.getCreateTime());
        tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO7);
        // todo 临床试验积分
        List<TClinicalTrialPoints> list6 = clinicalTrialPointsService.lambdaQuery().eq(TClinicalTrialPoints::getTeamId, projectTeam.getId()).list();
        TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO8 = new TResultWorkEvaluateDetailEngineerVO();
        tResultWorkEvaluateDetailEngineerVO8.setCount(list6.size());
        if (!list6.isEmpty()){
            tResultWorkEvaluateDetailEngineerVO8.setEndTime(list6.get(list6.size()-1).getCreateTime());
        }
        tResultWorkEvaluateDetailEngineerVO8.setStartTime(projectTeam.getCreateTime());
        tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO8);
        tResultWorkEvaluateDetailVO.setEngineerList(tResultWorkEvaluateDetailEngineerVOS);
        return R.ok(tResultWorkEvaluateDetailVO);
    }
    @ApiOperation(value = "查看详情-左侧数据-化验师工作内容评定")
    @GetMapping(value = "/open/t-result-work-evaluate/getDetailByIdLeftTwo")
    public R<TResultWorkEvaluateDetailVO> getDetailByIdLeftTwo(@RequestParam String id) {
        TResultWorkEvaluateDetailVO tResultWorkEvaluateDetailVO = new TResultWorkEvaluateDetailVO();
        TResultWorkEvaluate resultWorkEvaluate = tResultWorkEvaluateService.getById(id);
        TProjectTeam projectTeam = projectTeamService.getById(resultWorkEvaluate.getTeamId());
        TProjectTeamStaff one = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).eq(TProjectTeamStaff::getRoleType, 3).last("limit 1")
                .one();
        tResultWorkEvaluateDetailVO.setStartTime(projectTeam.getCreateTime());
        List<Long> role5 = projectTeamStaffService.lambdaQuery()
                .eq(TProjectTeamStaff::getRoleType, 5).eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).list()
                .stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList());
        List<SysUser> user5 = new ArrayList<>();
        for (Long l : role5) {
            SysUser sysUser = sysUserService.selectUserById(l);
            if (sysUser != null) {
                user5.add(sysUser);
            }
        }
        Long userId = one.getUserId();
        List<TFeasibilityStudyReport> total = feasibilityStudyReportService.lambdaQuery()
                .eq(TFeasibilityStudyReport::getStatus,3)
                .eq(TFeasibilityStudyReport::getEvaluatePersonId, userId).list();
        List<TResultWorkEvaluateDetailEngineerVO> tResultWorkEvaluateDetailEngineerVOS = new ArrayList<>();
        // 开发阶段
        TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO2 = new TResultWorkEvaluateDetailEngineerVO();
        List<Integer> status = new ArrayList<>();
        status.add(-1);
        status.add(1);
ruoyi-system/src/main/java/com/ruoyi/system/query/TResultWorkEvaluateQuery.java
@@ -9,7 +9,7 @@
import java.util.List;
@Data
@ApiModel(value = "实验员工作评定管理分页query")
@ApiModel(value = "项目组总积分分页query")
public class TResultWorkEvaluateQuery extends TimeRangeQueryBody {
    @ApiModelProperty(value = "项目组名称")