|
|
@ -9,15 +9,14 @@ import com.ann.entity.filing.dto.MessageDto;
|
|
|
|
import com.ann.entity.interfaceEntity.ArchiveMaster;
|
|
|
|
import com.ann.entity.interfaceEntity.ArchiveMaster;
|
|
|
|
import com.ann.entity.interfaceEntity.InterfaceHisCache;
|
|
|
|
import com.ann.entity.interfaceEntity.InterfaceHisCache;
|
|
|
|
import com.ann.entity.interfaceEntity.MessageLog;
|
|
|
|
import com.ann.entity.interfaceEntity.MessageLog;
|
|
|
|
import com.ann.entity.interfaceEntity.ScanningFile;
|
|
|
|
|
|
|
|
import com.ann.service.*;
|
|
|
|
import com.ann.service.*;
|
|
|
|
import com.ann.utils.*;
|
|
|
|
import com.ann.utils.*;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import org.springframework.util.StopWatch;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
@ -49,6 +48,9 @@ public class QueueService {
|
|
|
|
public void doSomething(List<MessageSubordinate> all) throws Exception {
|
|
|
|
public void doSomething(List<MessageSubordinate> all) throws Exception {
|
|
|
|
if (all.size() > 0) {
|
|
|
|
if (all.size() > 0) {
|
|
|
|
for (MessageSubordinate messageSubordinate : all) {
|
|
|
|
for (MessageSubordinate messageSubordinate : all) {
|
|
|
|
|
|
|
|
//获取消息id
|
|
|
|
|
|
|
|
String messageId = messageSubordinate.getMessageId();
|
|
|
|
|
|
|
|
logger.error("下载消息id:" + messageId);
|
|
|
|
Integer status = 2;
|
|
|
|
Integer status = 2;
|
|
|
|
ArchiveDetail archiveDetail = null;
|
|
|
|
ArchiveDetail archiveDetail = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -65,6 +67,7 @@ public class QueueService {
|
|
|
|
ArchiveMaster archiveMaster = archiveMasterService.findByInpNoAndVisitIdAndIsValid(messageDto.getInpNo(), messageDto.getVisitId());
|
|
|
|
ArchiveMaster archiveMaster = archiveMasterService.findByInpNoAndVisitIdAndIsValid(messageDto.getInpNo(), messageDto.getVisitId());
|
|
|
|
Date date = new Date();
|
|
|
|
Date date = new Date();
|
|
|
|
if (archiveMaster != null) {
|
|
|
|
if (archiveMaster != null) {
|
|
|
|
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
|
/**2021-1-26 等lis程序升级 去掉*/
|
|
|
|
/**2021-1-26 等lis程序升级 去掉*/
|
|
|
|
if (Objects.equals(messageDto.getType(), AliasName.INSPECTION_REPORT) && archiveMaster.getArchiveState().equals("已归档")){
|
|
|
|
if (Objects.equals(messageDto.getType(), AliasName.INSPECTION_REPORT) && archiveMaster.getArchiveState().equals("已归档")){
|
|
|
|
messageSubordinate.setStatus(3);
|
|
|
|
messageSubordinate.setStatus(3);
|
|
|
@ -105,8 +108,10 @@ public class QueueService {
|
|
|
|
messageSubordinateService.save(messageSubordinate);
|
|
|
|
messageSubordinateService.save(messageSubordinate);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.error("各种已归档保存信息耗时:"+(System.currentTimeMillis() - start));
|
|
|
|
String address = messageDto.getReportAddress();
|
|
|
|
String address = messageDto.getReportAddress();
|
|
|
|
if (address != null && (!address.equals(""))) {
|
|
|
|
if (address != null && (!address.equals(""))) {
|
|
|
|
|
|
|
|
long start1 = System.currentTimeMillis();
|
|
|
|
// 如果是老数据
|
|
|
|
// 如果是老数据
|
|
|
|
if (Objects.equals(messageDto.getIsOld(), "0")) {
|
|
|
|
if (Objects.equals(messageDto.getIsOld(), "0")) {
|
|
|
|
archiveDetail = new ArchiveDetail(archiveMaster.getId(), date, messageDto.getType(), messageDto.getSource(), messageDto.getApplyId(), messageDto.getDetailType(), 1);
|
|
|
|
archiveDetail = new ArchiveDetail(archiveMaster.getId(), date, messageDto.getType(), messageDto.getSource(), messageDto.getApplyId(), messageDto.getDetailType(), 1);
|
|
|
@ -178,9 +183,11 @@ public class QueueService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.error("保存文件数据耗时:"+(System.currentTimeMillis() - start1));
|
|
|
|
String pdfPath = null;
|
|
|
|
String pdfPath = null;
|
|
|
|
String tempPath = "";
|
|
|
|
String tempPath = "";
|
|
|
|
Integer pageNum = 1;
|
|
|
|
Integer pageNum = 1;
|
|
|
|
|
|
|
|
long start2 = System.currentTimeMillis();
|
|
|
|
if (messageDto.getSource().equals(InterfaceName.NURSE_DATA)) {
|
|
|
|
if (messageDto.getSource().equals(InterfaceName.NURSE_DATA)) {
|
|
|
|
// 护理单独做处理
|
|
|
|
// 护理单独做处理
|
|
|
|
boolean saveFlag = false;
|
|
|
|
boolean saveFlag = false;
|
|
|
@ -251,6 +258,8 @@ public class QueueService {
|
|
|
|
tempPath = messageDto.getDetailType() + "~" + messageDto.getCaptionDateTime() + "~";
|
|
|
|
tempPath = messageDto.getDetailType() + "~" + messageDto.getCaptionDateTime() + "~";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.error("医生或护士提交保存耗时:"+(System.currentTimeMillis() - start2));
|
|
|
|
|
|
|
|
long start3 = System.currentTimeMillis();
|
|
|
|
File 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 (pdfFile != null) {
|
|
|
|
if (address.endsWith(".pdf") || address.endsWith(".PDF")) {
|
|
|
|
if (address.endsWith(".pdf") || address.endsWith(".PDF")) {
|
|
|
@ -329,6 +338,7 @@ public class QueueService {
|
|
|
|
archiveDetailService.delete(archiveDetail.getId());
|
|
|
|
archiveDetailService.delete(archiveDetail.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.error("文件下载耗时:"+(System.currentTimeMillis() - start3));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
messageSubordinate.setRemark("地址为空。。。。");
|
|
|
|
messageSubordinate.setRemark("地址为空。。。。");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -336,7 +346,6 @@ public class QueueService {
|
|
|
|
messageSubordinate.setRemark("住院号为:" + messageDto.getInpNo() + "的ArchiveMaster为空。。。。");
|
|
|
|
messageSubordinate.setRemark("住院号为:" + messageDto.getInpNo() + "的ArchiveMaster为空。。。。");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
@ -348,6 +357,7 @@ public class QueueService {
|
|
|
|
archiveDetailService.delete(archiveDetail.getId());
|
|
|
|
archiveDetailService.delete(archiveDetail.getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.error("messageId:"+messageId+"报错了:" ,e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
messageSubordinate.setStatus(status);
|
|
|
|
messageSubordinate.setStatus(status);
|
|
|
|
|
|
|
|
|
|
|
|