From 15c550a9246557c26be8057fcdabcff7f5919872 Mon Sep 17 00:00:00 2001 From: wyb <1977763549@qq.com> Date: Thu, 11 Jan 2024 17:52:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=B0=81=E5=AD=98?= =?UTF-8?q?=E7=97=85=E6=A1=88=20=E6=89=8B=E9=BA=BB=20=E7=97=85=E5=8E=86?= =?UTF-8?q?=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SealReportCollectController.java | 18 +++++ .../com/docus/bgts/facade/IBgtsService.java | 8 +++ .../docus/bgts/service/BgtsServiceImpl.java | 72 +++++++++++++++++++ 3 files changed, 98 insertions(+) diff --git a/src/main/java/com/docus/bgts/controller/SealReportCollectController.java b/src/main/java/com/docus/bgts/controller/SealReportCollectController.java index 1828d2b..890f290 100644 --- a/src/main/java/com/docus/bgts/controller/SealReportCollectController.java +++ b/src/main/java/com/docus/bgts/controller/SealReportCollectController.java @@ -104,4 +104,22 @@ public class SealReportCollectController { } + @ApiOperation("手麻采集接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "sealId", value = "t_seal 的seal_id,封存id", required = true, dataTypeClass = String.class) + }) + @GetMapping("/surgicalAnesthesia") + public CommonResult collectSealSurgicalAnesthesia(@RequestParam("sealId") String sealId) { + log.info("封存病案采集 手麻 病历,封存id为:{}", sealId); + try { + bgtsService.collectSealSurgicalAnesthesia(sealId); + log.info("封存病案采集 手麻 病历,封存id:{} 采集完成", sealId); + return CommonResult.success("采集完成"); + } catch (Exception e) { + log.error("封存id:" + sealId + " 封存病案采集 手麻 病历,出现异常!", e); + return CommonResult.failed(e.getMessage()); + } + } + + } diff --git a/src/main/java/com/docus/bgts/facade/IBgtsService.java b/src/main/java/com/docus/bgts/facade/IBgtsService.java index 2c73b83..d79b154 100644 --- a/src/main/java/com/docus/bgts/facade/IBgtsService.java +++ b/src/main/java/com/docus/bgts/facade/IBgtsService.java @@ -8,6 +8,14 @@ public interface IBgtsService { */ void collectSealIcu(String sealId) throws Exception; + /** + * 根据封存id进行封存病案的手麻病历采集 + * @date 2024/1/11 10:27 + * @author YongBin Wen + * @param sealId 封存id + */ + void collectSealSurgicalAnesthesia(String sealId) throws Exception; + /** * 采集 * @param empId diff --git a/src/main/java/com/docus/bgts/service/BgtsServiceImpl.java b/src/main/java/com/docus/bgts/service/BgtsServiceImpl.java index 1671e59..6141c2b 100644 --- a/src/main/java/com/docus/bgts/service/BgtsServiceImpl.java +++ b/src/main/java/com/docus/bgts/service/BgtsServiceImpl.java @@ -147,6 +147,78 @@ public class BgtsServiceImpl implements IBgtsService { } } + + @Override + public void collectSealSurgicalAnesthesia(String sealId) throws Exception { + TSeal seal = getSealAndCheckBySealId(sealId); + String jzh = seal.getJzh(); + + String assortid = String.valueOf(FileUtils.getJsonByName("assortid")); + String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid")); + int filesource = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))); + int filestoragetype = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))); + SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0); + String indexFlag = String.valueOf(FileUtils.getJsonByName("indexFlag")); + String serialnum = String.valueOf(FileUtils.getJsonByName("serialnum")); + String filetitle = String.valueOf(FileUtils.getJsonByName("filetitle")); + String downurl = String.valueOf(FileUtils.getJsonByName("downurl")); + List fieldArr = new ArrayList<>(); + fieldArr.add(indexFlag); + fieldArr.add(serialnum); + if (StringUtils.isNotBlank(filetitle)) { + fieldArr.add(filetitle); + } + fieldArr.add(downurl); + String namespace = String.valueOf(FileUtils.getJsonByName("namespace")); + String tableName = String.valueOf(FileUtils.getJsonByName("tableName")); +// String collectTimeName = String.valueOf(FileUtils.getJsonByName("collectTimeName")); + + // 获取过滤报告单 + String[] filterReports = String.valueOf(FileUtils.getJsonByName("filterReport")).split(","); + HashSet filterReportSet = new HashSet<>(); + Collections.addAll(filterReportSet, filterReports); + + + List viewDataList = vDocumentPdfMapper.collectByJzh(indexFlag, jzh, namespace, tableName, fieldArr); + if (CollUtil.isEmpty(viewDataList)) { + logger.info("封存id:{} ,根据记账号:{},采集手麻视图:{}:,没有采集到数据!", sealId, jzh, namespace + "." + tableName); + return; + } + logger.info("封存id:{} ,根据记账号:{},采集手麻视图:{}:,数据为:{}", sealId, jzh, namespace + "." + tableName, JSON.toJSON(viewDataList)); + + + for (Map map : viewDataList) { + String reportFileTitle = String.valueOf(map.get(filetitle)); + // 如果存在过滤报告单名单,不采集; + if (filterReportSet.contains(reportFileTitle)) { + continue; + } + ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto(); + reportDownPatientDto.setPatientid(seal.getPatientId()); + + ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto(); + reportDownScanFileDto.setDownurl(String.valueOf(map.get(downurl))); + reportDownScanFileDto.setFilestoragetype(filestoragetype); + reportDownScanFileDto.setFilesource(filesource); + reportDownScanFileDto.setFiletitle(map.get(filetitle) == null ? "重症" + (System.currentTimeMillis()) : reportFileTitle); + reportDownScanFileDto.setSerialnum(StringUtils.isNotBlank(String.valueOf(map.get(serialnum))) ? String.valueOf(map.get(serialnum)) : String.valueOf(idWorker.nextId())); + + List reportDownScanFileDtos = Collections.singletonList(reportDownScanFileDto); + + ReportDownDto reportDownDto = new ReportDownDto(); + reportDownDto.setCollectorid(collectorid); + reportDownDto.setAssortid(assortid); + reportDownDto.setPatient(reportDownPatientDto); + reportDownDto.setScanfiles(reportDownScanFileDtos); + + afCollectTaskService.insert(reportDownDto); + //String uploadConnector = String.valueOf(FileUtils.getJsonByName("uploadConnector")); + // 调用封存病案上报接口 + downloadPlatformRpc.sealReport(reportDownDto); + + } + } + @Override public void collect(String empId) throws Exception { String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));