|
|
|
@ -17,8 +17,7 @@ import org.springframework.context.ApplicationContext;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.concurrent.locks.Lock;
|
|
|
|
|
import java.util.concurrent.locks.ReentrantLock;
|
|
|
|
@ -78,7 +77,7 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
}
|
|
|
|
|
String bufferDownUrl = bufferInfo.getDownUrl();
|
|
|
|
|
String serialnum = bufferInfo.getSerialnum();
|
|
|
|
|
// 设置地址或者文件信息
|
|
|
|
|
// 设置地址或者文件信息
|
|
|
|
|
if (isSaveOrUpdateDownloadUrl) {
|
|
|
|
|
bufferInfo.setFileUrl(reportDto);
|
|
|
|
|
} else {
|
|
|
|
@ -90,6 +89,7 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
if (canReport) {
|
|
|
|
|
afReportRecordMapper.cancelBlocking(bufferInfo.getId());
|
|
|
|
|
ReportDto dto = new ReportDto(bufferInfo);
|
|
|
|
|
dto.setMergeFileTitle(true);
|
|
|
|
|
report(dto);
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
@ -106,6 +106,17 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
String fileTitleSeparator = "|";
|
|
|
|
|
String fileTitle = "a1";
|
|
|
|
|
String lastFileName = "a0|a2";
|
|
|
|
|
String[] fileTitles = lastFileName.split("\\|");
|
|
|
|
|
HashSet<String> fileTitleSet = new LinkedHashSet<>();
|
|
|
|
|
Collections.addAll(fileTitleSet, fileTitles);
|
|
|
|
|
fileTitleSet.add(fileTitle);
|
|
|
|
|
System.out.println(String.join("|", fileTitleSet));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void threePartyPushReports(ReportDto reportDto) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -114,7 +125,7 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
// 如果出现多条出错的情况,还是得保存收到的信息,人工干预处理
|
|
|
|
|
patientId = tBasicMapper.getPatientIdByInpatientNoAndAdminssTimes(reportDto.getInpatientNo(), reportDto.getAdmisstimes());
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error("查询病案主键出错了,病案号:"+reportDto.getInpatientNo()+" ,住院次数:"+reportDto.getAdmisstimes(), ex);
|
|
|
|
|
log.error("查询病案主键出错了,病案号:" + reportDto.getInpatientNo() + " ,住院次数:" + reportDto.getAdmisstimes(), ex);
|
|
|
|
|
}
|
|
|
|
|
// 不验证数据,始终保存收到的信息
|
|
|
|
|
AfReportRecord afReportRecord = afReportRecordMapper.getRecordBySerialnumAndInpatientNoAndSysFlag(reportDto.getSerialnum(), reportDto.getInpatientNo(), reportDto.getAdmisstimes(), reportDto.getSysFlag());
|
|
|
|
@ -125,10 +136,21 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
afReportRecord.setPatientId(patientId);
|
|
|
|
|
afReportRecordMapper.saveRecord(afReportRecord);
|
|
|
|
|
} else {
|
|
|
|
|
// 如果要合并文件标题
|
|
|
|
|
String fileTitle = reportDto.getFileTitle();
|
|
|
|
|
if (reportDto.isMergeFileTitle()) {
|
|
|
|
|
String lastFileName = afReportRecord.getFileName();
|
|
|
|
|
String[] fileTitles = lastFileName.split("\\|");
|
|
|
|
|
HashSet<String> fileTitleSet = new LinkedHashSet<>();
|
|
|
|
|
Collections.addAll(fileTitleSet, fileTitles);
|
|
|
|
|
fileTitleSet.add(fileTitle);
|
|
|
|
|
fileTitle = String.join("|", fileTitleSet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新 主要更新 url
|
|
|
|
|
afReportRecord.setDownUrl(reportDto.getDownUrl());
|
|
|
|
|
afReportRecord.setDownType(reportDto.getDowntype());
|
|
|
|
|
afReportRecord.setFileName(reportDto.getFileTitle());
|
|
|
|
|
afReportRecord.setFileName(fileTitle);
|
|
|
|
|
afReportRecord.setPatientId(patientId);
|
|
|
|
|
afReportRecord.setZdAssortId(reportDto.getAssortId());
|
|
|
|
|
afReportRecordMapper.updateRecordByTaskId(afReportRecord);
|
|
|
|
|