定时任务添加条件,配置文件里配置的科室不下载文件

master
xuhaoxiang 4 years ago
parent 6e3eacb6c9
commit e2fc1b7e3b

@ -15,6 +15,7 @@ import com.ann.utils.*;
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 java.io.File; import java.io.File;
@ -44,6 +45,17 @@ public class QueueService {
@Autowired @Autowired
MessageService messageService; 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 { public void doSomething(List<MessageSubordinate> all) throws Exception {
if (all.size() > 0) { if (all.size() > 0) {
@ -209,8 +221,10 @@ public class QueueService {
tempPath = messageDto.getDetailType() + "~" + messageDto.getCaptionDateTime() + "~"; tempPath = messageDto.getDetailType() + "~" + messageDto.getCaptionDateTime() + "~";
} }
} }
File pdfFile =null;
File pdfFile = FileUtils.createFile("pdfs", messageDto.getInpNo(), messageDto.getVisitId(), archiveDetail.getId(), tempPath); if(!Objects.equals(archiveMaster.getDeptName(),deptName)) {
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")) {
String path = DownloadUtils.downLoadPdfFile(pdfFile, address, messageDto.getType()); String path = DownloadUtils.downLoadPdfFile(pdfFile, address, messageDto.getType());

Loading…
Cancel
Save