| | |
| | | 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.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.project.common.CalculateDateUtils; |
| | | import com.ruoyi.project.domain.vo.DonateAnnexVO; |
| | | import com.ruoyi.project.domain.vo.EthicalReviewVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | if (b) { |
| | | donateAnnexVO.setCreate_by(user.getUserName()); |
| | | } |
| | | return serviceDonateannexMapper.selectVOList(donateAnnexVO); |
| | | List<DonateAnnexVO> donateAnnexVOS = serviceDonateannexMapper.selectVOList(donateAnnexVO); |
| | | for (DonateAnnexVO donateAnnexVO1 : donateAnnexVOS) { |
| | | if (donateAnnexVO1.getBirthday() != null) { |
| | | Map<String, String> map = CalculateDateUtils.calculateAge(donateAnnexVO1.getBirthday().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now()); |
| | | donateAnnexVO1.setAge(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null); |
| | | donateAnnexVO1.setAgeunit(map.get("ageUnit")); |
| | | donateAnnexVO1.setAge2(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age2")) ? Long.valueOf(map.get("age2")) : null); |
| | | donateAnnexVO1.setAgeunit2(map.get("ageUnit2")); |
| | | } |
| | | } |
| | | |
| | | return donateAnnexVOS; |
| | | } |
| | | |
| | | @Override |