| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.ServiceDonateorganBase; |
| | | import com.ruoyi.project.domain.ServiceEthicalreviewinitiate; |
| | |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.poi.ss.formula.functions.Now; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | |
| | | } |
| | | EthicalreviewopinionsStateTotalVO stateTotalVO=serviceEthicalreviewopinionsService.stateTotalAll(nitiateId); |
| | | String filePath = getClass().getResource("/template/").getPath(); |
| | | File directory = new File("");// 参数为空 |
| | | String filePath1 = null; |
| | | try { |
| | | filePath1 = directory.getCanonicalPath()+"\\template\\"; |
| | | } catch (IOException e) { |
| | | } |
| | | if(filePath.substring(0,1).equals("/")) |
| | | filePath=filePath.substring(1); |
| | | filePath = RuoYiConfig.getProfile()+"\\template\\"; |
| | | String content =""; |
| | | Template t = null; |
| | | try { |
| | | // content = Files.readString(Paths.get(filePath+"遗体器官获取伦理审查表首页.xml"), StandardCharsets.UTF_8); |
| | | //content = Files.readString(Paths.get(filePath+"遗体器官获取伦理审查表首页.xml"), StandardCharsets.UTF_8); |
| | | Path path = Paths.get(filePath + "遗体器官获取伦理审查表首页.xml"); |
| | | byte[] bytes = Files.readAllBytes(path); |
| | | content = new String(bytes, StandardCharsets.UTF_8); |
| | | logger.info(filePath + "遗体器官获取伦理审查表首页.xml ;"+Files.exists(path)); |
| | | if(Files.exists(path)) { |
| | | byte[] bytes = Files.readAllBytes(path); |
| | | content = new String(bytes, StandardCharsets.UTF_8); |
| | | }else{ |
| | | logger.info(filePath1 + "遗体器官获取伦理审查表首页.xml ;"+Files.exists(path)); |
| | | path = Paths.get(filePath1 + "遗体器官获取伦理审查表首页.xml"); |
| | | byte[] bytes = Files.readAllBytes(path); |
| | | content = new String(bytes, StandardCharsets.UTF_8); |
| | | } |
| | | String name=list.get(0).getName()+"(住院号:"+list.get(0).getInpatientno()+")"; |
| | | content=content.replace("$name",name);//项目名称 |
| | | |
| | |
| | | |
| | | } |
| | | if(expName.length()==2) expName=expName.substring(0,1)+" "+expName.substring(1); |
| | | if(row.getReceiveStatus().equals("1"))State="已同意"; |
| | | else if(row.getReceiveStatus().equals("2")) State="不同意"; |
| | | else if(row.getReceiveStatus().equals("3")) State="弃权"; |
| | | else if(row.getReceiveStatus().equals("4")) State="修改后同意"; |
| | | if(row.getReceiveStatus().equals("0"))State="待接收"; |
| | | else if(row.getReceiveStatus().equals("1")) State="未接收"; |
| | | else if(row.getReceiveStatus().equals("2")) State="已接收"; |
| | | else if(row.getReceiveStatus().equals("3")) State="超时"; |
| | | else if(row.getReceiveStatus().equals("4")) State="中止"; |
| | | else if(row.getReceiveStatus().equals("5")) State="完成"; |
| | | committeeOpinion+=" <w:tr wsp:rsidR=\"00425E28\" wsp:rsidRPr=\"00CB3FB5\" wsp:rsidTr=\"00425E28\"><w:trPr><w:trHeight w:val=\"680\"/></w:trPr>\n" + |
| | | " <w:tc><w:tcPr><w:tcW w:w=\"885\" w:type=\"dxa\"/><w:vmerge/><w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"auto\"/><w:vAlign\n" + |
| | | " w:val=\"center\"/></w:tcPr>\n" + |
| | |
| | | try { |
| | | Path path = Paths.get(filePathData + "/" + name + ".doc"); |
| | | Files.write(path, content.getBytes(StandardCharsets.UTF_8)); |
| | | |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("downloadUrl", "/download/wordtemplate/" + name + ".doc"); |
| | | map.put("downloadName", name + ".doc"); |