| | |
| | | serviceDonatebaseinfo.setDeptid(user.getDeptId()); |
| | | } |
| | | List<ServiceDonatebaseinfo> serviceDonatebaseinfos = serviceDonatebaseinfoMapper.selectServiceDonatebaseinfoList(serviceDonatebaseinfo); |
| | | for (ServiceDonatebaseinfo serviceDonatebaseinfo1 : serviceDonatebaseinfos) { |
| | | //先给个年龄默认值(因为age是数字类型,不能放横杠,所以就所横扛放到单位上) |
| | | serviceDonatebaseinfo1.setAgeunit("-"); |
| | | serviceDonatebaseinfo1.setAge(null); |
| | | serviceDonatebaseinfo1.setAge2(null); |
| | | |
| | | //获取死亡时间,如果获取见证里有死亡时间,则进行计算他的年龄 |
| | | ServiceDonationwitness sdw = new ServiceDonationwitness(); |
| | | sdw.setInfoid(serviceDonatebaseinfo1.getId()); |
| | | List<ServiceDonationwitness> serviceDonationwitnessList = serviceDonationwitnessMapper.selectServiceDonationwitnessList(sdw); |
| | | if (!CollectionUtils.isEmpty(serviceDonationwitnessList) && serviceDonatebaseinfo1.getBirthday() != null) { |
| | | Date deathtime = serviceDonationwitnessList.get(0).getDeathtime(); |
| | | if (ObjectUtils.isNotEmpty(deathtime)) { |
| | | Map<String, String> map = CalculateDateUtils.calculateAge(serviceDonatebaseinfo1.getBirthday().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), deathtime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); |
| | | if (Objects.isNull(map)) { |
| | | log.error("ServiceDonationwitness出生日期:{},ServiceDonationwitness死亡日期:{}", serviceDonatebaseinfo1.getBirthday(), deathtime); |
| | | continue; |
| | | } |
| | | serviceDonatebaseinfo1.setAge(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null); |
| | | serviceDonatebaseinfo1.setAgeunit(map.get("ageUnit")); |
| | | serviceDonatebaseinfo1.setAge2(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age2")) ? Long.valueOf(map.get("age2")) : null); |
| | | serviceDonatebaseinfo1.setAgeunit2(map.get("ageUnit2")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | return serviceDonatebaseinfos; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 捐献进度基本信息 |
| | | * |
| | | * @param donatebaseinfoProgressVO |
| | | * @return |
| | | */ |