接收电子病历消息接口优化

master
xuhaoxiang 4 years ago
parent 3df646a1f9
commit 1676d92384

@ -29,6 +29,8 @@ public interface ArchiveDetailRepository extends JpaRepository<ArchiveDetail, St
public ArchiveDetail findByMasterIDAndAssortIDAndSourceAndCheckReportIdAndFlag(String masterId, String AssortID, String source, String checkReportId,String flag);
@Query("select count (o) from ArchiveDetail o where o.masterID = ?1 and o.assortID = ?2 and o.title=?3 and o.flag = 0 ")
Integer countByMasterIDAndAssortIDAndTitleAndFlag(String masterId, String AssortID, String title);
// @Query(value = "SELECT stuff(" +
// " (SELECT ',' + CONVERT(VARCHAR,a.assort_name) " +

@ -19,6 +19,8 @@ public interface ArchiveDetailService {
public ArchiveDetail isExitCheckReportId(String id, String type, String source, String checkReportId) throws Exception;
public Integer countByMasterIDAndAssortIDAndTitleAndFlag(String masterId, String AssortID, String title) throws Exception;
// public String getTypeNotExits(List<String> type, String masterId);
// public String checkExamApply(String masterId) throws Exception;

@ -46,6 +46,11 @@ public class ArchiveDetailServiceImpl implements ArchiveDetailService {
return null;
}
@Override
public Integer countByMasterIDAndAssortIDAndTitleAndFlag(String masterId, String AssortID,String title) throws Exception {
return archiveDetailRepository.countByMasterIDAndAssortIDAndTitleAndFlag(masterId, AssortID, title);
}
// @Override
// public String getTypeNotExits(List<String> type, String masterId) {
// return archiveDetailRepository.getTypeNotExits(type, masterId);

@ -44,18 +44,6 @@ public class QueueService {
ArchiveDetailService archiveDetailService;
@Autowired
MessageService messageService;
public static String deptName;
@Value("${dept.deptName}")
public void setDeptName(String deptName) {
QueueService.deptName = deptName;
}
public static String getDeptName() {
return deptName;
}
//---------------------定时器
public void doSomething(List<MessageSubordinate> all) throws Exception {
if (all.size() > 0) {
@ -221,24 +209,7 @@ public class QueueService {
tempPath = messageDto.getDetailType() + "~" + messageDto.getCaptionDateTime() + "~";
}
}
File pdfFile =null;
boolean flag=true;
if(deptName.indexOf(",")!=-1){
String[] deptList=deptName.split(",");
for(int i=0;i<deptList.length;i++){
if(archiveMaster.getDeptName().equals(deptList[i])){
flag=false;
break;
}
}
}else{
if(archiveMaster.getDeptName().equals(deptName)){
flag=false;
}
}
if(flag) {
pdfFile = FileUtils.createFile("pdfs", messageDto.getInpNo(), messageDto.getVisitId(), archiveDetail.getId(), tempPath);
}
File pdfFile = FileUtils.createFile("pdfs", messageDto.getInpNo(), messageDto.getVisitId(), archiveDetail.getId(), tempPath);
if (pdfFile != null) {
if (address.endsWith(".pdf") || address.endsWith(".PDF")) {
String path = DownloadUtils.downLoadPdfFile(pdfFile, address, messageDto.getType());
@ -292,6 +263,12 @@ public class QueueService {
// 转成格式
archiveDetail.setPageNumber(pageNum);
archiveDetail.setPdfPath(pdfPath);
int i=archiveDetailService.countByMasterIDAndAssortIDAndTitleAndFlag(archiveDetail.getMasterID(),archiveDetail.getAssortID(),archiveDetail.getTitle());
//如果detail表有重复的分段数据则把falg改为55为没人使用的自定义数字同时修改修改完整性接口的sql
if(archiveDetailService.countByMasterIDAndAssortIDAndTitleAndFlag(archiveDetail.getMasterID(),archiveDetail.getAssortID(),archiveDetail.getTitle())>1)
{
archiveDetail.setFlag("5");
}
archiveDetailService.save(archiveDetail);
//更新messageLog的最后执行时间

Loading…
Cancel
Save