| | |
| | | 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.uuid.IdUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.ExperimentDispatchSignDTO; |
| | | import com.ruoyi.system.dto.TExperimentDispatchDTO; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.model.TExperimentDispatch; |
| | | import com.ruoyi.system.model.TExperimentDispatchGroup; |
| | | import com.ruoyi.system.model.TExperimentDispatchParticipants; |
| | | import com.ruoyi.system.model.TExperimentDispatchTask; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TExperimentDispatchQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TExperimentDispatchVO; |
| | |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final TExperimentDispatchGroupService experimentDispatchGroupService; |
| | | private final TExperimentDispatchParticipantsService experimentDispatchParticipantsService; |
| | | private final TExperimentDispatchTaskService experimentDispatchTaskService; |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | @Autowired |
| | | public TExperimentDispatchController(TExperimentDispatchService experimentDispatchService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TExperimentDispatchGroupService experimentDispatchGroupService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService, TExperimentDispatchTaskService experimentDispatchTaskService) { |
| | | public TExperimentDispatchController(TExperimentDispatchService experimentDispatchService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TExperimentDispatchGroupService experimentDispatchGroupService, TExperimentDispatchParticipantsService experimentDispatchParticipantsService, TExperimentDispatchTaskService experimentDispatchTaskService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) { |
| | | this.experimentDispatchService = experimentDispatchService; |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | |
| | | this.experimentDispatchGroupService = experimentDispatchGroupService; |
| | | this.experimentDispatchParticipantsService = experimentDispatchParticipantsService; |
| | | this.experimentDispatchTaskService = experimentDispatchTaskService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | } |
| | | |
| | | /** |
| | | * 获取实验调度管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:experimentDispatch:list')") |
| | | @ApiOperation(value = "获取实验调度分页列表") |
| | | @ApiOperation(value = "获取实验调度分页列表",response = TExperimentDispatchQuery.class) |
| | | @PostMapping(value = "/api/t-experiment-dispatch/pageList") |
| | | public R<PageInfo<TExperimentDispatchVO>> pageList(@RequestBody String param) { |
| | | TExperimentDispatchQuery query = JSON.parseObject(param, TExperimentDispatchQuery.class); |
| | |
| | | @PostMapping(value = "/api/t-experiment-dispatch/add") |
| | | public R<Boolean> add(@RequestBody String param) { |
| | | TExperimentDispatchDTO dto = JSON.parseObject(param,TExperimentDispatchDTO.class); |
| | | // TODO 生成实验调度编号 |
| | | // 通过当前用户查询项目组 |
| | | 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 experimentCode = projectTeam.getTeamName() + "-EX"; |
| | | |
| | | // 查询上个项目课题方案的序号 |
| | | long count = experimentDispatchService.count(Wrappers.lambdaQuery(TExperimentDispatch.class) |
| | | .like(TExperimentDispatch::getExperimentCode, experimentCode)); |
| | | experimentCode = experimentCode + String.format("%03d", count+1);; |
| | | dto.setExperimentCode(experimentCode); |
| | | |
| | | experimentDispatchService.save(dto); |
| | | // 添加实验分组 |
| | | List<TExperimentDispatchGroup> experimentDispatchGroups = dto.getExperimentDispatchGroups(); |
| | |
| | | * 获取实验结果汇报管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:experimentResultReport:list')") |
| | | @ApiOperation(value = "获取实验结果汇报分页列表") |
| | | @ApiOperation(value = "获取实验结果汇报分页列表",response = TExperimentResultReportQuery.class) |
| | | @PostMapping(value = "/api/t-experiment-result-report/pageList") |
| | | public R<PageInfo<TExperimentResultReportVO>> pageList(@RequestBody String param) { |
| | | TExperimentResultReportQuery query = JSON.parseObject(param, TExperimentResultReportQuery.class); |
| | |
| | | import com.ruoyi.system.dto.TestMethodConfirmSheetSignDTO; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TExperimentResultReportQuery; |
| | | import com.ruoyi.system.query.TExperimentSchemeQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TExperimentSchemeVO; |
| | |
| | | * 获取实验方案管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:testMethodConfirmSheet:list')") |
| | | @ApiOperation(value = "获取实验方案分页列表") |
| | | @ApiOperation(value = "获取实验方案分页列表",response = TExperimentSchemeQuery.class) |
| | | @PostMapping(value = "/api/t-experiment-scheme/pageList") |
| | | public R<PageInfo<TExperimentSchemeVO>> pageList(@RequestBody String param) { |
| | | TExperimentSchemeQuery query = JSON.parseObject(param, TExperimentSchemeQuery.class); |
| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.FeasibilityStudyReportStatusEnum; |
| | | import com.ruoyi.common.enums.FeasibilityReportFileEnum; |
| | | import com.ruoyi.common.enums.*; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.AuditStatusDTO; |
| | | import com.ruoyi.system.dto.TFeasibilityStudyReportDTO; |
| | | import com.ruoyi.system.model.TFeasibilityReportFile; |
| | | import com.ruoyi.system.model.TFeasibilityStudyReport; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TFeasibilityStudyReportQuery; |
| | | import com.ruoyi.system.service.TFeasibilityReportFileService; |
| | | import com.ruoyi.system.service.TFeasibilityStudyReportService; |
| | | import com.ruoyi.system.service.TProjectTeamService; |
| | | import com.ruoyi.system.service.TProjectTeamStaffService; |
| | | import com.ruoyi.system.vo.TFeasibilityStudyReportVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final TFeasibilityStudyReportService feasibilityStudyReportService; |
| | | private final TFeasibilityReportFileService feasibilityReportFileService; |
| | | private final TokenService tokenService; |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | @Autowired |
| | | public TFeasibilityStudyReportController(TFeasibilityStudyReportService feasibilityStudyReportService, TFeasibilityReportFileService feasibilityReportFileService, TokenService tokenService) { |
| | | public TFeasibilityStudyReportController(TFeasibilityStudyReportService feasibilityStudyReportService, TFeasibilityReportFileService feasibilityReportFileService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) { |
| | | this.feasibilityStudyReportService = feasibilityStudyReportService; |
| | | this.feasibilityReportFileService = feasibilityReportFileService; |
| | | this.tokenService = tokenService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | } |
| | | |
| | | /** |
| | | * 获取可研、可行、工艺开发工具、验证发布报告管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:feasibilityStudyReport:list')") |
| | | @ApiOperation(value = "获取可研、可行、工艺开发工具、验证发布报告管理分页列表") |
| | | @ApiOperation(value = "获取可研、可行、工艺开发工具、验证发布报告管理分页列表",response = TFeasibilityStudyReportQuery.class) |
| | | @PostMapping(value = "/api/t-feasibility-study-report/pageList") |
| | | public R<PageInfo<TFeasibilityStudyReportVO>> pageList(@RequestBody String param) { |
| | | TFeasibilityStudyReportQuery query = JSON.parseObject(param, TFeasibilityStudyReportQuery.class); |
| | |
| | | @PostMapping(value = "/api/t-feasibility-study-report/add") |
| | | public R<Boolean> add(@RequestBody String param) { |
| | | TFeasibilityStudyReportDTO dto = JSON.parseObject(param,TFeasibilityStudyReportDTO.class); |
| | | // TODO 生成编号 |
| | | // 通过当前用户查询项目组 |
| | | 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 = ""; |
| | | switch (dto.getReportType()){ |
| | | case 1: |
| | | reportCode = projectTeam.getTeamName() + "-" + StudyReportTypeEnum.FEASIBILITY_STUDY_REPORT.getCode(); |
| | | break; |
| | | case 2: |
| | | reportCode = projectTeam.getTeamName() + "-" + StudyReportTypeEnum.FEASIBLE_REPORT.getCode(); |
| | | break; |
| | | case 3: |
| | | reportCode = projectTeam.getTeamName() + "-" + StudyReportTypeEnum.PROCESS_DEVELOPMENT_TOOLS.getCode(); |
| | | break; |
| | | default: |
| | | reportCode = projectTeam.getTeamName() + "-" + StudyReportTypeEnum.VERIFICATION_RELEASE.getCode(); |
| | | break; |
| | | } |
| | | |
| | | // 查询上个项目课题方案的序号 |
| | | long count = feasibilityStudyReportService.count(Wrappers.lambdaQuery(TFeasibilityStudyReport.class) |
| | | .like(TFeasibilityStudyReport::getReportCode, reportCode)); |
| | | reportCode = reportCode + "-" + String.format("%03d", count+1); |
| | | dto.setReportCode(reportCode); |
| | | |
| | | feasibilityStudyReportService.save(dto); |
| | | // 添加检测报告文件 |
| | | List<TFeasibilityReportFile> feasibilityReportFiles = dto.getFeasibilityReportFiles(); |
| | |
| | | * 获取检验报告管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:inspectionReport:list')") |
| | | @ApiOperation(value = "获取检验报告分页列表") |
| | | @ApiOperation(value = "获取检验报告分页列表", response = TInspectionReportQuery.class) |
| | | @PostMapping(value = "/api/t-inspection-report/pageList") |
| | | public R<PageInfo<TInspectionReportVO>> pageList(@RequestBody String param) { |
| | | TInspectionReportQuery query = JSON.parseObject(param, TInspectionReportQuery.class); |
| | |
| | | |
| | | |
| | | 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.ProjectStageEnum; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.AuditStatusDTO; |
| | | import com.ruoyi.system.dto.TProjectProposalDTO; |
| | | import com.ruoyi.system.dto.UpAndDownDTO; |
| | | import com.ruoyi.system.model.TProjectProposal; |
| | | import com.ruoyi.system.model.TProjectTeam; |
| | | import com.ruoyi.system.model.TProjectTeamStaff; |
| | | import com.ruoyi.system.query.TProjectProposalQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TProjectProposalService; |
| | | import com.ruoyi.system.service.TProjectTeamService; |
| | | import com.ruoyi.system.service.TProjectTeamStaffService; |
| | | import com.ruoyi.system.vo.TProjectProposalVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private final TProjectProposalService projectProposalService; |
| | | private final TokenService tokenService; |
| | | private final ISysUserService sysUserService; |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | @Autowired |
| | | public TProjectProposalController(TProjectProposalService projectProposalService, TokenService tokenService, ISysUserService sysUserService) { |
| | | public TProjectProposalController(TProjectProposalService projectProposalService, TokenService tokenService, ISysUserService sysUserService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) { |
| | | this.projectProposalService = projectProposalService; |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | } |
| | | |
| | | /** |
| | | * 获取项目课题方案管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:projectProposal:list')") |
| | | @ApiOperation(value = "获取项目课题方案分页列表") |
| | | @ApiOperation(value = "获取项目课题方案分页列表", response = TProjectProposalQuery.class) |
| | | @PostMapping(value = "/api/t-project-proposal/pageList") |
| | | public R<PageInfo<TProjectProposalVO>> pageList(@RequestBody String param) { |
| | | TProjectProposalQuery query = JSON.parseObject(param, TProjectProposalQuery.class); |
| | |
| | | @PostMapping(value = "/api/t-project-proposal/add") |
| | | public R<Boolean> add(@RequestBody String param) { |
| | | TProjectProposalDTO dto = JSON.parseObject(param,TProjectProposalDTO.class); |
| | | // TODO 生成项目课题方案编号 |
| | | |
| | | // 通过当前用户查询项目组 |
| | | 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 projectProposalNo = ""; |
| | | switch (dto.getProjectStage()){ |
| | | case 1: |
| | | projectProposalNo = projectTeam.getTeamName() + "-" + ProjectStageEnum.DEVELOPMENT_PHASE.getCode(); |
| | | break; |
| | | case 2: |
| | | projectProposalNo = projectTeam.getTeamName() + "-" + ProjectStageEnum.CHINESE_STYLE_EXPERIMENT.getCode(); |
| | | break; |
| | | case 3: |
| | | projectProposalNo = projectTeam.getTeamName() + "-" + ProjectStageEnum.PRODUCTION_VALIDATION.getCode(); |
| | | break; |
| | | } |
| | | |
| | | // 查询上个项目课题方案的序号 |
| | | long count = projectProposalService.count(Wrappers.lambdaQuery(TProjectProposal.class) |
| | | .like(TProjectProposal::getProjectCode, projectProposalNo)); |
| | | projectProposalNo = projectProposalNo + String.format("%02d", count+1); |
| | | dto.setProjectCode(projectProposalNo); |
| | | |
| | | projectProposalService.save(dto); |
| | | return R.ok(); |
| | | } |
| | |
| | | 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.system.dto.TProjectTeamDTO; |
| | | import com.ruoyi.system.dto.UpAndDownDTO; |
| | | import com.ruoyi.system.model.TProjectTeam; |
| | | import com.ruoyi.system.model.TProjectTeamStaff; |
| | | import com.ruoyi.system.query.TProjectProposalQuery; |
| | | import com.ruoyi.system.query.TProjectTeamQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TProjectTeamService; |
| | | import com.ruoyi.system.service.TProjectTeamStaffService; |
| | | import com.ruoyi.system.vo.TProjectTeamVO; |
| | |
| | | |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | private final ISysUserService sysUserService; |
| | | @Autowired |
| | | public TProjectTeamController(TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) { |
| | | public TProjectTeamController(TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService, ISysUserService sysUserService) { |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | | * 获取项目组管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:projectTeam:list')") |
| | | @ApiOperation(value = "获取项目组分页列表") |
| | | @ApiOperation(value = "获取项目组分页列表",response = TProjectTeamQuery.class) |
| | | @PostMapping(value = "/api/t-project-team/pageList") |
| | | public R<PageInfo<TProjectTeamVO>> pageList(@RequestBody String param) { |
| | | TProjectTeamQuery query = JSON.parseObject(param, TProjectTeamQuery.class); |
| | | return R.ok(projectTeamService.pageList(query)); |
| | | PageInfo<TProjectTeamVO> tProjectTeamVOPageInfo = projectTeamService.pageList(query); |
| | | return R.ok(tProjectTeamVOPageInfo); |
| | | } |
| | | |
| | | /** |
| | |
| | | TProjectTeamVO projectTeamVO = new TProjectTeamVO(); |
| | | BeanUtils.copyProperties(projectTeam, projectTeamVO); |
| | | // 查询项目组人员 |
| | | projectTeamVO.setStaffs(projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class).eq(TProjectTeamStaff::getTeamId, id))); |
| | | List<TProjectTeamStaff> list = projectTeamStaffService.list(Wrappers.lambdaQuery(TProjectTeamStaff.class).eq(TProjectTeamStaff::getTeamId, id)); |
| | | // 查询所有人员 |
| | | List<SysUser> sysUsers = sysUserService.selectList(); |
| | | for (TProjectTeamStaff tProjectTeamStaff : list) { |
| | | sysUsers.stream().filter(sysUser -> sysUser.getUserId().equals(tProjectTeamStaff.getUserId())).forEach(sysUser -> { |
| | | tProjectTeamStaff.setNickName(sysUser.getNickName()); |
| | | tProjectTeamStaff.setAvatar(sysUser.getAvatar()); |
| | | }); |
| | | } |
| | | projectTeamVO.setStaffs(list); |
| | | return R.ok(projectTeamVO); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.QAProduceReportStatusEnum; |
| | | import com.ruoyi.common.enums.QaReportFileEnum; |
| | | import com.ruoyi.common.enums.*; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.AuditStatusDTO; |
| | | import com.ruoyi.system.dto.TQaProduceReportDTO; |
| | | import com.ruoyi.system.model.TQaProduceReport; |
| | | import com.ruoyi.system.model.TQaReportFile; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TQaProduceReportQuery; |
| | | import com.ruoyi.system.service.TProjectTeamService; |
| | | import com.ruoyi.system.service.TProjectTeamStaffService; |
| | | import com.ruoyi.system.service.TQaProduceReportService; |
| | | import com.ruoyi.system.service.TQaReportFileService; |
| | | import com.ruoyi.system.vo.TQaProduceReportVO; |
| | |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final TQaProduceReportService qaProduceReportService; |
| | | private final TQaReportFileService qaReportFileService; |
| | | private final TokenService tokenService; |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | @Autowired |
| | | public TQaProduceReportController(TQaProduceReportService qaProduceReportService, TQaReportFileService qaReportFileService, TokenService tokenService) { |
| | | public TQaProduceReportController(TQaProduceReportService qaProduceReportService, TQaReportFileService qaReportFileService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) { |
| | | this.qaProduceReportService = qaProduceReportService; |
| | | this.qaReportFileService = qaReportFileService; |
| | | this.tokenService = tokenService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | } |
| | | |
| | | /** |
| | | * 获取中试、生产验证分析报告;辅料;产品报告管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaProduceReport:list')") |
| | | @ApiOperation(value = "获取中试、生产验证分析报告;辅料;产品报告管理分页列表") |
| | | @ApiOperation(value = "获取中试、生产验证分析报告;辅料;产品报告管理分页列表", response = TQaProduceReportQuery.class) |
| | | @PostMapping(value = "/api/t-qa-produce-report/pageList") |
| | | public R<PageInfo<TQaProduceReportVO>> pageList(@RequestBody String param) { |
| | | TQaProduceReportQuery query = JSON.parseObject(param, TQaProduceReportQuery.class); |
| | |
| | | @PostMapping(value = "/api/t-qa-produce-report/add") |
| | | public R<Boolean> add(@RequestBody String param) { |
| | | TQaProduceReportDTO dto = JSON.parseObject(param,TQaProduceReportDTO.class); |
| | | // TODO 生成编号 |
| | | // 通过当前用户查询项目组 |
| | | 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 = ""; |
| | | switch (dto.getReportType()){ |
| | | case 1: |
| | | reportCode = projectTeam.getTeamName() + "-" + QaReportTypeEnum.TEST_PILOT.getCode(); |
| | | break; |
| | | case 2: |
| | | reportCode = projectTeam.getTeamName() + "-" + QaReportTypeEnum.PRODUCTION_VERIFICATION_ANALYSIS_REPORT.getCode(); |
| | | break; |
| | | default: |
| | | reportCode = projectTeam.getTeamName() + "-" + QaReportTypeEnum.AUXILIARY_MATERIALS.getCode(); |
| | | break; |
| | | } |
| | | |
| | | // 查询上个项目课题方案的序号 |
| | | long count = qaProduceReportService.count(Wrappers.lambdaQuery(TQaProduceReport.class) |
| | | .like(TQaProduceReport::getReportCode, reportCode)); |
| | | reportCode = reportCode + "-" + String.format("%03d", count+1); |
| | | dto.setReportCode(reportCode); |
| | | qaProduceReportService.save(dto); |
| | | // 添加检测报告文件 |
| | | List<TQaReportFile> qaReportFiles = dto.getQaReportFiles(); |
| | |
| | | * 获取QA检测项管理管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaTestItem:list')") |
| | | @ApiOperation(value = "获取QA检测项管理分页列表") |
| | | @ApiOperation(value = "获取QA检测项管理分页列表", response = TQaTestItemQuery.class) |
| | | @PostMapping(value = "/api/t-qa-test-item/pageList") |
| | | public R<PageInfo<TQaTestItemVO>> pageList(@RequestBody String param) { |
| | | TQaTestItemQuery query = JSON.parseObject(param, TQaTestItemQuery.class); |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.QATestItemReportStatusEnum; |
| | | import com.ruoyi.common.enums.QaReportFileEnum; |
| | | import com.ruoyi.common.enums.QaReportTypeEnum; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.AuditStatusDTO; |
| | | import com.ruoyi.system.dto.TQaTestItemReportDTO; |
| | | import com.ruoyi.system.mapper.TQaReportFileMapper; |
| | | import com.ruoyi.system.model.TProjectProposal; |
| | | 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.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 java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final TQaTestItemReportService qaTestItemReportService; |
| | | private final TQaReportFileService qaReportFileService; |
| | | private final TokenService tokenService; |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | @Autowired |
| | | public TQaTestItemReportController(TQaTestItemReportService qaTestItemReportService, TQaReportFileService qaReportFileService, TokenService tokenService) { |
| | | public TQaTestItemReportController(TQaTestItemReportService qaTestItemReportService, TQaReportFileService qaReportFileService, TokenService tokenService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) { |
| | | this.qaTestItemReportService = qaTestItemReportService; |
| | | this.qaReportFileService = qaReportFileService; |
| | | this.tokenService = tokenService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | } |
| | | |
| | | /** |
| | | * 获取QA检测项报告管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:qaTestItemReport:list')") |
| | | @ApiOperation(value = "获取QA检测项报告管理分页列表-工艺工程师使用") |
| | | @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); |
| | |
| | | @PostMapping(value = "/api/t-qa-test-item-report/add") |
| | | public R<Boolean> add(@RequestBody String param) { |
| | | TQaTestItemReportDTO dto = JSON.parseObject(param,TQaTestItemReportDTO.class); |
| | | // TODO 生成编号 |
| | | // 通过当前用户查询项目组 |
| | | 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() + "-" + 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(); |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.QaReportTypeEnum; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.*; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | private final ISysUserService sysUserService; |
| | | private final SysUserMapper sysUserMapper; |
| | | private final TSamplingRecordOperationService samplingRecordOperationService; |
| | | private final TExperimentDispatchService experimentDispatchService; |
| | | private final TProjectProposalService projectProposalService; |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | @Autowired |
| | | public TSamplingRecordController(TSamplingRecordService samplingRecordService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TSamplingRecordOperationService samplingRecordOperationService) { |
| | | public TSamplingRecordController(TSamplingRecordService samplingRecordService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TSamplingRecordOperationService samplingRecordOperationService, TExperimentDispatchService experimentDispatchService, TProjectProposalService projectProposalService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) { |
| | | this.samplingRecordService = samplingRecordService; |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | | this.sysUserMapper = sysUserMapper; |
| | | this.samplingRecordOperationService = samplingRecordOperationService; |
| | | this.experimentDispatchService = experimentDispatchService; |
| | | this.projectProposalService = projectProposalService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | } |
| | | |
| | | /** |
| | | * 获取取样记录管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:samplingRecord:list')") |
| | | @ApiOperation(value = "获取取样记录分页列表") |
| | | @ApiOperation(value = "获取取样记录分页列表", response = TSamplingRecordQuery.class) |
| | | @PostMapping(value = "/api/t-sampling-record/pageList") |
| | | public R<PageInfo<TSamplingRecordVO>> pageList(@RequestBody String param) { |
| | | TSamplingRecordQuery query = JSON.parseObject(param, TSamplingRecordQuery.class); |
| | |
| | | @PostMapping(value = "/api/t-sampling-record/add") |
| | | public R<Boolean> add(@RequestBody String param) { |
| | | TSamplingRecordDTO dto = JSON.parseObject(param,TSamplingRecordDTO.class); |
| | | // TODO 生成取样单编号 |
| | | |
| | | // 通过当前用户查询项目组 |
| | | 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 format = new SimpleDateFormat("yyyyMMdd").format(new Date()); |
| | | String samplingCode = projectTeam.getTeamName() + "-" + format.substring(2) + "S"; |
| | | |
| | | // 查询上个项目课题方案的序号 |
| | | long count = samplingRecordService.count(Wrappers.lambdaQuery(TSamplingRecord.class) |
| | | .like(TSamplingRecord::getSamplingCode, samplingCode)); |
| | | samplingCode = samplingCode + String.format("%02d", count+1); |
| | | dto.setSamplingCode(samplingCode); |
| | | |
| | | samplingRecordService.save(dto); |
| | | List<TSamplingRecordOperation> samplingRecordOperations = dto.getSamplingRecordOperations(); |
| | | samplingRecordOperations.forEach(samplingRecordOperation -> { |
| | |
| | | |
| | | // 查询取样操作记录 |
| | | samplingRecordVO.setSamplingRecordOperations(samplingRecordOperationService.list(Wrappers.lambdaQuery(TSamplingRecordOperation.class).eq(TSamplingRecordOperation::getSamplingId, id))); |
| | | |
| | | // 查询实验调度信息 |
| | | TExperimentDispatch experimentDispatch = experimentDispatchService.getById(samplingRecordVO.getDispatchId()); |
| | | if(Objects.nonNull(experimentDispatch)){ |
| | | // 查询课题方案名称 |
| | | TProjectProposal projectProposal = projectProposalService.getById(experimentDispatch.getProposalId()); |
| | | if(Objects.nonNull(projectProposal)){ |
| | | experimentDispatch.setProjectName(projectProposal.getProjectName()); |
| | | } |
| | | } |
| | | samplingRecordVO.setExperimentDispatch(experimentDispatch); |
| | | return R.ok(samplingRecordVO); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.system.dto.TTestMethodConfirmSheetDTO; |
| | | import com.ruoyi.system.dto.TestMethodConfirmSheetSignDTO; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.model.TTestMethodConfirmSheet; |
| | | import com.ruoyi.system.model.TTestMethodConfirmSheetOriginal; |
| | | import com.ruoyi.system.model.TTestMethodConfirmSheetTerm; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TTestMethodConfirmSheetQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TTestMethodConfirmSheetOriginalService; |
| | | import com.ruoyi.system.service.TTestMethodConfirmSheetService; |
| | | import com.ruoyi.system.service.TTestMethodConfirmSheetTermService; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TTestMethodConfirmSheetVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final SysUserMapper sysUserMapper; |
| | | private final TTestMethodConfirmSheetTermService testMethodConfirmSheetTermService; |
| | | private final TTestMethodConfirmSheetOriginalService testMethodConfirmSheetOriginalService; |
| | | private final TProjectTeamService projectTeamService; |
| | | private final TProjectTeamStaffService projectTeamStaffService; |
| | | @Autowired |
| | | public TTestMethodConfirmSheetController(TTestMethodConfirmSheetService testMethodConfirmSheetService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TTestMethodConfirmSheetTermService testMethodConfirmSheetTermService, TTestMethodConfirmSheetOriginalService testMethodConfirmSheetOriginalService) { |
| | | public TTestMethodConfirmSheetController(TTestMethodConfirmSheetService testMethodConfirmSheetService, TokenService tokenService, ISysUserService sysUserService, SysUserMapper sysUserMapper, TTestMethodConfirmSheetTermService testMethodConfirmSheetTermService, TTestMethodConfirmSheetOriginalService testMethodConfirmSheetOriginalService, TProjectTeamService projectTeamService, TProjectTeamStaffService projectTeamStaffService) { |
| | | this.testMethodConfirmSheetService = testMethodConfirmSheetService; |
| | | this.tokenService = tokenService; |
| | | this.sysUserService = sysUserService; |
| | | this.sysUserMapper = sysUserMapper; |
| | | this.testMethodConfirmSheetTermService = testMethodConfirmSheetTermService; |
| | | this.testMethodConfirmSheetOriginalService = testMethodConfirmSheetOriginalService; |
| | | this.projectTeamService = projectTeamService; |
| | | this.projectTeamStaffService = projectTeamStaffService; |
| | | } |
| | | |
| | | /** |
| | | * 获取检验方法确认单管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:testMethodConfirmSheet:list')") |
| | | @ApiOperation(value = "获取检验方法确认单分页列表") |
| | | @ApiOperation(value = "获取检验方法确认单分页列表",response = TTestMethodConfirmSheetQuery.class) |
| | | @PostMapping(value = "/api/t-test-method-confirm-sheet/pageList") |
| | | public R<PageInfo<TTestMethodConfirmSheetVO>> pageList(@RequestBody String param) { |
| | | TTestMethodConfirmSheetQuery query = JSON.parseObject(param, TTestMethodConfirmSheetQuery.class); |
| | |
| | | testMethodConfirmSheetTerm.setStatus(1); |
| | | }); |
| | | testMethodConfirmSheetTermService.saveBatch(testMethodConfirmSheetTerms); |
| | | List<TTestMethodConfirmSheetOriginal> testMethodConfirmSheetOriginals = new ArrayList<>(); |
| | | |
| | | // 通过当前用户查询项目组 |
| | | 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 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()); |
| | | // TODO 生成原始记录编号 |
| | | testMethodConfirmSheetOriginal.setOriginalCode(""); |
| | | // 查询上个项目课题方案的序号 |
| | | 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); |
| | | testMethodConfirmSheetOriginals.add(testMethodConfirmSheetOriginal); |
| | | testMethodConfirmSheetOriginalService.save(testMethodConfirmSheetOriginal); |
| | | } |
| | | testMethodConfirmSheetOriginalService.saveBatch(testMethodConfirmSheetOriginals); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | * 获取检验方法确认单管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:testMethodConfirmSheetOriginal:list')") |
| | | @ApiOperation(value = "获取检验方法确认单分页列表") |
| | | @ApiOperation(value = "获取检验方法确认单分页列表", notes = "获取检验方法确认单分页列表",response = TTestMethodConfirmSheetOriginalQuery.class) |
| | | @PostMapping(value = "/api/t-test-method-confirm-sheet-original/pageList") |
| | | public R<PageInfo<TTestMethodConfirmSheetOriginalVO>> pageList(@RequestBody String param) { |
| | | TTestMethodConfirmSheetOriginalQuery query = JSON.parseObject(param, TTestMethodConfirmSheetOriginalQuery.class); |
| | |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.system.dto.SysRoleDTO; |
| | | import com.ruoyi.system.query.SysRoleQuery; |
| | |
| | | */ |
| | | @Api(tags = "角色信息") |
| | | @RestController |
| | | @RequestMapping("/system/role") |
| | | @RequestMapping("") |
| | | public class SysRoleController extends BaseController |
| | | { |
| | | @Autowired |
| | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:role')") |
| | | @ApiOperation(value = "角色列表") |
| | | @PostMapping("/list") |
| | | @PostMapping("/system/role/list") |
| | | public AjaxResult list(@RequestBody SysRoleQuery query) |
| | | { |
| | | PageInfo<SysRole> list = roleService.selectPageList(query); |
| | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:role')") |
| | | @ApiOperation(value = "角色列表不分页") |
| | | @PostMapping("/listNotPage") |
| | | @PostMapping("/system/role/listNotPage") |
| | | public AjaxResult list() |
| | | { |
| | | List<SysRole> list = roleService.selectRoleList(new SysRole()); |
| | |
| | | } |
| | | @PreAuthorize("@ss.hasPermi('system:role:count')") |
| | | @ApiOperation(value = "角色数量统计") |
| | | @PostMapping("/roleCount") |
| | | @PostMapping("/system/role/roleCount") |
| | | public AjaxResult roleCount() |
| | | { |
| | | int all = roleService.selectCount(null); |
| | |
| | | * 根据角色编号获取详细信息 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/{roleId}") |
| | | @GetMapping(value = "/system/role/{roleId}") |
| | | public AjaxResult getInfo(@PathVariable Long roleId) |
| | | { |
| | | roleService.checkRoleDataScope(roleId); |
| | |
| | | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:detail')") |
| | | @ApiOperation("角色详情") |
| | | @GetMapping("/roleInfo") |
| | | @GetMapping("/system/role/roleInfo") |
| | | public AjaxResult roleInfo(@RequestParam Long roleId) |
| | | { |
| | | SysRole role = roleService.selectRoleById(roleId); |
| | |
| | | |
| | | |
| | | @ApiOperation("用户获取权限菜单") |
| | | @GetMapping("/roleInfoFromUserId") |
| | | @GetMapping("/system/role/roleInfoFromUserId") |
| | | public AjaxResult roleInfoFromUserId(@RequestParam Long userId) |
| | | { |
| | | return AjaxResult.success(roleService.roleInfoFromUserId(userId)); |
| | |
| | | /** |
| | | * 新增角色 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @ApiOperation(value = "新增角色") |
| | | @Log(title = "角色信息-新增角色", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @PostMapping("/system/role/add") |
| | | public AjaxResult add(@Validated @RequestBody SysRoleDTO dto) |
| | | { |
| | | Boolean flag= roleService.isExit(dto.getRoleId(),dto.getRoleName()); |
| | |
| | | /** |
| | | * 修改保存角色 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @ApiOperation(value = "编辑角色") |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @ApiOperation(value = "编辑角色",response = SysRoleDTO.class) |
| | | @Log(title = "角色信息-编辑角色", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysRoleDTO dto) |
| | | @PostMapping("/api/system/role/edit") |
| | | public R<String> edit(@RequestBody String param) |
| | | { |
| | | SysRoleDTO dto = JSON.parseObject(param, SysRoleDTO.class); |
| | | Boolean flag= roleService.isExit(dto.getRoleId(),dto.getRoleName()); |
| | | if (flag){ |
| | | return error("修改角色'" + dto.getRoleName() + "'失败,角色名称已存在"); |
| | | return R.fail("修改角色'" + dto.getRoleName() + "'失败,角色名称已存在"); |
| | | } |
| | | if (roleService.editRole(dto) > 0) |
| | | { |
| | |
| | | loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName())); |
| | | tokenService.setLoginUser(loginUser); |
| | | } |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | return error("修改角色'" + dto.getRoleName() + "'失败,请联系管理员"); |
| | | return R.fail("修改角色'" + dto.getRoleName() + "'失败,请联系管理员"); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | | @PutMapping("/system/role/dataScope") |
| | | public AjaxResult dataScope(@RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @ApiOperation(value = "状态修改") |
| | | @Log(title = "角色信息-角色状态修改", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | @PutMapping("/system/role/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysRole role) |
| | | { |
| | | role.setUpdateBy(getUsername()); |
| | |
| | | // @PreAuthorize("@ss.hasPermi('system:role:remove')") |
| | | @ApiOperation(value = "删除角色") |
| | | @Log(title = "角色信息-角色删除角色", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteById/{ids}") |
| | | @DeleteMapping("/system/role/deleteById/{ids}") |
| | | public AjaxResult remove(@PathVariable String ids) |
| | | { |
| | | String[] split = ids.split(","); |
| | |
| | | * 获取角色选择框列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping("/optionselect") |
| | | @GetMapping("/system/role/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | return AjaxResult.success(roleService.selectRoleAll()); |
| | |
| | | * 查询已分配用户角色列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/allocatedList") |
| | | @GetMapping("/system/role/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) |
| | | { |
| | | // startPage(); |
| | |
| | | * 查询未分配用户角色列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | @GetMapping("/system/role/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) |
| | | { |
| | | // startPage(); |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancel") |
| | | @PutMapping("/system/role/authUser/cancel") |
| | | public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) |
| | | { |
| | | return AjaxResult.success(roleService.deleteAuthUser(userRole)); |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancelAll") |
| | | @PutMapping("/system/role/authUser/cancelAll") |
| | | public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | return AjaxResult.success(roleService.deleteAuthUsers(roleId, userIds)); |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "角色管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/selectAll") |
| | | @PutMapping("/system/role/authUser/selectAll") |
| | | public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | roleService.checkRoleDataScope(roleId); |
| | |
| | | * 获取对应角色部门树列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | @GetMapping(value = "/system/role/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | |
| | | */ |
| | | @Api(tags = "用户信息") |
| | | @RestController |
| | | @RequestMapping("/system/user") |
| | | @RequestMapping("") |
| | | public class SysUserController extends BaseController |
| | | { |
| | | @Autowired |
| | |
| | | * 获取用户列表 |
| | | */ |
| | | @ApiOperation(value = "获取用户列表") |
| | | @PostMapping("/list") |
| | | @PostMapping("/system/user/list") |
| | | @PreAuthorize("@ss.hasPermi('system:user')") |
| | | public AjaxResult list(@RequestBody SysUserQuery query) |
| | | { |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户列表-不分页") |
| | | @PostMapping("/listNotPage") |
| | | @PostMapping("/system/user/listNotPage") |
| | | @PreAuthorize("@ss.hasPermi('system:user')") |
| | | |
| | | public AjaxResult listNotPage() |
| | |
| | | * 获取用户详情 |
| | | */ |
| | | @ApiOperation(value = "获取用户详情") |
| | | @GetMapping("/getDetail") |
| | | @GetMapping("/system/user/getDetail") |
| | | public AjaxResult getDetail(@RequestParam Long userId) |
| | | { |
| | | SysUser sysUser = userService.selectUserById(userId); |
| | |
| | | * 获取用户详情 |
| | | */ |
| | | @ApiOperation(value = "获取用户详情") |
| | | @GetMapping("/queryDetail") |
| | | @GetMapping("/system/user/queryDetail") |
| | | public AjaxResult queryDetail() |
| | | { |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | |
| | | * 获取用户数量统计 |
| | | */ |
| | | @ApiOperation(value = "获取用户数量统计") |
| | | @PostMapping("/getUserCount") |
| | | @PostMapping("/system/user/getUserCount") |
| | | public AjaxResult getUserCount() |
| | | { |
| | | Map<String,Integer> map = new HashMap<>(); |
| | |
| | | /** |
| | | * 移除黑名单 |
| | | */ |
| | | @GetMapping("/removeBlackList") |
| | | @GetMapping("/system/user/removeBlackList") |
| | | public AjaxResult removeBlackList(@RequestParam String ids) |
| | | { |
| | | String[] split = ids.split(","); |
| | |
| | | * 新增用户 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @ApiOperation(value = "新增用户管理") |
| | | @ApiOperation(value = "新增用户管理",response = SysUser.class) |
| | | @Log(title = "用户信息-新增用户", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) |
| | | @PostMapping("/api/system/user/add") |
| | | public R<String> add(@RequestBody String param) |
| | | { |
| | | SysUser user = JSON.parseObject(param,SysUser.class); |
| | | user.setUserName(user.getUserName()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | return R.fail("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword("123456")); |
| | | userService.insertUser(user); |
| | | return AjaxResult.success(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @ApiOperation(value = "修改用户管理") |
| | | @Log(title = "用户信息-修改用户", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@Validated @RequestBody SysUser user) |
| | | @PostMapping("/api/system/user/edit") |
| | | public R edit(@RequestBody String param) |
| | | { |
| | | SysUser user = JSON.parseObject(param,SysUser.class); |
| | | user.setUserName(user.getPhonenumber()); |
| | | // userService.checkUserAllowed(user); |
| | | // userService.checkUserDataScope(user.getUserId()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | return R.fail("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | return R.fail("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); |
| | | } |
| | | |
| | | user.setUpdateBy(getUsername()); |
| | | if(StringUtils.isNotEmpty(user.getPassword())){ |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | } |
| | | return AjaxResult.success(userService.updateUser(user)); |
| | | return R.ok(userService.updateUser(user)); |
| | | } |
| | | |
| | | /** |
| | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:remove')") |
| | | @ApiOperation(value = "批量删除用户") |
| | | @Log(title = "用户信息-批量删除用户", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/deleteById/{ids}") |
| | | @DeleteMapping("/system/user/deleteById/{ids}") |
| | | public AjaxResult remove(@PathVariable String ids) |
| | | { |
| | | String[] split = ids.split(","); |
| | |
| | | // @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | @ApiOperation(value = "重置密码") |
| | | @Log(title = "用户信息-重置密码", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/resetPwd") |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) |
| | | @PostMapping("/api/system/user/resetPwd") |
| | | public AjaxResult resetPwd(@RequestBody String param) |
| | | { |
| | | SysUser user = JSON.parseObject(param,SysUser.class); |
| | | userService.checkUserAllowed(user); |
| | | // userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | |
| | | */ |
| | | @ApiOperation(value = "状态修改") |
| | | @Log(title = "用户信息-状态修改", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | @PutMapping("/system/user/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysUserUpdateStatusDTO dto) |
| | | { |
| | | SysUser loginUser = tokenService.getLoginUser().getUser(); |
| | |
| | | * 根据用户编号获取授权角色 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping("/authRole/{userId}") |
| | | @GetMapping("/system/user/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long userId) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "用户管理", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | | @PutMapping("/system/user/authRole") |
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) |
| | | { |
| | | userService.checkUserDataScope(userId); |
| | |
| | | * 获取部门树列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/deptTree") |
| | | @GetMapping("/system/user/deptTree") |
| | | public AjaxResult deptTree(SysDept dept) |
| | | { |
| | | return AjaxResult.success(deptService.selectDeptTreeList(dept)); |
| | |
| | | * 新增执行 |
| | | */ |
| | | @ApiModelProperty(value = "记录创建人,前端忽略") |
| | | @JsonIgnore |
| | | @TableField(value = "create_by", fill = FieldFill.INSERT) |
| | | private String createBy; |
| | | |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.xss.Xss; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "用户新增编辑DTO") |
| | | public class SysUser extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | @TableField("business_dept_id") |
| | | private String businessDeptId; |
| | | |
| | | public Integer getRoleType() { |
| | | return roleType; |
| | | } |
| | | |
| | | public void setRoleType(Integer roleType) { |
| | | this.roleType = roleType; |
| | | } |
| | | |
| | | public String getRoleName() { |
| | | return roleName; |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName Disable |
| | | * @Description |
| | | * @date 2022-06-08 16:55 |
| | | */ |
| | | public enum ProjectStageEnum { |
| | | /*项目阶段 1=实验室开发阶段 2=中式试验阶段 3=生产验证试验阶段*/ |
| | | DEVELOPMENT_PHASE("LS", "实验室开发阶段"), |
| | | CHINESE_STYLE_EXPERIMENT("PS", "中式试验阶段"), |
| | | PRODUCTION_VALIDATION("IV", "生产验证试验阶段"); |
| | | |
| | | @Getter |
| | | private String desc; |
| | | |
| | | |
| | | @Getter |
| | | private String code; |
| | | |
| | | |
| | | ProjectStageEnum(String code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static ProjectStageEnum fromCode(Integer code) { |
| | | ProjectStageEnum[] resultTypes = ProjectStageEnum.values(); |
| | | for (ProjectStageEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName Disable |
| | | * @Description |
| | | * @date 2022-06-08 16:55 |
| | | */ |
| | | public enum QaReportTypeEnum { |
| | | /*1=检测项报告、2=中试 、3=生产验证分析报告;4=辅料*/ |
| | | TEST_REPORT("H1", "检测项报告"), |
| | | TEST_PILOT("H2", "中试"), |
| | | PRODUCTION_VERIFICATION_ANALYSIS_REPORT("H3", "生产验证分析报告"), |
| | | AUXILIARY_MATERIALS("H4", "辅料"); |
| | | |
| | | @Getter |
| | | private String desc; |
| | | |
| | | |
| | | @Getter |
| | | private String code; |
| | | |
| | | |
| | | QaReportTypeEnum(String code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static QaReportTypeEnum fromCode(Integer code) { |
| | | QaReportTypeEnum[] resultTypes = QaReportTypeEnum.values(); |
| | | for (QaReportTypeEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author xiaochen |
| | | * @ClassName Disable |
| | | * @Description |
| | | * @date 2022-06-08 16:55 |
| | | */ |
| | | public enum StudyReportTypeEnum { |
| | | /*1=可研报告 2=可行报告 3=工艺开发工具 4=验证与发布*/ |
| | | FEASIBILITY_STUDY_REPORT("K1", "可研报告"), |
| | | FEASIBLE_REPORT("K2", "可行报告"), |
| | | PROCESS_DEVELOPMENT_TOOLS("K3", "工艺开发工具"), |
| | | VERIFICATION_RELEASE("K4", "验证与发布"); |
| | | |
| | | @Getter |
| | | private String desc; |
| | | |
| | | |
| | | @Getter |
| | | private String code; |
| | | |
| | | |
| | | StudyReportTypeEnum(String code, String desc) { |
| | | this.code = code; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | /** |
| | | * 通过code获取枚举 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | public static StudyReportTypeEnum fromCode(Integer code) { |
| | | StudyReportTypeEnum[] resultTypes = StudyReportTypeEnum.values(); |
| | | for (StudyReportTypeEnum resultType : resultTypes) { |
| | | if (code.equals(resultType.getCode())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.filter; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.ruoyi.common.utils.Sm4Utils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | String originalResponseBody = new String(content); |
| | | String encryptedResponseBody = encryptResponse(originalResponseBody); |
| | | |
| | | responseWrapper.setContentType("application/json"); |
| | | JSONObject result = new JSONObject(); |
| | | result.put("data", encryptedResponseBody); |
| | | result.put("code", 200); |
| | | |
| | | // 设置返回编码 |
| | | responseWrapper.setCharacterEncoding("UTF-8"); |
| | | // 写回客户端 |
| | | responseWrapper.reset(); |
| | | responseWrapper.getWriter().write(encryptedResponseBody); |
| | | responseWrapper.getWriter().write(result.toString()); |
| | | responseWrapper.copyBodyToResponse(); |
| | | |
| | | } catch (Exception e) { |
| | |
| | | * @return 解密后的值 |
| | | */ |
| | | public static String sm4DecryptUtil(String encryptContext){ |
| | | JSONObject jsonObject = JSONObject.parseObject(encryptContext); |
| | | String param = jsonObject.getString("param"); |
| | | SymmetricCrypto sm4 = SmUtil.sm4(KEY.getBytes()); |
| | | return sm4.decryptStr(encryptContext, CharsetUtil.CHARSET_UTF_8); |
| | | return sm4.decryptStr(param, CharsetUtil.CHARSET_UTF_8); |
| | | } |
| | | |
| | | /** |
| | | * 测试方法,测试完要记得删除掉 |
| | | */ |
| | | public static void main(String[] args) { |
| | | // 自定义秘钥 |
| | | String secretKey = "csdn1024CSDN1024"; |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("name", "csdn"); |
| | | jsonObject.put("desc","1024程序员节"); |
| | | |
| | | jsonObject.put("pageNum", 1); |
| | | jsonObject.put("pageSize",10); |
| | | String strParams = JSON.toJSONString(jsonObject); |
| | | System.out.println(String.format("明文参数: %s", strParams)); |
| | | |
| | | String encryptContext = sm4EncryptUtil(strParams); |
| | | System.out.println(String.format("加密后的值: %s", encryptContext)); |
| | | String decryptInfo = sm4DecryptUtil("d2f1da26d73f31d8f66ea64b23beebe014345f504ca516579dce993e4a527b48bc242f17941c7cb6d3eeb60bfe6175a51dafb387fa67a655fb18084acf6f68d149b14b6b9bb0063a7714ae24df78e064250b7bcd7847a719a69328ffaaa2d3add6d002b44fcc4610f3661f7611031cd410325c8391a7227ded9f6c4ec8d8a9908ae19c93c4fb2a16501738055acbea0925500bf691703c2ad4e1b172679d38da"); |
| | | String decryptInfo = sm4DecryptUtil(encryptContext); |
| | | System.out.println(String.format("解密后的信息: %s", decryptInfo)); |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "审核状态") |
| | | @ApiModelProperty(value = "审核状态 (项目课题方案)-1=草稿箱 1=审批中 2=已通过 3=已驳回 4=已撤销 5=已封存、(检测项检测报告)-1=草稿箱 1=待审核 2=已通过 3=已驳回 4=已撤销、(审核中试、生产验证分析报告;辅料;产品报告管理状态)-1=草稿箱 1=待审核 2=已通过待评定 3=已评定 4=已驳回 5=已撤销、(可研、可行、工艺开发工具、验证发布报告)-1=草稿箱 1=待审核 2=待评定 3=已评定 4=已驳回 5=已撤回") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "审核意见") |
| | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "角色新增DTO") |
| | | @ApiModel(value = "角色新增编辑DTO") |
| | | public class SysRoleDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "角色id") |
| | |
| | | @ApiModelProperty(value = "报告文件") |
| | | private List<TFeasibilityReportFile> feasibilityReportFiles; |
| | | |
| | | @ApiModelProperty(value = "检测报告文件类型 1=检测报告 2=中试生产验证 3=原辅料报告 4=产品报批报告") |
| | | private Integer reportType; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "检测报告文件") |
| | | private List<TQaReportFile> qaReportFiles; |
| | | |
| | | @ApiModelProperty(value = "检测报告文件类型 1=检测报告 2=中试生产验证 3=原辅料报告 4=产品报批报告") |
| | | private Integer reportType; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "状态 1=正常 2=封存") |
| | | @ApiModelProperty(value = "状态 (项目组)1=正常 2=封存 、 (项目课题方案) -1=草稿箱 1=审批中 2=已通过 3=已驳回 4=已撤销 5=已封存") |
| | | private Integer status; |
| | | |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "角色类型 2=审批人 3=工艺工程师 4=实验员 5=化验师") |
| | | @TableField("role_type") |
| | | private Integer roleType; |
| | | |
| | | |
| | | @ApiModelProperty(value = "用户名") |
| | | @TableField(exist = false) |
| | | private String nickName; |
| | | @ApiModelProperty(value = "头像") |
| | | @TableField(exist = false) |
| | | private String avatar; |
| | | } |
| | |
| | | @TableField("report_content") |
| | | private String reportContent; |
| | | |
| | | @ApiModelProperty(value = "报告编号") |
| | | @TableField("report_code") |
| | | private String reportCode; |
| | | |
| | | @ApiModelProperty(value = "制定人") |
| | | @TableField("develop_person") |
| | | private String developPerson; |
| | |
| | | private String teamName; |
| | | |
| | | @ApiModelProperty(value = "报告标题") |
| | | private String reportTitle; |
| | | private String reportName; |
| | | |
| | | @ApiModelProperty(value = "报告编号") |
| | | private String reportCode; |
| | | |
| | | @ApiModelProperty(value = "类型 1=可研报告 2=可行报告 3=工艺开发工具 4=验证与发布") |
| | | private Integer reportType; |
| | | |
| | | @ApiModelProperty(value = "状态 -1=草稿箱 1=待审核 2=待评定 3=已评定 4=已驳回 5=已撤回") |
| | | private Integer status; |
| | | |
| | |
| | | @ApiModelProperty(value = "实验编号") |
| | | private String experimentCode; |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty(value = "状态 -1=草稿箱 1=已发送待提交 2=已提交 3=已封存") |
| | | @TableField("status") |
| | | private Integer status; |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | 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.TProjectTeamMapper; |
| | | import com.ruoyi.system.mapper.TProjectTeamStaffMapper; |
| | | import com.ruoyi.system.model.TProjectTeam; |
| | |
| | | |
| | | @Autowired |
| | | private TProjectTeamStaffMapper projectTeamStaffMapper; |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public PageInfo<TProjectTeamVO> pageList(TProjectTeamQuery query) { |
| | | PageInfo<TProjectTeamVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TProjectTeamVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | List<String> teamIds = list.stream().map(TProjectTeamVO::getId).collect(Collectors.toList()); |
| | | List<SysUser> sysUsers = sysUserMapper.selectList(); |
| | | if(!CollectionUtils.isEmpty(teamIds)){ |
| | | List<TProjectTeamStaff> projectTeamStaffs = projectTeamStaffMapper.selectList(Wrappers.lambdaQuery(TProjectTeamStaff.class).in(TProjectTeamStaff::getTeamId, teamIds)); |
| | | list.forEach(item->{ |
| | | List<TProjectTeamStaff> projectTeamStaffList = projectTeamStaffs.stream().filter(staff -> staff.getTeamId().equals(item.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(projectTeamStaffList)){ |
| | | List<Long> staffIds = projectTeamStaffList.stream().map(TProjectTeamStaff::getUserId).collect(Collectors.toList()); |
| | | List<SysUser> staffs = sysUsers.stream().filter(sysUser -> staffIds.contains(sysUser.getUserId())).collect(Collectors.toList()); |
| | | item.setStaffName(staffs.stream().map(SysUser::getNickName).collect(Collectors.joining(","))); |
| | | } |
| | | item.setStaffs(projectTeamStaffList); |
| | | }); |
| | | } |
| | |
| | | @ApiModelProperty(value = "项目组人员") |
| | | private List<TProjectTeamStaff> staffs; |
| | | |
| | | @ApiModelProperty(value = "项目组人员名称") |
| | | private String staffName; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.system.model.TExperimentDispatch; |
| | | import com.ruoyi.system.model.TSamplingRecord; |
| | | import com.ruoyi.system.model.TSamplingRecordOperation; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | |
| | | @ApiModelProperty(value = "取样操作记录集合") |
| | | private List<TSamplingRecordOperation> samplingRecordOperations; |
| | | @ApiModelProperty(value = "实验调度信息") |
| | | private TExperimentDispatch experimentDispatch; |
| | | |
| | | } |
| | |
| | | <result property="remark" column="remark" /> |
| | | <result property="ifBlack" column="ifBlack" /> |
| | | <result property="districtId" column="districtId" /> |
| | | <result property="roleType" column="role_type" /> |
| | | <association property="dept" javaType="SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, |
| | | u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.role_type, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status |
| | | from sys_user u |
| | |
| | | from t_experiment_dispatch ted |
| | | left join t_project_proposal tpp on ted.proposal_id = tpp.id |
| | | <where> |
| | | <if test="query.proposalName != null and query.proposalName != ''"> |
| | | and tpp.proposal_name like concat('%',#{query.proposalName},'%') |
| | | <if test="query.projectName != null and query.projectName != ''"> |
| | | and tpp.project_name like concat('%',#{query.projectName},'%') |
| | | </if> |
| | | <if test="query.experimentCode != null and query.experimentCode != ''"> |
| | | and ted.experiment_code like concat('%',#{query.experimentCode},'%') |
| | |
| | | <if test="query.status != null"> |
| | | and tfsr.status = #{query.status} |
| | | </if> |
| | | <if test="query.reportType != null"> |
| | | and tfsr.report_type = #{query.reportType} |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND tfsr.create_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | | </if> |
| | |
| | | select tpp.id, tpp.project_name, tpp.project_stage, tpp.project_code, tpp.experiment_objective, tpp.experiment_material, tpp.experiment_device, |
| | | tpp.experiment_test_method, tpp.experiment_procedure, tpp.data_acquisition, tpp.result_evaluation, tpp.precautions, tpp.audit_status, |
| | | tpp.audit_person_id, tpp.audit_time, tpp.audit_remark, tpp.create_time, tpp.update_time, tpp.create_by, tpp.update_by, tpp.disabled, |
| | | su.nickname as auditPersonName |
| | | su.nick_name as auditPersonName |
| | | from t_project_proposal tpp |
| | | left join sys_user su on su.user_id = tpp.audit_person_id |
| | | <where> |
| | |
| | | and tpp.project_code like concat('%',#{query.projectCode},'%') |
| | | </if> |
| | | <if test="query.auditPersonName != null and query.auditPersonName != ''"> |
| | | and su.nickname like concat('%',#{query.auditPersonName},'%') |
| | | and su.nick_name like concat('%',#{query.auditPersonName},'%') |
| | | </if> |
| | | <if test="query.createBy != null and query.createBy != ''"> |
| | | and tpp.createBy like concat('%',#{query.createBy},'%') |
| | | and tpp.create_by like concat('%',#{query.createBy},'%') |
| | | </if> |
| | | <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} |
| | |
| | | <include refid="Base_Column_List" /> |
| | | FROM t_project_team |
| | | <where> |
| | | <if test="teamName != null and teamName != ''"> |
| | | AND team_name LIKE CONCAT('%', #{teamName}, '%') |
| | | <if test="query.teamName != null and query.teamName != ''"> |
| | | AND team_name LIKE CONCAT('%', #{query.teamName}, '%') |
| | | </if> |
| | | <if test="personCharge != null and personCharge != ''"> |
| | | AND person_charge LIKE CONCAT('%', #{personCharge}, '%') |
| | | <if test="query.personCharge != null and query.personCharge != ''"> |
| | | AND person_charge LIKE CONCAT('%', #{query.personCharge}, '%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | AND create_time BETWEEN #{query.startTime} AND #{query.endTime} |
| | |
| | | <id column="id" property="id" /> |
| | | <result column="item_id" property="itemId" /> |
| | | <result column="report_content" property="reportContent" /> |
| | | <result column="report_code" property="reportCode" /> |
| | | <result column="develop_person" property="developPerson" /> |
| | | <result column="develop_date" property="developDate" /> |
| | | <result column="report_text" property="reportText" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, item_id, report_content, develop_person, develop_date, report_text, audit_person_id, audit_time, audit_remark, status, create_time, update_time, create_by, update_by, disabled |
| | | id, item_id, report_content,report_code, develop_person, develop_date, report_text, audit_person_id, audit_time, audit_remark, status, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="getList" resultType="com.ruoyi.system.vo.TQaTestItemReportVO"> |
| | | select |
| | |
| | | order by create_time desc |
| | | </select> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TQaTestItemReportVO"> |
| | | select tqtir.id, tqtir.item_id, tqtir.report_content, tqtir.develop_person, tqtir.develop_date, tqtir.report_text, |
| | | select tqtir.id, tqtir.item_id, tqtir.report_content,tqtir.report_code, tqtir.develop_person, tqtir.develop_date, tqtir.report_text, |
| | | tqtir.audit_person_id, tqtir.audit_time, tqtir.audit_remark, tqtir.status, tqtir.create_time, tqtir.update_time, |
| | | tqtir.create_by, tqtir.update_by, tqtir.disabled,tqti.item_name as itemName, tqti.item_code as itemCode, |
| | | tpt.team_name as teamName |
| | |
| | | <if test="query.status != null"> |
| | | and tsr.status = #{query.status} |
| | | </if> |
| | | <if test="query.createBy != null and query.createBy !=''"> |
| | | and tsr.create_by like concat('%', #{query.createBy}, '%') |
| | | </if> |
| | | AND tsr.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tsr.create_time DESC |