|
|
|
@ -81,6 +81,72 @@ public class BgtsServiceImpl implements IBgtsService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private DownloadPlatformRpc downloadPlatformRpc;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void collectSealIcu(String sealId) throws Exception {
|
|
|
|
|
TSeal seal = getSealAndCheckBySealId(sealId);
|
|
|
|
|
String jzh = seal.getJzh();
|
|
|
|
|
|
|
|
|
|
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
|
|
|
|
|
String assortid = String.valueOf(FileUtils.getJsonByName("assortid"));
|
|
|
|
|
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 indexFlagField = String.valueOf(FileUtils.getJsonByName("indexFlag"));
|
|
|
|
|
String serialnumField = String.valueOf(FileUtils.getJsonByName("serialnum"));
|
|
|
|
|
//String filetitle = String.valueOf(FileUtils.getJsonByName("filetitle"));
|
|
|
|
|
String downurlField = String.valueOf(FileUtils.getJsonByName("downurl"));
|
|
|
|
|
String inPatientNoField = String.valueOf(FileUtils.getJsonByName("inPatientNo"));
|
|
|
|
|
String visitIdField = String.valueOf(FileUtils.getJsonByName("visitId"));
|
|
|
|
|
String inJzhField = String.valueOf(FileUtils.getJsonByName("jzh"));
|
|
|
|
|
|
|
|
|
|
List<String> fieldArr = new ArrayList<>();
|
|
|
|
|
fieldArr.add(indexFlagField);
|
|
|
|
|
fieldArr.add(serialnumField);
|
|
|
|
|
fieldArr.add(inPatientNoField);
|
|
|
|
|
fieldArr.add(visitIdField);
|
|
|
|
|
fieldArr.add(inJzhField);
|
|
|
|
|
// if(StringUtils.isNotBlank(filetitle)){
|
|
|
|
|
// fieldArr.add(filetitle);
|
|
|
|
|
// }
|
|
|
|
|
fieldArr.add(downurlField);
|
|
|
|
|
String namespace = String.valueOf(FileUtils.getJsonByName("namespace"));
|
|
|
|
|
String tableName = String.valueOf(FileUtils.getJsonByName("tableName"));
|
|
|
|
|
// String collectTimeName = String.valueOf(FileUtils.getJsonByName("collectTimeName"));
|
|
|
|
|
|
|
|
|
|
List<Map> viewDataList = vDocumentPdfMapper.collectByJzh(inJzhField, 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 vieData : viewDataList) {
|
|
|
|
|
ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto();
|
|
|
|
|
reportDownPatientDto.setPatientid(seal.getPatientId());
|
|
|
|
|
|
|
|
|
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
|
|
|
|
reportDownScanFileDto.setDownurl(String.valueOf(vieData.get(downurlField)));
|
|
|
|
|
reportDownScanFileDto.setFilestoragetype(filestoragetype);
|
|
|
|
|
reportDownScanFileDto.setFilesource(filesource);
|
|
|
|
|
//reportDownScanFileDto.setFiletitle(map.get(filetitle)==null?"重症"+(System.currentTimeMillis()):String.valueOf(map.get(filetitle)));
|
|
|
|
|
reportDownScanFileDto.setFiletitle(StringUtils.isNotBlank(String.valueOf(vieData.get(serialnumField))) ? String.valueOf(vieData.get(serialnumField)) : String.valueOf(idWorker.nextId()));
|
|
|
|
|
reportDownScanFileDto.setSerialnum(StringUtils.isNotBlank(String.valueOf(vieData.get(serialnumField))) ? String.valueOf(vieData.get(serialnumField)) : 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.insertServer(reportDownDto);
|
|
|
|
|
downloadPlatformRpc.sealReport(reportDownDto);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void collect(String empId) throws Exception {
|
|
|
|
|
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
|
|
|
|
|