| | |
| | | package com.ruoyi.web.controller.project; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | import com.ruoyi.project.common.CalculateDateUtils; |
| | | import com.ruoyi.project.domain.ServiceDonatebaseinfo; |
| | | import com.ruoyi.project.domain.ServiceDonationwitness; |
| | | import com.ruoyi.project.domain.vo.TimeVO; |
| | | import com.ruoyi.project.service.IServiceDonatebaseinfoService; |
| | | import com.ruoyi.project.service.IServiceDonationwitnessService; |
| | | import com.ruoyi.project.service.IServiceExternalpersonService; |
| | | import com.ruoyi.system.mapper.SysDeptMapper; |
| | | import freemarker.template.Configuration; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.*; |
| | |
| | | private IServiceDonatebaseinfoService serviceDonatebaseinfoService; |
| | | |
| | | @Autowired |
| | | private IServiceExternalpersonService serviceExternalpersonService; |
| | | private IServiceDonationwitnessService serviceDonationwitnessService; |
| | | |
| | | @Autowired |
| | | private ServerConfig serverConfig; |
| | | private IServiceExternalpersonService serviceExternalpersonService; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | |
| | | public TableDataInfo list(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("潜在捐献信息列表:{}", serviceDonatebaseinfo); |
| | | startPage(); |
| | | //List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo); |
| | | List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.selectServiceDonatebaseinfoList(serviceDonatebaseinfo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 查询潜在捐献患者信息列表不与base_organization关联 |
| | | */ |
| | | @ApiOperation("潜在捐献患者信息列表") |
| | | //// @PreAuthorize("@ss.hasPermi('project:donatebaseinfo:list')") |
| | | @GetMapping("/getpatname") |
| | | public TableDataInfo getPatName(ServiceDonatebaseinfo serviceDonatebaseinfo) { |
| | | log.info("潜在捐献患者信息列表:{}", serviceDonatebaseinfo); |
| | | List<ServiceDonatebaseinfo> list = serviceDonatebaseinfoService.getPatName(serviceDonatebaseinfo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | serviceDonatebaseinfo.setAge2(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age2")) ? Long.valueOf(map.get("age2")) : null); |
| | | serviceDonatebaseinfo.setAgeunit2(map.get("ageUnit2")); |
| | | } |
| | | |
| | | serviceDonatebaseinfo.setAgeunit("-"); |
| | | serviceDonatebaseinfo.setAge(null); |
| | | serviceDonatebaseinfo.setAge2(null); |
| | | |
| | | //获取死亡时间,如果获取见证里有死亡时间,则进行计算他的年龄 |
| | | ServiceDonationwitness sdw = new ServiceDonationwitness(); |
| | | sdw.setInfoid(serviceDonatebaseinfo.getId()); |
| | | List<ServiceDonationwitness> serviceDonationwitnessList = serviceDonationwitnessService.selectServiceDonationwitnessList(sdw); |
| | | if (!CollectionUtils.isEmpty(serviceDonationwitnessList) && serviceDonatebaseinfo.getBirthday() != null) { |
| | | Date deathtime = serviceDonationwitnessList.get(0).getDeathtime(); |
| | | if (ObjectUtils.isNotEmpty(deathtime)) { |
| | | Map<String, String> map = CalculateDateUtils.calculateAge(serviceDonatebaseinfo.getBirthday().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), deathtime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()); |
| | | if (Objects.isNull(map)) { |
| | | log.error("serviceDonatebaseinfo出生日期:{},serviceDonatebaseinfo死亡日期:{}", serviceDonatebaseinfo.getBirthday(), deathtime); |
| | | } |
| | | serviceDonatebaseinfo.setAge(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null); |
| | | serviceDonatebaseinfo.setAgeunit(map.get("ageUnit")); |
| | | serviceDonatebaseinfo.setAge2(org.apache.commons.lang3.ObjectUtils.isNotEmpty(map.get("age2")) ? Long.valueOf(map.get("age2")) : null); |
| | | serviceDonatebaseinfo.setAgeunit2(map.get("ageUnit2")); |
| | | } |
| | | } |
| | | |
| | | |
| | | return AjaxResult.success(serviceDonatebaseinfo); |
| | | } |
| | | |
| | |
| | | log.info("新增潜在捐献信息:{}", serviceDonatebaseinfo); |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | |
| | | // String bh = ""; |
| | | // bh = serviceDonatebaseinfoService.getDonateNumber(serviceDonatebaseinfo); |
| | | // if (bh == "") { |
| | | // return AjaxResult.error("新增时生成的编号为空,创建失败!"); |
| | | // } else { |
| | | // ServiceDonatebaseinfo serviceDonatebaseinfo1 = new ServiceDonatebaseinfo(); |
| | | // serviceDonatebaseinfo1.setDonorno(bh); |
| | | // List<ServiceDonatebaseinfo> listrecord = serviceDonatebaseinfoService.queryList(serviceDonatebaseinfo1); |
| | | // if (listrecord.size() > 0) { |
| | | // return AjaxResult.error("新增时生成的编号" + bh + "已存在,无法保存!"); |
| | | // } |
| | | // |
| | | // } |
| | | String idcardno = serviceDonatebaseinfo.getIdcardno(); |
| | | ServiceDonatebaseinfo serviceDonatebaseinfo2 = new ServiceDonatebaseinfo(); |
| | | serviceDonatebaseinfo2.setIdcardno(idcardno); |
| | |
| | | dataMap.put("YJXZGX", "其他"); |
| | | } |
| | | //信息来源 |
| | | if (serviceDonatebaseinfo.getInfosources().contains("红十字会")) { |
| | | dataMap.put("HSZH2", (char) 8730); // 勾选符号 |
| | | } else { |
| | | dataMap.put("HSZH2", "□"); // 方框符号 |
| | | } |
| | | if (serviceDonatebaseinfo.getInfosources().contains("医疗机构")) { |
| | | dataMap.put("YLJG", (char) 8730); |
| | | if (serviceDonatebaseinfo.getInfosources().contains("家属")) { |
| | |
| | | dataMap.put("BGR", serviceDonatebaseinfo.getReportername() == null ? "" : serviceDonatebaseinfo.getReportername()); |
| | | dataMap.put("BGRDH", serviceDonatebaseinfo.getReporterphone() == null ? "" : serviceDonatebaseinfo.getReporterphone()); |
| | | |
| | | //获取报告时间 |
| | | String bgrq = null; |
| | | if (serviceDonatebaseinfo.getReporttime() != null) { |
| | | Date reportTime = serviceDonatebaseinfo.getReporttime(); |
| | | LocalDate localDate = reportTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | |
| | | int year = localDate.getYear(); |
| | | int month = localDate.getMonthValue(); // 直接获取月份值(1-12) |
| | | int day = localDate.getDayOfMonth(); |
| | | bgrq = year + "年" + month + "月" + day + "日"; |
| | | } |
| | | |
| | | dataMap.put("BGRQ", bgrq); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("获取状态获取计数") |