| | |
| | | package com.ruoyi.project.service.impl; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.project.common.CalculateDateUtils; |
| | | import com.ruoyi.project.domain.vo.EthicalReviewVO; |
| | | import com.ruoyi.project.domain.vo.MedicalEvaluationVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Map; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.mapper.ServiceEthicalreviewopinionsMapper; |
| | | import com.ruoyi.project.domain.ServiceEthicalreviewopinions; |
| | |
| | | |
| | | /** |
| | | * 伦理审查专家意见Service业务层处理 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | * @date 2021-11-23 |
| | | */ |
| | | @Service |
| | | public class ServiceEthicalreviewopinionsServiceImpl extends ServiceImpl<ServiceEthicalreviewopinionsMapper, ServiceEthicalreviewopinions> implements IServiceEthicalreviewopinionsService |
| | | { |
| | | public class ServiceEthicalreviewopinionsServiceImpl extends ServiceImpl<ServiceEthicalreviewopinionsMapper, ServiceEthicalreviewopinions> implements IServiceEthicalreviewopinionsService { |
| | | |
| | | @Autowired |
| | | ServiceEthicalreviewopinionsMapper serviceEthicalreviewopinionsMapper; |
| | |
| | | |
| | | /** |
| | | * 查询伦理审查专家意见列表 |
| | | * |
| | | * |
| | | * @param serviceEthicalreviewopinions 伦理审查专家意见 |
| | | * @return 伦理审查专家意见 |
| | | */ |
| | | @Override |
| | | public List<ServiceEthicalreviewopinions> queryList(ServiceEthicalreviewopinions serviceEthicalreviewopinions) { |
| | | LambdaQueryWrapper<ServiceEthicalreviewopinions> wrappers = Wrappers.lambdaQuery(); |
| | | if (serviceEthicalreviewopinions.getInfoid() != null){ |
| | | wrappers.eq(ServiceEthicalreviewopinions::getInfoid ,serviceEthicalreviewopinions.getInfoid()); |
| | | if (serviceEthicalreviewopinions.getInfoid() != null) { |
| | | wrappers.eq(ServiceEthicalreviewopinions::getInfoid, serviceEthicalreviewopinions.getInfoid()); |
| | | } |
| | | if (StringUtils.isNotBlank(serviceEthicalreviewopinions.getDonorno())){ |
| | | wrappers.eq(ServiceEthicalreviewopinions::getDonorno ,serviceEthicalreviewopinions.getDonorno()); |
| | | if (StringUtils.isNotBlank(serviceEthicalreviewopinions.getDonorno())) { |
| | | wrappers.eq(ServiceEthicalreviewopinions::getDonorno, serviceEthicalreviewopinions.getDonorno()); |
| | | } |
| | | if (StringUtils.isNotBlank(serviceEthicalreviewopinions.getExpertopinion())){ |
| | | wrappers.eq(ServiceEthicalreviewopinions::getExpertopinion ,serviceEthicalreviewopinions.getExpertopinion()); |
| | | if (StringUtils.isNotBlank(serviceEthicalreviewopinions.getExpertopinion())) { |
| | | wrappers.eq(ServiceEthicalreviewopinions::getExpertopinion, serviceEthicalreviewopinions.getExpertopinion()); |
| | | } |
| | | if (serviceEthicalreviewopinions.getExpertconclusion() != null){ |
| | | wrappers.eq(ServiceEthicalreviewopinions::getExpertconclusion ,serviceEthicalreviewopinions.getExpertconclusion()); |
| | | if (serviceEthicalreviewopinions.getExpertconclusion() != null) { |
| | | wrappers.eq(ServiceEthicalreviewopinions::getExpertconclusion, serviceEthicalreviewopinions.getExpertconclusion()); |
| | | } |
| | | if (StringUtils.isNotBlank(serviceEthicalreviewopinions.getExpertname())){ |
| | | wrappers.like(ServiceEthicalreviewopinions::getExpertname ,serviceEthicalreviewopinions.getExpertname()); |
| | | if (StringUtils.isNotBlank(serviceEthicalreviewopinions.getExpertname())) { |
| | | wrappers.like(ServiceEthicalreviewopinions::getExpertname, serviceEthicalreviewopinions.getExpertname()); |
| | | } |
| | | if (serviceEthicalreviewopinions.getConclusiontime() != null){ |
| | | wrappers.eq(ServiceEthicalreviewopinions::getConclusiontime ,serviceEthicalreviewopinions.getConclusiontime()); |
| | | if (serviceEthicalreviewopinions.getConclusiontime() != null) { |
| | | wrappers.eq(ServiceEthicalreviewopinions::getConclusiontime, serviceEthicalreviewopinions.getConclusiontime()); |
| | | } |
| | | if (StringUtils.isNotBlank(serviceEthicalreviewopinions.getConclusionannex())){ |
| | | wrappers.eq(ServiceEthicalreviewopinions::getConclusionannex ,serviceEthicalreviewopinions.getConclusionannex()); |
| | | if (StringUtils.isNotBlank(serviceEthicalreviewopinions.getConclusionannex())) { |
| | | wrappers.eq(ServiceEthicalreviewopinions::getConclusionannex, serviceEthicalreviewopinions.getConclusionannex()); |
| | | } |
| | | if (serviceEthicalreviewopinions.getConclusionorder() != null){ |
| | | wrappers.eq(ServiceEthicalreviewopinions::getConclusionorder ,serviceEthicalreviewopinions.getConclusionorder()); |
| | | if (serviceEthicalreviewopinions.getConclusionorder() != null) { |
| | | wrappers.eq(ServiceEthicalreviewopinions::getConclusionorder, serviceEthicalreviewopinions.getConclusionorder()); |
| | | } |
| | | return this.list(wrappers); |
| | | } |
| | |
| | | public List<EthicalReviewVO> selectVOList(EthicalReviewVO ethicalReviewVO) { |
| | | |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | List <SysRole> l = user.getRoles(); |
| | | List<SysRole> l = user.getRoles(); |
| | | Boolean b = false; |
| | | for(SysRole r : l){ |
| | | if(r.getRoleId().longValue() == 3){ |
| | | for (SysRole r : l) { |
| | | if (r.getRoleId().longValue() == 3) { |
| | | b = true; |
| | | } |
| | | } |
| | | if(b){ |
| | | ethicalReviewVO.setBasecreateby(user.getUserName()); |
| | | if (b) { |
| | | ethicalReviewVO.setReporterno(user.getUserName()); |
| | | } |
| | | List<EthicalReviewVO> ethicalReviewVOS = serviceEthicalreviewopinionsMapper.selectVOList(ethicalReviewVO); |
| | | |
| | | return serviceEthicalreviewopinionsMapper.selectVOList(ethicalReviewVO); |
| | | for (EthicalReviewVO ethicalReviewVO1 : ethicalReviewVOS) { |
| | | if (ethicalReviewVO1.getBirthday() != null) { |
| | | Map<String, String> map = CalculateDateUtils.calculateAge(ethicalReviewVO1.getBirthday().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now()); |
| | | ethicalReviewVO1.setAge(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null); |
| | | ethicalReviewVO1.setAgeunit(map.get("ageUnit")); |
| | | ethicalReviewVO1.setAge2(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age2")) ? Long.valueOf(map.get("age2")) : null); |
| | | ethicalReviewVO1.setAgeunit2(map.get("ageUnit2")); |
| | | } |
| | | } |
| | | return ethicalReviewVOS; |
| | | } |
| | | |
| | | } |