| | |
| | | experimentDispatchTask.setDispatchId(dto.getId()); |
| | | }); |
| | | experimentDispatchTaskService.saveBatch(experimentDispatchTasks); |
| | | // MESSAGE 添加消息 |
| | | if(!dto.getStatus().equals(-1)){ |
| | | experimentDispatchParticipants.stream().filter(e->e.getRoleType().equals(4)).forEach(teamStaff -> { |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【实验调度】等待确认", tokenService.getLoginUser().getUser().getNickName(),11); |
| | | }); |
| | | experimentDispatchParticipants.stream().filter(e->e.getRoleType().equals(5)).forEach(teamStaff -> { |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【实验调度】等待确认", tokenService.getLoginUser().getUser().getNickName(),14); |
| | | }); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | // 修改实验结果工作评价 |
| | | List<TResultWorkEvaluate> resultWorkEvaluates = dto.getResultWorkEvaluates(); |
| | | resultWorkEvaluateService.saveOrUpdateBatch(resultWorkEvaluates); |
| | | // 获取当前用户的项目组id |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId)); |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId()); |
| | | if(dto.getStatus() != -1){ |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 2) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【实验结果汇报】等待评定", tokenService.getLoginUser().getUser().getNickName(),3); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | query.setRoleType(roleType); |
| | | if (roleType != 1){ |
| | | query.setUserId(userId); |
| | | // 查询实验参与人员 |
| | | List<TExperimentDispatchParticipants> experimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class) |
| | | .eq(TExperimentDispatchParticipants::getUserId, userId)); |
| | | if(!CollectionUtils.isEmpty(experimentDispatchParticipants)){ |
| | | List<String> dispatchIds = experimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getDispatchId).distinct().collect(Collectors.toList()); |
| | | query.setDispatchIds(dispatchIds); |
| | | if(roleType ==2){ |
| | | // 查询项目组 |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId)); |
| | | // 查询项目的工艺工程师id |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeamStaff.getTeamId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 3) |
| | | .last("LIMIT 1")); |
| | | // 查询实验参与人员 |
| | | List<TExperimentDispatchParticipants> experimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class) |
| | | .eq(TExperimentDispatchParticipants::getUserId, teamStaff.getUserId())); |
| | | if(!CollectionUtils.isEmpty(experimentDispatchParticipants)){ |
| | | List<String> dispatchIds = experimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getDispatchId).distinct().collect(Collectors.toList()); |
| | | query.setDispatchIds(dispatchIds); |
| | | } |
| | | }else { |
| | | // 查询实验参与人员 |
| | | List<TExperimentDispatchParticipants> experimentDispatchParticipants = experimentDispatchParticipantsService.list(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class) |
| | | .eq(TExperimentDispatchParticipants::getUserId, userId)); |
| | | if(!CollectionUtils.isEmpty(experimentDispatchParticipants)){ |
| | | List<String> dispatchIds = experimentDispatchParticipants.stream().map(TExperimentDispatchParticipants::getDispatchId).distinct().collect(Collectors.toList()); |
| | | query.setDispatchIds(dispatchIds); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(experimentSchemeService.auditPageList(query)); |
| | |
| | | import com.ruoyi.system.dto.AuditStatusDTO; |
| | | import com.ruoyi.system.dto.TFeasibilityStudyReportDTO; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.model.TFeasibilityReportFile; |
| | | import com.ruoyi.system.model.TFeasibilityStudyReport; |
| | | import com.ruoyi.system.model.TProjectTeam; |
| | | import com.ruoyi.system.model.TProjectTeamStaff; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TFeasibilityStudyReportQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TFeasibilityStudyReportVO; |
| | |
| | | .eq(TProjectTeamStaff::getRoleType, 2) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【可研报告】/【可行报告】/【工艺开发工具】/【验证与发布】/【立项报告库】等待审核", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | // TFeasibilityStudyReport feasibilityStudyReport = feasibilityStudyReportService.getById(dto.getId()); |
| | | Integer reportType = dto.getReportType(); |
| | | switch (reportType) { |
| | | case 1: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【可研报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | break; |
| | | case 2: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【可行报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | break; |
| | | case 3: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【工艺开发工具】等待评定", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | break; |
| | | case 4: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【验证与发布】等待评定", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | |
| | | } |
| | | } |
| | | feasibilityReportFileService.saveBatch(feasibilityReportFiles); |
| | | // 通过当前用户查询项目组 |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId()); |
| | | if(dto.getStatus() != -1){ |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 2) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | TFeasibilityStudyReport feasibilityStudyReport = feasibilityStudyReportService.getById(dto.getId()); |
| | | Integer reportType = feasibilityStudyReport.getReportType(); |
| | | switch (reportType) { |
| | | case 1: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【可研报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | break; |
| | | case 2: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【可行报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | break; |
| | | case 3: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【工艺开发工具】等待评定", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | break; |
| | | case 4: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【验证与发布】等待评定", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | feasibilityStudyReport.setAuditTime(LocalDateTime.now()); |
| | | feasibilityStudyReportService.updateById(feasibilityStudyReport); |
| | | // MESSAGE 添加消息 |
| | | noticeService.saveNotice(userId, "您有【1】条【可研报告】/【可行报告】/【工艺开发工具】/【验证与发布】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | |
| | | Integer reportType = feasibilityStudyReport.getReportType(); |
| | | switch (reportType) { |
| | | case 1: |
| | | noticeService.saveNotice(userId, "您有【1】条【可研报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | break; |
| | | case 2: |
| | | noticeService.saveNotice(userId, "您有【1】条【可行报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | break; |
| | | case 3: |
| | | noticeService.saveNotice(userId, "您有【1】条【工艺开发工具】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | break; |
| | | case 4: |
| | | noticeService.saveNotice(userId, "您有【1】条【验证与发布】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | public R<Boolean> update(@RequestBody String param) { |
| | | TInspectionReportDTO dto = JSON.parseObject(param,TInspectionReportDTO.class); |
| | | inspectionReportService.updateById(dto); |
| | | if(dto.getStatus() != -1){ |
| | | // 通过当前用户查询项目组 |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId()); |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 3) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | noticeService.saveNotice(teamStaff.getUserId(), "化验师已提交检验报告,请查收!", tokenService.getLoginUser().getUser().getNickName(),7); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | List<TNotice> list = noticeService.list(Wrappers.lambdaQuery(TNotice.class) |
| | | .eq(TNotice::getUserId, userId) |
| | | .eq(TNotice::getIsRead, 0)); |
| | | .eq(TNotice::getIsRead, 0) |
| | | .orderByDesc(TNotice::getCommitTime)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | .eq(TProjectTeamStaff::getRoleType, 2) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【可研报告】/【可行报告】/【工艺开发工具】/【验证与发布】/【立项报告库】等待审核", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【立项报告库】等待审核", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | } |
| | | |
| | | return R.ok(); |
| | |
| | | feasibilityReportFile.setReportType(FeasibilityReportFileEnum.PROJECT_PROPOSAL.getCode()); |
| | | } |
| | | feasibilityReportFileService.saveBatch(feasibilityReportFiles); |
| | | } |
| | | if(dto.getStatus() != -1){ |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId()); |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 2) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【立项报告库】等待审核", tokenService.getLoginUser().getUser().getNickName(),4); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | projectApprovalReport.setAuditPersonId(userId); |
| | | projectApprovalReport.setAuditTime(LocalDateTime.now()); |
| | | projectApprovalReportService.updateById(projectApprovalReport); |
| | | |
| | | // MESSAGE 添加消息 |
| | | noticeService.saveNotice(userId, "您有【1】条【立项报告库】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | public R<Boolean> update(@RequestBody String param) { |
| | | TProjectProposalDTO dto = JSON.parseObject(param,TProjectProposalDTO.class); |
| | | projectProposalService.updateById(dto); |
| | | if(dto.getAuditStatus() != -1){ |
| | | // 通过当前用户查询项目组 |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId()); |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 2) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【项目课题方案】等待审批", tokenService.getLoginUser().getUser().getNickName(),1); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | .eq(TProjectTeamStaff::getRoleType, 3) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【项目检测项、检验包列表】/【中试、生产验证试验检验分析报告】/【原辅料、包材、竞品检验分析报告】/【产品报批及项目工作总结报告】等待审核", tokenService.getLoginUser().getUser().getNickName(),9); |
| | | Integer reportType = dto.getReportType(); |
| | | switch (reportType) { |
| | | case 1: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【中试、生产验证分析报告】等待审核", tokenService.getLoginUser().getUser().getNickName(),9); |
| | | break; |
| | | case 2: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【辅料报告】等待审核", tokenService.getLoginUser().getUser().getNickName(),9); |
| | | break; |
| | | case 3: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【产品报告】等待审核", tokenService.getLoginUser().getUser().getNickName(),9); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | |
| | | } |
| | | } |
| | | qaReportFileService.saveBatch(qaReportFiles); |
| | | |
| | | |
| | | if(dto.getStatus() != -1){ |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(dto.getTeamId()); |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 3) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | TQaProduceReport qaProduceReport = qaProduceReportService.getById(dto.getId()); |
| | | Integer reportType = qaProduceReport.getReportType(); |
| | | switch (reportType) { |
| | | case 1: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【中试、生产验证分析报告】等待审核", tokenService.getLoginUser().getUser().getNickName(),9); |
| | | break; |
| | | case 2: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【辅料报告】等待审核", tokenService.getLoginUser().getUser().getNickName(),9); |
| | | break; |
| | | case 3: |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【产品报告】等待审核", tokenService.getLoginUser().getUser().getNickName(),9); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | qaProduceReportService.updateById(qaProduceReport); |
| | | |
| | | // MESSAGE 添加消息 |
| | | noticeService.saveNotice(userId, "您有【1】条【项目检测项、检验包列表】/【中试、生产验证试验检验分析报告】/【原辅料、包材、竞品检验分析报告】/【产品报批及项目工作总结报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),10); |
| | | Integer reportType = qaProduceReport.getReportType(); |
| | | switch (reportType) { |
| | | case 1: |
| | | noticeService.saveNotice(userId, "您有【1】条【中试、生产验证分析报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | break; |
| | | case 2: |
| | | noticeService.saveNotice(userId, "您有【1】条【辅料报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | break; |
| | | case 3: |
| | | noticeService.saveNotice(userId, "您有【1】条【产品报告】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | |
| | | import com.ruoyi.system.model.TQaTestItem; |
| | | import com.ruoyi.system.model.TQaTestItemReport; |
| | | import com.ruoyi.system.query.TQaTestItemQuery; |
| | | import com.ruoyi.system.service.TProjectTeamService; |
| | | import com.ruoyi.system.service.TProjectTeamStaffService; |
| | | import com.ruoyi.system.service.TQaTestItemReportService; |
| | | import com.ruoyi.system.service.TQaTestItemService; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TProjectTeamVO; |
| | | import com.ruoyi.system.vo.TQaTestItemReportVO; |
| | | import com.ruoyi.system.vo.TQaTestItemVO; |
| | |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | private final SysUserMapper sysUserMapper; |
| | | private final TNoticeService noticeService; |
| | | @Autowired |
| | | public TQaTestItemController(TQaTestItemService qaTestItemService, TQaTestItemReportService qaTestItemReportService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, SysUserMapper sysUserMapper) { |
| | | public TQaTestItemController(TQaTestItemService qaTestItemService, TQaTestItemReportService qaTestItemReportService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, SysUserMapper sysUserMapper, TNoticeService noticeService) { |
| | | this.qaTestItemService = qaTestItemService; |
| | | this.qaTestItemReportService = qaTestItemReportService; |
| | | this.tokenService = tokenService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | this.sysUserMapper = sysUserMapper; |
| | | this.noticeService = noticeService; |
| | | } |
| | | |
| | | /** |
| | |
| | | public R<Boolean> add(@RequestBody String param) { |
| | | TQaTestItemDTO dto = JSON.parseObject(param,TQaTestItemDTO.class); |
| | | qaTestItemService.save(dto); |
| | | |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(dto.getTeamId()); |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 3) |
| | | .last("LIMIT 1")); |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【项目检测项、检验包列表】等待审核", tokenService.getLoginUser().getUser().getNickName(),9); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | public R<Boolean> update(@RequestBody String param) { |
| | | TQaTestItemDTO dto = JSON.parseObject(param,TQaTestItemDTO.class); |
| | | qaTestItemService.updateById(dto); |
| | | |
| | | if (dto.getStatus() != -1) { |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(dto.getTeamId()); |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 3) |
| | | .last("LIMIT 1")); |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【项目检测项、检验包列表】等待审核", tokenService.getLoginUser().getUser().getNickName(),9); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.AuditStatusDTO; |
| | | import com.ruoyi.system.dto.TQaTestItemReportDTO; |
| | | 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.model.*; |
| | | import com.ruoyi.system.query.TQaTestItemReportQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TQaTestItemReportVO; |
| | |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | private final ISysUserService sysUserService; |
| | | private final TQaTestItemService qaTestItemService; |
| | | private final TNoticeService noticeService; |
| | | @Autowired |
| | | public TQaTestItemReportController(TQaTestItemReportService qaTestItemReportService, TQaReportFileService qaReportFileService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, ISysUserService sysUserService) { |
| | | public TQaTestItemReportController(TQaTestItemReportService qaTestItemReportService, TQaReportFileService qaReportFileService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, ISysUserService sysUserService, TQaTestItemService qaTestItemService, TNoticeService noticeService) { |
| | | this.qaTestItemReportService = qaTestItemReportService; |
| | | this.qaReportFileService = qaReportFileService; |
| | | this.tokenService = tokenService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | this.sysUserService = sysUserService; |
| | | this.qaTestItemService = qaTestItemService; |
| | | this.noticeService = noticeService; |
| | | } |
| | | |
| | | /** |
| | |
| | | testItemReport.setAuditPersonId(userId); |
| | | testItemReport.setAuditTime(LocalDateTime.now()); |
| | | qaTestItemReportService.updateById(testItemReport); |
| | | |
| | | // 查询检测项 |
| | | TQaTestItem testItem = qaTestItemService.getById(testItemReport.getItemId()); |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(testItem.getTeamId()); |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 3) |
| | | .last("LIMIT 1")); |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【项目检测项、检验包列表】等待评定", tokenService.getLoginUser().getUser().getNickName(),5); |
| | | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | 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") |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).eq(TProjectTeamStaff::getRoleType, 3).last("limit 1") |
| | | .one(); |
| | | TProjectTeamStaff projectTeamStaff1 = projectTeamStaffService.lambdaQuery().eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).eq(TProjectTeamStaff::getRoleType, 2).last("limit 1") |
| | | .one(); |
| | | tResultWorkEvaluateDetailVO.setStartTime(projectTeam.getCreateTime()); |
| | | Long userId = one.getUserId(); |
| | | |
| | | Long userId = projectTeamStaff.getUserId(); |
| | | Long auditUserId = projectTeamStaff1.getUserId(); |
| | | List<TFeasibilityStudyReport> total = feasibilityStudyReportService.lambdaQuery() |
| | | .eq(TFeasibilityStudyReport::getStatus, 3) |
| | | .eq(TFeasibilityStudyReport::getEvaluatePersonId, userId).list(); |
| | | .eq(TFeasibilityStudyReport::getEvaluatePersonId, auditUserId).list(); |
| | | List<TResultWorkEvaluateDetailEngineerVO> tResultWorkEvaluateDetailEngineerVOS = new ArrayList<>(); |
| | | // 工艺可研 |
| | | TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO = new TResultWorkEvaluateDetailEngineerVO(); |
| | |
| | | tResultWorkEvaluateDetailEngineerVO.setIntegral(tempDetail); |
| | | if (!collect.isEmpty()) { |
| | | tResultWorkEvaluateDetailEngineerVO.setEndTime(collect.get(collect.size() - 1).getEvaluateTime()); |
| | | tResultWorkEvaluateDetailEngineerVO.setStartTime(projectTeam.getCreateTime()); |
| | | } |
| | | tResultWorkEvaluateDetailEngineerVO.setStartTime(projectTeam.getCreateTime()); |
| | | |
| | | tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO); |
| | | // 工艺可行 |
| | |
| | | tResultWorkEvaluateDetailEngineerVO8.setStartTime(list6.get(0).getCreateTime()); |
| | | tResultWorkEvaluateDetailEngineerVO8.setEndTime(list6.get(list6.size() - 1).getCreateTime()); |
| | | } |
| | | tResultWorkEvaluateDetailEngineerVO8.setIntegral(list6.get(0).getEvaluateScore()); |
| | | tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO8); |
| | | tResultWorkEvaluateDetailVO.setEngineerList(tResultWorkEvaluateDetailEngineerVOS); |
| | | return R.ok(tResultWorkEvaluateDetailVO); |
| | |
| | | TProjectTeam projectTeam = projectTeamService.getById(resultWorkEvaluate.getTeamId()); |
| | | tResultWorkEvaluateDetailVO.setStartTime(projectTeam.getCreateTime()); |
| | | List<Long> role5 = projectTeamStaffService.lambdaQuery() |
| | | .eq(TProjectTeamStaff::getRoleType, 5).eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).list() |
| | | .eq(TProjectTeamStaff::getRoleType, 4).eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).list() |
| | | .stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList()); |
| | | List<SysUser> user5 = new ArrayList<>(); |
| | | SysUser sysUser1 = sysUserService.selectUserById(tokenService.getLoginUser().getUserId()); |
| | |
| | | tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO6); |
| | | // 产品 |
| | | TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO7 = new TResultWorkEvaluateDetailEngineerVO(); |
| | | List<TQaProduceReport> collect9 = list.stream().filter(e -> e.getReportType() == 1).collect(Collectors.toList()); |
| | | List<TQaProduceReport> collect9 = list.stream().filter(e -> e.getReportType() == 3).collect(Collectors.toList()); |
| | | if (!collect9.isEmpty()) { |
| | | tResultWorkEvaluateDetailEngineerVO7.setStartTime(collect9.get(0).getEvaluateTime()); |
| | | tResultWorkEvaluateDetailEngineerVO7.setEndTime(collect9.get(collect9.size() - 1).getEvaluateTime()); |
| | |
| | | TProjectTeam projectTeam = projectTeamService.getById(resultWorkEvaluate.getTeamId()); |
| | | tResultWorkEvaluateDetailVO.setStartTime(projectTeam.getCreateTime()); |
| | | List<Long> role5 = projectTeamStaffService.lambdaQuery() |
| | | .eq(TProjectTeamStaff::getRoleType, 4).eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).list() |
| | | .eq(TProjectTeamStaff::getRoleType, 5).eq(TProjectTeamStaff::getTeamId, resultWorkEvaluate.getTeamId()).list() |
| | | .stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList()); |
| | | List<SysUser> user5 = new ArrayList<>(); |
| | | SysUser sysUser1 = sysUserService.selectUserById(tokenService.getLoginUser().getUserId()); |
| | |
| | | TResultWorkEvaluateDetailEngineerVO tResultWorkEvaluateDetailEngineerVO5 = new TResultWorkEvaluateDetailEngineerVO(); |
| | | tResultWorkEvaluateDetailEngineerVO5.setCount(list.size()); |
| | | if (!list.isEmpty()) { |
| | | tResultWorkEvaluateDetailEngineerVO5.setStartTime(list.get(0).getEvaluateTime()); |
| | | tResultWorkEvaluateDetailEngineerVO5.setEndTime(list.get(list.size() - 1).getEvaluateTime()); |
| | | tResultWorkEvaluateDetailEngineerVO5.setStartTime(list.get(0).getCreateTime()); |
| | | tResultWorkEvaluateDetailEngineerVO5.setEndTime(list.get(list.size() - 1).getCreateTime()); |
| | | |
| | | } |
| | | int temp = 0; |
| | |
| | | temp += tTesterOtherTask.getEvaluateScore(); |
| | | } |
| | | tResultWorkEvaluateDetailEngineerVO5.setIntegral(temp); |
| | | tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO4); |
| | | tResultWorkEvaluateDetailEngineerVOS.add(tResultWorkEvaluateDetailEngineerVO5); |
| | | tResultWorkEvaluateDetailUserVO.setList(tResultWorkEvaluateDetailEngineerVOS); |
| | | tResultWorkEvaluateDetailUserVOS.add(tResultWorkEvaluateDetailUserVO); |
| | | } |
| | |
| | | } |
| | | } |
| | | if(roleType == 4){ |
| | | // 查询检验报告 |
| | | List<TInspectionReport> inspectionReports = inspectionReportService.list(Wrappers.lambdaQuery(TInspectionReport.class) |
| | | .eq(TInspectionReport::getStatus, 1)); |
| | | if (!CollectionUtils.isEmpty(inspectionReports)) { |
| | | List<String> dispatchIds = inspectionReports.stream().map(TInspectionReport::getDispatchId).distinct().collect(Collectors.toList()); |
| | | List<String> dispatchIds1 = query.getDispatchIds(); |
| | | Iterator<String> iterator = dispatchIds1.iterator(); |
| | | while (iterator.hasNext()) { |
| | | String next = iterator.next(); |
| | | if (!dispatchIds.contains(next)) { |
| | | iterator.remove(); |
| | | // 查询当前用户所在的项目组 |
| | | List<TProjectTeamStaff> projectTeamStaffs = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId)); |
| | | if (!CollectionUtils.isEmpty(projectTeamStaffs)) { |
| | | List<String> teamIds = projectTeamStaffs.stream().map(TProjectTeamStaff::getTeamId).distinct().collect(Collectors.toList()); |
| | | List<TProjectProposal> projectProposals = projectProposalService.list(Wrappers.lambdaQuery(TProjectProposal.class) |
| | | .in(TProjectProposal::getTeamId, teamIds)); |
| | | if (!CollectionUtils.isEmpty(projectProposals)) { |
| | | List<String> projectIds = projectProposals.stream().map(TProjectProposal::getId).collect(Collectors.toList()); |
| | | List<TExperimentDispatch> experimentDispatches = experimentDispatchService.list(Wrappers.lambdaQuery(TExperimentDispatch.class) |
| | | .in(TExperimentDispatch::getProposalId, projectIds)); |
| | | if (!CollectionUtils.isEmpty(experimentDispatches)) { |
| | | List<String> dispatchIds2 = experimentDispatches.stream().map(TExperimentDispatch::getId).collect(Collectors.toList()); |
| | | // 查询检验报告 |
| | | List<TInspectionReport> inspectionReports = inspectionReportService.list(Wrappers.lambdaQuery(TInspectionReport.class) |
| | | .eq(TInspectionReport::getStatus, 2) |
| | | .in(TInspectionReport::getDispatchId, dispatchIds2)); |
| | | if (!CollectionUtils.isEmpty(inspectionReports)) { |
| | | List<String> dispatchIds = inspectionReports.stream().map(TInspectionReport::getDispatchId).distinct().collect(Collectors.toList()); |
| | | List<String> dispatchIds1 = query.getDispatchIds(); |
| | | Iterator<String> iterator = dispatchIds1.iterator(); |
| | | while (iterator.hasNext()) { |
| | | String next = iterator.next(); |
| | | if (dispatchIds.contains(next)) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | // if(CollectionUtils.isEmpty(dispatchIds1)){ |
| | | // List<String> id = new ArrayList<>(); |
| | | // id.add("-1"); |
| | | // query.setDispatchIds(id); |
| | | // }else { |
| | | query.setDispatchIds(dispatchIds1); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | if(CollectionUtils.isEmpty(dispatchIds1)){ |
| | | List<String> id = new ArrayList<>(); |
| | | id.add("-1"); |
| | | query.setDispatchIds(id); |
| | | }else { |
| | | query.setDispatchIds(dispatchIds1); |
| | | } |
| | | } |
| | | } |
| | |
| | | public R<Boolean> update(@RequestBody String param) { |
| | | TTestMethodConfirmSheetDTO dto = JSON.parseObject(param,TTestMethodConfirmSheetDTO.class); |
| | | testMethodConfirmSheetService.updateById(dto); |
| | | List<TTestMethodConfirmSheetTerm> list = testMethodConfirmSheetTermService.list(Wrappers.lambdaQuery(TTestMethodConfirmSheetTerm.class) |
| | | .eq(TTestMethodConfirmSheetTerm::getTestId, dto.getId())); |
| | | if(!CollectionUtils.isEmpty(list)){ |
| | | List<String> termIds = list.stream().map(TTestMethodConfirmSheetTerm::getId).collect(Collectors.toList()); |
| | | // 删除原始检验记录 |
| | | testMethodConfirmSheetOriginalService.remove(Wrappers.lambdaQuery(TTestMethodConfirmSheetOriginal.class) |
| | | .in(TTestMethodConfirmSheetOriginal::getTermId, termIds)); |
| | | } |
| | | testMethodConfirmSheetTermService.remove(Wrappers.lambdaQuery(TTestMethodConfirmSheetTerm.class).eq(TTestMethodConfirmSheetTerm::getTestId,dto.getId())); |
| | | List<TTestMethodConfirmSheetTerm> testMethodConfirmSheetTerms = dto.getTestMethodConfirmSheetTerms(); |
| | | testMethodConfirmSheetTerms.forEach(testMethodConfirmSheetTerm -> { |
| | |
| | | testMethodConfirmSheetTerm.setStatus(1); |
| | | }); |
| | | testMethodConfirmSheetTermService.saveBatch(testMethodConfirmSheetTerms); |
| | | // 查询调度的参与人员 |
| | | TExperimentDispatchParticipants experimentDispatchParticipant = experimentDispatchParticipantsService.getOne(Wrappers.lambdaQuery(TExperimentDispatchParticipants.class) |
| | | .eq(TExperimentDispatchParticipants::getDispatchId, dto.getDispatchId()) |
| | | .eq(TExperimentDispatchParticipants::getRoleType,3) |
| | | .last("LIMIT 1")); |
| | | // 查询工艺工程师所在的项目组 |
| | | TProjectTeamStaff projectTeamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, experimentDispatchParticipant.getUserId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 3) |
| | | .last("LIMIT 1")); |
| | | // 查询项目组 |
| | | TProjectTeam projectTeam = projectTeamService.getById(projectTeamStaff.getTeamId()); |
| | | // 生成原始记录编号 |
| | | String format = new SimpleDateFormat("yyyyMMdd").format(new Date()); |
| | | String originalCode = projectTeam.getTeamName() + format.substring(2) + "-JL"; |
| | | for (TTestMethodConfirmSheetTerm testMethodConfirmSheetTerm : testMethodConfirmSheetTerms) { |
| | | // 添加原始记录 |
| | | TTestMethodConfirmSheetOriginal testMethodConfirmSheetOriginal = new TTestMethodConfirmSheetOriginal(); |
| | | testMethodConfirmSheetOriginal.setTermId(testMethodConfirmSheetTerm.getId()); |
| | | // 查询上个项目课题方案的序号 |
| | | long count = testMethodConfirmSheetOriginalService.count(Wrappers.lambdaQuery(TTestMethodConfirmSheetOriginal.class) |
| | | .like(TTestMethodConfirmSheetOriginal::getOriginalCode, originalCode)); |
| | | originalCode = originalCode + String.format("%02d", count+1); |
| | | testMethodConfirmSheetOriginal.setOriginalCode(originalCode); |
| | | testMethodConfirmSheetOriginal.setStatus(1); |
| | | testMethodConfirmSheetOriginalService.save(testMethodConfirmSheetOriginal); |
| | | } |
| | | |
| | | if (dto.getAuditStatus() != -1){ |
| | | // MESSAGE 添加消息 |
| | | TProjectTeamStaff teamStaff = projectTeamStaffService.getOne(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getTeamId, projectTeam.getId()) |
| | | .eq(TProjectTeamStaff::getRoleType, 3) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(teamStaff)){ |
| | | noticeService.saveNotice(teamStaff.getUserId(), "您有【1】条【检验方法确认单】等待审批", tokenService.getLoginUser().getUser().getNickName(),6); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @PutMapping(value = "/open/t-test-method-confirm-sheet/revokedSheet") |
| | | public R<Boolean> revokedSheet(@RequestParam String id) { |
| | | TTestMethodConfirmSheet testMethodConfirmSheet = testMethodConfirmSheetService.getById(id); |
| | | testMethodConfirmSheet.setAuditStatus(QATestItemReportStatusEnum.REVOKED.getCode()); |
| | | testMethodConfirmSheet.setAuditStatus(QATestItemReportStatusEnum.DRAFTS.getCode()); |
| | | testMethodConfirmSheetService.updateById(testMethodConfirmSheet); |
| | | return R.ok(); |
| | | } |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | private final TTestMethodConfirmSheetOriginalDataService testMethodConfirmSheetOriginalDataService; |
| | | private final TTestMethodConfirmSheetTermService testMethodConfirmSheetTermService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TExperimentDispatchParticipantsService experimentDispatchParticipantsService; |
| | | private final TInspectionReportService inspectionReportService; |
| | | private final TExperimentDispatchService experimentDispatchService; |
| | | private final TProjectProposalService projectProposalService; |
| | | @Autowired |
| | | public TTestMethodConfirmSheetOriginalController(TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TTestMethodConfirmSheetOriginalService testMethodConfirmSheetOriginalService, TTestMethodConfirmSheetOriginalDataService testMethodConfirmSheetOriginalDataService, TTestMethodConfirmSheetTermService testMethodConfirmSheetTermService, TProjectTeamStaffService projectTeamStaffService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService, TInspectionReportService inspectionReportService) { |
| | | public TTestMethodConfirmSheetOriginalController(TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TTestMethodConfirmSheetOriginalService testMethodConfirmSheetOriginalService, TTestMethodConfirmSheetOriginalDataService testMethodConfirmSheetOriginalDataService, TTestMethodConfirmSheetTermService testMethodConfirmSheetTermService, TProjectTeamStaffService projectTeamStaffService, TProjectTeamService projectTeamService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService, TInspectionReportService inspectionReportService, TExperimentDispatchService experimentDispatchService, TProjectProposalService projectProposalService) { |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | | this.sysUserMapper = sysUserMapper; |
| | |
| | | this.testMethodConfirmSheetOriginalDataService = testMethodConfirmSheetOriginalDataService; |
| | | this.testMethodConfirmSheetTermService = testMethodConfirmSheetTermService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.experimentDispatchParticipantsService = experimentDispatchParticipantsService; |
| | | this.inspectionReportService = inspectionReportService; |
| | | this.experimentDispatchService = experimentDispatchService; |
| | | this.projectProposalService = projectProposalService; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | if(roleType == 4){ |
| | | // 查询检验报告 |
| | | List<TInspectionReport> inspectionReports = inspectionReportService.list(Wrappers.lambdaQuery(TInspectionReport.class) |
| | | .eq(TInspectionReport::getStatus, 1)); |
| | | if (!CollectionUtils.isEmpty(inspectionReports)) { |
| | | List<String> dispatchIds = inspectionReports.stream().map(TInspectionReport::getDispatchId).distinct().collect(Collectors.toList()); |
| | | List<String> dispatchIds1 = query.getDispatchIds(); |
| | | Iterator<String> iterator = dispatchIds1.iterator(); |
| | | while (iterator.hasNext()) { |
| | | String next = iterator.next(); |
| | | if (!dispatchIds.contains(next)) { |
| | | iterator.remove(); |
| | | // 查询当前用户所在的项目组 |
| | | List<TProjectTeamStaff> projectTeamStaffs = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class) |
| | | .eq(TProjectTeamStaff::getUserId, userId)); |
| | | if (!CollectionUtils.isEmpty(projectTeamStaffs)) { |
| | | List<String> teamIds = projectTeamStaffs.stream().map(TProjectTeamStaff::getTeamId).distinct().collect(Collectors.toList()); |
| | | List<TProjectProposal> projectProposals = projectProposalService.list(Wrappers.lambdaQuery(TProjectProposal.class) |
| | | .in(TProjectProposal::getTeamId, teamIds)); |
| | | if (!CollectionUtils.isEmpty(projectProposals)) { |
| | | List<String> projectIds = projectProposals.stream().map(TProjectProposal::getId).collect(Collectors.toList()); |
| | | List<TExperimentDispatch> experimentDispatches = experimentDispatchService.list(Wrappers.lambdaQuery(TExperimentDispatch.class) |
| | | .in(TExperimentDispatch::getProposalId, projectIds)); |
| | | if (!CollectionUtils.isEmpty(experimentDispatches)) { |
| | | List<String> dispatchIds2 = experimentDispatches.stream().map(TExperimentDispatch::getId).collect(Collectors.toList()); |
| | | // 查询检验报告 |
| | | List<TInspectionReport> inspectionReports = inspectionReportService.list(Wrappers.lambdaQuery(TInspectionReport.class) |
| | | .eq(TInspectionReport::getStatus, 2) |
| | | .in(TInspectionReport::getDispatchId, dispatchIds2)); |
| | | if (!CollectionUtils.isEmpty(inspectionReports)) { |
| | | List<String> dispatchIds = inspectionReports.stream().map(TInspectionReport::getDispatchId).distinct().collect(Collectors.toList()); |
| | | List<String> dispatchIds1 = query.getDispatchIds(); |
| | | Iterator<String> iterator = dispatchIds1.iterator(); |
| | | while (iterator.hasNext()) { |
| | | String next = iterator.next(); |
| | | if (dispatchIds.contains(next)) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | // if(CollectionUtils.isEmpty(dispatchIds1)){ |
| | | // List<String> id = new ArrayList<>(); |
| | | // id.add("-1"); |
| | | // query.setDispatchIds(id); |
| | | // }else { |
| | | query.setDispatchIds(dispatchIds1); |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | if(CollectionUtils.isEmpty(dispatchIds1)){ |
| | | List<String> id = new ArrayList<>(); |
| | | id.add("-1"); |
| | | query.setDispatchIds(id); |
| | | }else { |
| | | query.setDispatchIds(dispatchIds1); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginBody; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.SysLoginService; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.web.controller.tool.MsgUtils; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginBody; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.SysLoginService; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 登录验证 |
| | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "账号密码登录",notes = "账号密码登录") |
| | | @PostMapping("/login") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) |
| | | @PostMapping("/api/login") |
| | | public AjaxResult login(@RequestBody String param) |
| | | { |
| | | LoginBody loginBody = JSON.parseObject(param, LoginBody.class); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUser loginUser = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), |
| | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8081 |
| | | port: 11221 |
| | | servlet: |
| | | # 应用的访问路径 |
| | | context-path: / |
| | |
| | | public AjaxResult loginCode(@RequestBody LoginBody loginBody) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUserApplet loginUser = loginService.loginCodeApplet(loginBody.getUsername(), loginBody.getCode()); |
| | | ajax.put(Constants.TOKEN, tokenService.createTokenApplet(loginUser)); |
| | | ajax.put("userInfo",loginUser); |
| | | return ajax; |
| | | } |
| | | |
| | |
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问 |
| | | .antMatchers("/getPrivacyAgreement/{agreementType}", |
| | | "/applet/queryProtocolConfigByType","/applet/login", |
| | | "/login","/applet/queryProtocolConfigByType", |
| | | "/api/login","/applet/queryProtocolConfigByType", |
| | | "/register","/applet/getCode","/applet/loginCode", |
| | | "/applet/changepwd", "/captchaImage","/getCode","/loginCode", |
| | | "/operations/getBySingleNum/**", |
| | |
| | | |
| | | @ApiModelProperty(value = "评定积分") |
| | | @TableField("evaluate_score") |
| | | private Double evaluateScore; |
| | | private Integer evaluateScore; |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.system.dto.SysRoleDTO; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.query.SysRoleQuery; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | |
| | | import com.ruoyi.system.domain.SysRoleDept; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.dto.SysRoleDTO; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.query.SysRoleQuery; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 角色 业务层处理 |
| | |
| | | public List<SysMenu> getMenuLevelList(List<Long> menusId) { |
| | | //获取当前的权限菜单 |
| | | List<SysMenu> all = menuMapper.getAllInIds(menusId); |
| | | // 第三级 |
| | | List<SysMenu> s3 = all.stream().filter(e -> e.getMenuType().equals("F")).collect(Collectors.toList()); |
| | | // 第二级 |
| | | List<SysMenu> s2 = all.stream().filter(e -> e.getMenuType().equals("C")).collect(Collectors.toList()); |
| | | List<SysMenu> collect4 = all.stream().filter(e -> e.getParentId() != null).collect(Collectors.toList()); |
| | | // 第一级 |
| | | List<SysMenu> s1 = all.stream().filter(e -> e.getMenuType().equals("M")).collect(Collectors.toList()); |
| | | |
| | | for (SysMenu menu : s2) { |
| | | List<SysMenu> collect = s3.stream().filter(e -> e.getParentId().equals(menu.getMenuId())).collect(Collectors.toList()); |
| | | menu.setChildren(collect); |
| | | } |
| | | for (SysMenu menu : s1) { |
| | | List<SysMenu> collect = s2.stream().filter(e -> e.getParentId().equals(menu.getMenuId())).collect(Collectors.toList()); |
| | | List<SysMenu> collect = collect4.stream().filter(e -> e.getParentId().equals(menu.getMenuId())).collect(Collectors.toList()); |
| | | for (SysMenu sysMenu : collect) { |
| | | List<SysMenu> collect1 = collect4.stream().filter(e -> e.getParentId().equals(sysMenu.getMenuId())).collect(Collectors.toList()); |
| | | for (SysMenu sysMenu1 : collect1) { |
| | | List<SysMenu> collect2 = collect4.stream().filter(e -> e.getParentId().equals(sysMenu1.getMenuId())).collect(Collectors.toList()); |
| | | for (SysMenu sysMenu2 : collect2) { |
| | | List<SysMenu> collect3 = collect4.stream().filter(e -> e.getParentId().equals(sysMenu2.getMenuId())).collect(Collectors.toList()); |
| | | sysMenu2.setChildren(collect3); |
| | | } |
| | | sysMenu1.setChildren(collect2); |
| | | } |
| | | sysMenu.setChildren(collect1); |
| | | } |
| | | menu.setChildren(collect); |
| | | } |
| | | return s1; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.TQaProduceReportMapper; |
| | | import com.ruoyi.system.model.TQaProduceReport; |
| | | import com.ruoyi.system.query.TQaProduceReportQuery; |
| | | import com.ruoyi.system.service.TQaProduceReportService; |
| | | import com.ruoyi.system.vo.TQaProduceReportVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TQaProduceReportServiceImpl extends ServiceImpl<TQaProduceReportMapper, TQaProduceReport> implements TQaProduceReportService { |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public PageInfo<TQaProduceReportVO> pageList(TQaProduceReportQuery query) { |
| | | PageInfo<TQaProduceReportVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | |
| | | public PageInfo<TQaProduceReportVO> evaluateList(TQaProduceReportQuery query) { |
| | | PageInfo<TQaProduceReportVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TQaProduceReportVO> list = this.baseMapper.evaluateList(query,pageInfo); |
| | | if (CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | List<Long> evaluatePersonIds = list.stream().map(TQaProduceReportVO::getEvaluatePersonId).collect(Collectors.toList()); |
| | | List<SysUser> sysUsers = sysUserMapper.selectUserByIds(evaluatePersonIds); |
| | | for (TQaProduceReportVO tQaProduceReportVO : list) { |
| | | sysUsers.stream().filter(sysUser -> sysUser.getUserId().equals(tQaProduceReportVO.getEvaluatePersonId())).forEach(sysUser -> { |
| | | tQaProduceReportVO.setEvaluatePersonName(sysUser.getNickName()); |
| | | }); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public PageInfo<TTestMethodConfirmSheetOriginalVO> pageList(TTestMethodConfirmSheetOriginalQuery query) { |
| | | // |
| | | PageInfo<TTestMethodConfirmSheetOriginalVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TTestMethodConfirmSheetOriginalVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | |
| | | #{teamId} |
| | | </foreach> |
| | | </if> |
| | | AND tfsr.status in (1,2,3) |
| | | AND tfsr.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tfsr.create_time DESC |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from t_qa_test_item_report |
| | | where item_id = #{itemId} |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | order by create_time desc |
| | | </select> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TQaTestItemReportVO"> |
| | |
| | | <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> |
| | | AND ttmcso.status != -1 |
| | | AND ttmcso.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY ttmcso.create_time DESC |