| | |
| | | import com.gkhy.labRiskManage.domain.account.model.dto.UserInfoDomainDTO; |
| | | import com.gkhy.labRiskManage.domain.account.service.UserDomainService; |
| | | import com.gkhy.labRiskManage.domain.basic.entity.BasicRiskUnitType; |
| | | import com.gkhy.labRiskManage.domain.basic.model.dto.PersonQueryDTO; |
| | | import com.gkhy.labRiskManage.domain.basic.model.dto.SiteQueryDTO; |
| | | import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentPersonService; |
| | | import com.gkhy.labRiskManage.domain.basic.service.BasicExperimentSiteService; |
| | | import com.gkhy.labRiskManage.domain.basic.service.BasicRiskUnitTypeService; |
| | | import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAndSite; |
| | | import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentAssessLog; |
| | | import com.gkhy.labRiskManage.domain.experiment.entity.ExperimentInfo; |
| | | import com.gkhy.labRiskManage.domain.experiment.enums.ExperimentApprovalStatusEnum; |
| | | import com.gkhy.labRiskManage.domain.experiment.enums.ExperimentRectifyStatusEnum; |
| | | import com.gkhy.labRiskManage.domain.experiment.model.dto.ExperimentInfoDTO; |
| | | import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAndSiteService; |
| | | import com.gkhy.labRiskManage.domain.experiment.service.ExperimentAssessLogService; |
| | | import com.gkhy.labRiskManage.domain.experiment.service.ExperimentInfoService; |
| | | import com.gkhy.labRiskManage.domain.riskReport.entity.*; |
| | | import com.gkhy.labRiskManage.domain.riskReport.model.bo.ReportQueryBO; |
| | |
| | | import com.gkhy.labRiskManage.domain.riskReport.service.*; |
| | | import com.gkhy.labRiskManage.domain.riskReport.utils.GetRoleTagUtils; |
| | | import com.gkhy.labRiskManage.domain.riskReport.utils.RiskSourceTypeUtils; |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | |
| | | import javax.persistence.criteria.CriteriaQuery; |
| | | import javax.persistence.criteria.Predicate; |
| | | import javax.persistence.criteria.Root; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | private ReportExperimentRiskSourceTypeService reportSourceTypeService; |
| | | @Autowired |
| | | private ReportExperimentRiskSourceService reportSourceService; |
| | | @Autowired |
| | | private ExperimentAssessLogService experimentAssessLogService; |
| | | |
| | | @Autowired |
| | | private UserDomainService userDomainService; |
| | |
| | | if (ObjectUtils.isEmpty(queryBO.getTag())){ |
| | | throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR.getCode() ,"查询报告类别参数缺失"); |
| | | } |
| | | if (queryBO.getExperimentName() == "null"){ |
| | | if (queryBO.getExperimentName() == ""){ |
| | | queryBO.setExperimentName(null); |
| | | } |
| | | UserInfoDomainDTO user = userDomainService.getUserById(currentUserId); |
| | |
| | | predicateList.add(criteriaBuilder.equal(root.get("experimentId"),queryParam.getExperimentId())); |
| | | } |
| | | if (!ObjectUtils.isEmpty(queryParam.getExperimentName())){ |
| | | predicateList.add(criteriaBuilder.equal(root.get("experimentName"), queryParam.getExperimentName())); |
| | | predicateList.add(criteriaBuilder.like(root.get("experimentName"),"%"+queryParam.getExperimentName()+"%")); |
| | | } |
| | | if (roleTag == UserTagEnum.USER_TAG_0.getCode()){ |
| | | predicateList.add(criteriaBuilder.equal(root.get("personUserId"), currentUserId)); |
| | |
| | | if (queryParam.getTag() == 1){ |
| | | predicateList.add(criteriaBuilder.isNull(root.get("assessPerson"))); |
| | | }else if (queryParam.getTag() == 2){ |
| | | predicateList.add(criteriaBuilder.isNotNull(root.get("assessPerson"))); |
| | | predicateList.add(criteriaBuilder.isNotNull(root.get("assessPerson")) |
| | | ); |
| | | } |
| | | //现在领导能查看所有的报告 |
| | | // if (roleTag == UserTagEnum.USER_TAG_2.getCode()){ |
| | |
| | | |
| | | reportById.setAssessPerson(reportUpdateBO.getAssessPerson()); |
| | | reportById.setAssessLevel(reportUpdateBO.getAssessLevel()); |
| | | // reportById.setSafeRiskAnalysis(reportUpdateBO.getSafeRiskAnalysis()); |
| | | reportById.setDescription(reportUpdateBO.getDescription()); |
| | | reportById.setUpdateTime(LocalDateTime.now()); |
| | | reportById.setUpdateByUserId(currentUserId); |
| | |
| | | if (ObjectUtils.isEmpty(experimentInfo)){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"实验信息状态修改失败"); |
| | | } |
| | | |
| | | //添加评估记录 todo |
| | | ExperimentAssessLog experimentAssessLog = new ExperimentAssessLog(); |
| | | experimentAssessLog.setExperimentCode(experimentInfo.getExperimentCode()); |
| | | experimentAssessLog.setAssessEndTime(date); |
| | | experimentAssessLog.setAssessUser(user.getRealName()); |
| | | experimentAssessLog.setAssessResult(StatusEnum.APPROVED_PASS.getCode().byteValue()); |
| | | ExperimentAssessLog experimentAssessLogResult = experimentAssessLogService.saveExperimentAssessLog(experimentAssessLog); |
| | | if (ObjectUtils.isEmpty(experimentAssessLogResult)){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"实验信息评估记录写入失败"); |
| | | } |
| | | }else { |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"无操作权限"); |
| | | } |
| | | } |
| | | |
| | |
| | | if (ObjectUtils.isEmpty(assessPerson)){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"审核信息保存失败"); |
| | | } |
| | | }else { |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"无操作权限"); |
| | | } |
| | | //修改报告状态 |
| | | reportById.setApprovePlanStatus(StatusEnum.REPORT_NOT_APPROVED.getCode().byteValue()); |
| | |
| | | if (ObjectUtils.isEmpty(experimentInfo)){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"实验信息状态修改失败"); |
| | | } |
| | | |
| | | |
| | | //添加评估记录 todo |
| | | ExperimentAssessLog experimentAssessLog = new ExperimentAssessLog(); |
| | | experimentAssessLog.setExperimentCode(experimentInfo.getExperimentCode()); |
| | | experimentAssessLog.setAssessEndTime(date); |
| | | experimentAssessLog.setAssessUser(user.getRealName()); |
| | | experimentAssessLog.setAssessResult(StatusEnum.APPROVED_NOT_PASS.getCode().byteValue()); |
| | | ExperimentAssessLog experimentAssessLogResult = experimentAssessLogService.saveExperimentAssessLog(experimentAssessLog); |
| | | if (ObjectUtils.isEmpty(experimentAssessLogResult)){ |
| | | throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"实验信息评估记录写入失败"); |
| | | } |
| | | } |
| | | |
| | | return StatusEnum.SUCCESS.getCode(); |