| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.annotation.NotRepeatCommit; |
| | | import com.ruoyi.common.annotation.RepeatSubmit; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.ServiceDonateorganBase; |
| | | import com.ruoyi.project.domain.ServiceEthicalreviewinitiate; |
| | | import com.ruoyi.project.domain.ServiceEthicalreviewopinions; |
| | | import com.ruoyi.project.domain.vo.EthicalReviewVO; |
| | | import com.ruoyi.project.domain.vo.EthicalreviewopinionsStateTotalVO; |
| | | import com.ruoyi.project.domain.vo.EthicalreviewopinionsTotalVO; |
| | | import com.ruoyi.project.service.IServiceEthicalreviewinitiateService; |
| | | import com.ruoyi.project.service.IServiceEthicalreviewopinionsService; |
| | | import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | | import freemarker.template.TemplateException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.*; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 伦理审查专家意见Controller |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/project/ethicalreviewopinions") |
| | | @Api(description = "伦理审查专家意见",tags={"伦理审查专家意见"}) |
| | | public class ServiceEthicalreviewopinionsController extends BaseController { |
| | | @Autowired |
| | | private IServiceEthicalreviewopinionsService serviceEthicalreviewopinionsService; |
| | | |
| | | @Autowired |
| | | private IServiceEthicalreviewinitiateService serviceEthicalreviewinitiateService; |
| | | |
| | | @ApiOperation("查询伦理审查专家意见列表") |
| | | /** |
| | | * 查询伦理审查专家意见列表 |
| | | */ |
| | | //// @PreAuthorize("@ss.hasPermi('project:ethicalreviewopinions:list')") |
| | | @GetMapping("/list") |
| | | public Map<String, Object> list(ServiceEthicalreviewopinions serviceEthicalreviewopinions) { |
| | | serviceEthicalreviewopinionsService.updateTimeOut(); |
| | | Page<ServiceEthicalreviewopinions> list = serviceEthicalreviewopinionsService.queryListByPage(serviceEthicalreviewopinions); |
| | | return getDataTable(list.getRecords(), (int) list.getTotal()); |
| | | } |
| | | |
| | | @ApiOperation("查询捐献信息伦理审查专家意见列表") |
| | | @GetMapping("/listnew") |
| | | public TableDataInfo listnew(EthicalReviewVO ethicalReviewVO) { |
| | | startPage(); |
| | |
| | | // return util.exportExcel(list, "伦理审查专家意见数据"); |
| | | // } |
| | | |
| | | @ApiOperation("获取伦理审查专家意见详细信息") |
| | | /** |
| | | * 获取伦理审查专家意见详细信息 |
| | | */ |
| | |
| | | return AjaxResult.success(serviceEthicalreviewopinionsService.getById(id)); |
| | | } |
| | | |
| | | @ApiOperation("新增伦理审查专家意见") |
| | | /** |
| | | * 新增伦理审查专家意见 |
| | | */ |
| | | //// @PreAuthorize("@ss.hasPermi('project:ethicalreviewopinions:add')") |
| | | @Log(title = "伦理审查专家意见", businessType = BusinessType.INSERT) |
| | | @Log(title = "新增伦理审查专家意见", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody ServiceEthicalreviewopinions serviceEthicalreviewopinions) { |
| | | boolean save = serviceEthicalreviewopinionsService.save(serviceEthicalreviewopinions); |
| | | return AjaxResult.success(serviceEthicalreviewopinions); |
| | | } |
| | | |
| | | @ApiOperation("修改伦理审查专家意见") |
| | | /** |
| | | * 修改伦理审查专家意见 |
| | | */ |
| | |
| | | @PostMapping("/edit") |
| | | // @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody ServiceEthicalreviewopinions serviceEthicalreviewopinions) { |
| | | return toAjax(serviceEthicalreviewopinionsService.updateById(serviceEthicalreviewopinions)); |
| | | boolean res=serviceEthicalreviewopinionsService.updateById(serviceEthicalreviewopinions); |
| | | if(res&&serviceEthicalreviewopinions.getExpertType().equals("主任委员")&&serviceEthicalreviewopinions.getReceiveStatus().equals("5")){ |
| | | QueryWrapper<ServiceEthicalreviewinitiate> ethicalreviewinitiateQueryWrapper=new QueryWrapper<>(); |
| | | ethicalreviewinitiateQueryWrapper.eq("id",serviceEthicalreviewopinions.getNitiateId()); |
| | | ServiceEthicalreviewinitiate serviceEthicalreviewinitiate =new ServiceEthicalreviewinitiate(); |
| | | serviceEthicalreviewinitiate.setStatus("3"); |
| | | res=serviceEthicalreviewinitiateService.update(serviceEthicalreviewinitiate,ethicalreviewinitiateQueryWrapper); |
| | | } |
| | | return toAjax(res); |
| | | } |
| | | |
| | | @ApiOperation("删除伦理审查专家意见") |
| | | /** |
| | | * 删除伦理审查专家意见 |
| | | */ |
| | |
| | | */ |
| | | @ApiOperation("获取伦理审查专家数量") |
| | | @GetMapping(value = "/expertCount") |
| | | public AjaxResult count(Integer InfoID) { |
| | | public AjaxResult count(Integer nitiateId) { |
| | | QueryWrapper<ServiceEthicalreviewopinions> ethicalreviewopinionsWrapper=new QueryWrapper<>(); |
| | | ethicalreviewopinionsWrapper.eq("InfoID",InfoID); |
| | | ethicalreviewopinionsWrapper.eq("nitiate_Id",nitiateId); |
| | | long count =serviceEthicalreviewopinionsService.count(ethicalreviewopinionsWrapper); |
| | | return AjaxResult.success(count); |
| | | } |
| | |
| | | /** |
| | | * 获取伦理审查专家接收 |
| | | */ |
| | | @ApiOperation("获取伦理审查专家接收") |
| | | @ApiOperation("获取伦理审查专家状态") |
| | | @GetMapping("/receiveStatus") |
| | | public AjaxResult receiveStatus(Integer InfoID,String DonorNo) { |
| | | public AjaxResult receiveStatus(Integer nitiateId,String expertNo,String receiveStatus) { |
| | | QueryWrapper<ServiceEthicalreviewopinions> ethicalreviewopinionsWrapper=new QueryWrapper<>(); |
| | | ethicalreviewopinionsWrapper.eq("InfoID",InfoID).eq("DonorNo",DonorNo); |
| | | ethicalreviewopinionsWrapper.eq("nitiate_Id",nitiateId).eq("expert_no",expertNo); |
| | | ServiceEthicalreviewopinions serviceEthicalreviewopinions =new ServiceEthicalreviewopinions(); |
| | | serviceEthicalreviewopinions.setReceiveStatus("1"); |
| | | serviceEthicalreviewopinions.setReceiveStatus(receiveStatus); |
| | | return toAjax(serviceEthicalreviewopinionsService.update(serviceEthicalreviewopinions,ethicalreviewopinionsWrapper)); |
| | | } |
| | | |
| | | /** |
| | | * 获取伦理审查专家数量 |
| | | */ |
| | | |
| | | @ApiOperation("专家统计详情") |
| | | @GetMapping(value = "/expertTotal") |
| | | public AjaxResult expertTotal(String DonorNo) { |
| | | return AjaxResult.success(serviceEthicalreviewopinionsService.expertTotal(DonorNo)); |
| | | public Result<List<EthicalreviewopinionsTotalVO>> expertTotal(String expertNo) { |
| | | return Result.success(serviceEthicalreviewopinionsService.expertTotal(expertNo)) ; |
| | | } |
| | | |
| | | |
| | | @ApiOperation("专家状态统计") |
| | | @GetMapping(value = "/stateTotal") |
| | | public Result<List<EthicalreviewopinionsStateTotalVO>> stateTotal(String expertNo) { |
| | | return Result.success(serviceEthicalreviewopinionsService.stateTotal(expertNo)); |
| | | } |
| | | |
| | | /** |
| | | * 下载工作人员差旅费报销单 |
| | | */ |
| | | @ApiOperation("遗体器官获取伦理审查表") |
| | | @GetMapping(value = "/download") |
| | | public Result downloadInfo(String nitiateId) throws IOException { |
| | | if(ObjectUtils.isEmpty(nitiateId)){ |
| | | return Result.error("nitiateId伦理审查id不能为空"); |
| | | } |
| | | EthicalReviewVO reviewVO =new EthicalReviewVO(); |
| | | reviewVO.setNitiateId(nitiateId); |
| | | List<EthicalReviewVO> list = serviceEthicalreviewopinionsService.selectVOList(reviewVO); |
| | | if(list.size()==0){ |
| | | return Result.error("伦理审查id无相关数据"); |
| | | } |
| | | String filePath = getClass().getResource("/template/").getPath(); |
| | | if(filePath.substring(0,1).equals("/")) |
| | | filePath=filePath.substring(1); |
| | | String content =""; |
| | | Template t = null; |
| | | try { |
| | | content = Files.readString(Paths.get(filePath+"遗体器官获取伦理审查表首页.xml"), StandardCharsets.UTF_8); |
| | | String name=list.get(0).getName()+"(住院号:"+list.get(0).getInpatientno()+")"; |
| | | content=content.replace("$name",name);//项目名称 |
| | | content=content.replace("$inCount","16");//到会委员 |
| | | content=content.replace("$avoidCount","0");//回避委员 |
| | | content=content.replace("$agreeCount","15");//同意 |
| | | content=content.replace("$updateAgreeCount","2");//修改后同意 |
| | | content=content.replace("$disagreeCount","3");//不同意 |
| | | content=content.replace("$abstentionCount","4");//弃权 |
| | | String committeeOpinion=""; |
| | | for (EthicalReviewVO row:list) { |
| | | String State="",sgin="",id=row.getId()+"",expName=row.getExpertname(); |
| | | 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="修改后同意"; |
| | | 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" + |
| | | " <w:p wsp:rsidR=\"00425E28\" wsp:rsidRPr=\"00CB3FB5\" wsp:rsidRDefault=\"00425E28\" wsp:rsidP=\"006A1099\"><w:pPr></w:pPr></w:p>\n" + |
| | | " </w:tc>\n" + |
| | | " <w:tc><w:tcPr></w:tcPr>\n" + |
| | | " <w:p wsp:rsidR=\"00425E28\" wsp:rsidRPr=\"00CB3FB5\" wsp:rsidRDefault=\"00AC7CCA\" wsp:rsidP=\"00CB3FB5\">\n" + |
| | | " <w:r wsp:rsidRPr=\"00737357\">\n" + |
| | | " <w:t>【委员审批】"+expName+" "+State+" </w:t></w:r>\n" + |
| | | " </w:p>\n" + |
| | | " </w:tc>\n" + |
| | | " <w:tc><w:tcPr></w:tcPr>\n" + |
| | | " <w:p wsp:rsidR=\"00425E28\" wsp:rsidRPr=\"00CB3FB5\" wsp:rsidRDefault=\"00AC7CCA\" wsp:rsidP=\"00CB3FB5\">\n" + |
| | | " <w:r wsp:rsidRPr=\"00737357\">\n" + |
| | | " <w:t>签名:</w:t></w:r>\n" + |
| | | " <w:r wsp:rsidR=\"00421BE1\">\n" + |
| | | " <w:pict>\n" + |
| | | " <w:binData w:name=\"wordml://03000001.png\" xml:space=\"preserve\"> </w:binData>\n" + |
| | | " <v:shape style=\"width:50pt;height:20pt\"><v:imagedata src=\"wordml://03000001.png\" o:title=\"my签字\"/></v:shape>\n" + |
| | | " </w:pict>\n" + |
| | | " </w:r>\n" + |
| | | " </w:p>\n" + |
| | | " </w:tc>\n" + |
| | | " <w:tc><w:tcPr></w:tcPr>\n" + |
| | | " <w:p wsp:rsidR=\"00425E28\" wsp:rsidRPr=\"00CB3FB5\" wsp:rsidRDefault=\"00AC7CCA\" wsp:rsidP=\"00CB3FB5\">\n" + |
| | | " <w:r wsp:rsidRPr=\"00737357\"><w:t>2026-05-18 15:36:01</w:t></w:r></w:p>\n" + |
| | | " </w:tc>\n" + |
| | | " </w:tr>"; |
| | | committeeOpinion += " <w:p wsp:rsidR=\"00EE26D5\" wsp:rsidRPr=\"00737357\" wsp:rsidRDefault=\"0030540D\" wsp:rsidP=\"00EE26D5\"><w:pPr><w:rPr><w:rFonts w:ascii=\"宋体\" w:h-ansi=\"宋体\" w:cs=\"宋体\"/><wx:font\n" + |
| | | " wx:val=\"宋体\"/><w:sz-cs w:val=\"21\"/></w:rPr></w:pPr>\n" + |
| | | " <w:r wsp:rsidR=\"00EE26D5\" wsp:rsidRPr=\"00737357\" >\n" + |
| | | " <v:shape style=\"width:500pt;\"> <w:t>【委员审批】"+expName+" "+State+" </w:t></v:shape></w:r>\n" + |
| | | " <w:r wsp:rsidR=\"00EE26D5\" wsp:rsidRPr=\"00737357\">\n" + |
| | | " <w:t> 签名:</w:t></w:r>\n" + |
| | | " <w:r wsp:rsidR=\"00EE26D5\" wsp:rsidRPr=\"00737357\">\n" + |
| | | " <w:pict>\n" + |
| | | " <w:binData w:name=\"wordml://img"+id+".png\" xml:space=\"preserve\">"+sgin+" </w:binData>\n" + |
| | | " <v:shape id=\"_x0000_"+id+"\" type=\"#_x0000_t75\" style=\"width:50pt;height:20pt\"><v:imagedata src=\"wordml://_x0000_"+id+".png\" o:title=\"签字\"/></v:shape></w:pict></w:r>\n" + |
| | | " <w:r wsp:rsidR=\"00737357\" wsp:rsidRPr=\"00737357\">\n" + |
| | | " <w:t> "+ DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",row.getConclusiontime())+"</w:t></w:r></w:p>"; |
| | | } |
| | | content=content.replace("$committeeOpinion",committeeOpinion);//委员会意见 |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String newTime = String.valueOf(Calendar.getInstance().getTimeInMillis()); |
| | | String name = "遗体器官获取伦理审查表_"+nitiateId+"_" + newTime; |
| | | |
| | | String filePathData =RuoYiConfig.getProfile() + "/download/wordtemplate"; |
| | | //创建文件夹 |
| | | File folderPath = new File(filePathData); |
| | | if (!folderPath.exists()) { |
| | | folderPath.mkdirs(); |
| | | } |
| | | |
| | | try { |
| | | Files.writeString(Paths.get(filePathData+ "/" + name + ".doc"),content); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("downloadUrl", "/download/wordtemplate/" + name + ".doc"); |
| | | map.put("downloadName", name + ".doc"); |
| | | return Result.success(map); |
| | | } |
| | | } |