|
|
|
@ -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<String> 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<String> filterReportSet = new HashSet<>();
|
|
|
|
|
Collections.addAll(filterReportSet, filterReports);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map> 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<ReportDownScanFileDto> 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"));
|
|
|
|
|