feat:心电报告的查询参数处理

master
wyb 3 months ago
parent bbc3bfff82
commit 240d166ae4

@ -48,7 +48,10 @@
//0 1: 0: //0 1: 0:
"intervalDayOpen": "1", "intervalDayOpen": "1",
//pacs //pacs
"intervalDay":3 "intervalDay":3,
//
"ecgAdmissDateHours": 6,
//
"ecgDisDateHours": 60
} }

@ -9,12 +9,6 @@ import com.docus.bgts.facade.IBgtsService;
import com.docus.bgts.service.CheckIntegrityService; import com.docus.bgts.service.CheckIntegrityService;
import com.docus.bgts.utils.FileUtils; import com.docus.bgts.utils.FileUtils;
import com.docus.bgts.utils.HttpUtils; import com.docus.bgts.utils.HttpUtils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ThreadPoolExecutor;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -22,6 +16,13 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ThreadPoolExecutor;
@Component @Component
public class MyScheduling { public class MyScheduling {
@Value("${beat.url}") @Value("${beat.url}")
@ -73,7 +74,7 @@ public class MyScheduling {
public static Map<String, String> getDateCollectionTime(Date date, int day) { public static Map<String, String> getDateCollectionTime(Date date, int day) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(date); calendar.setTime(date);
calendar.add(5, -day); calendar.add(Calendar.DATE, -day);
Date dBefore = calendar.getTime(); Date dBefore = calendar.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String defaultStartDate = sdf.format(dBefore); String defaultStartDate = sdf.format(dBefore);

@ -27,6 +27,18 @@ import com.docus.bgts.utils.FileUtils;
import com.docus.bgts.utils.HttpUtils; import com.docus.bgts.utils.HttpUtils;
import com.docus.bgts.utils.SnowflakeIdWorker; import com.docus.bgts.utils.SnowflakeIdWorker;
import com.docus.bgts.utils.XmlUtils; import com.docus.bgts.utils.XmlUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dom4j.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -40,17 +52,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.dom4j.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@Service @Service
public class BgtsServiceImpl implements IBgtsService { public class BgtsServiceImpl implements IBgtsService {
@ -507,17 +508,34 @@ public class BgtsServiceImpl implements IBgtsService {
return map; return map;
} }
public static void main(String[] args) {
getSmCollectionTimeEcg("2025-01-01 16:00:02", "2025-01-05 14:20:02");
System.out.println( getSmCollectionTimeEcg("2025-01-01 16:00:02", "2025-01-05 14:20:02"));
}
public static Map<String, String> getSmCollectionTimeEcg(String admissDate, String disDate) { public static Map<String, String> getSmCollectionTimeEcg(String admissDate, String disDate) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
Map<String, String> map = new HashMap(); Map<String, String> map = new HashMap();
try { try {
int admissDateAmountHours = 6;
int disDateAmountHours = 30;
Object ecgAdmissDateHours = FileUtils.getJsonByName("ecgAdmissDateHours");
Object ecgDisDateHours = FileUtils.getJsonByName("ecgDisDateHours");
if (ecgAdmissDateHours != null) {
admissDateAmountHours = Integer.parseInt(ecgAdmissDateHours.toString());
}
if (ecgDisDateHours != null) {
disDateAmountHours = Integer.parseInt(ecgDisDateHours.toString());
}
calendar.setTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(admissDate)); calendar.setTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(admissDate));
calendar.add(10, -6); calendar.add(Calendar.HOUR, -admissDateAmountHours);
Date dBefore = calendar.getTime(); Date dBefore = calendar.getTime();
Calendar calendar1 = Calendar.getInstance(); Calendar calendar1 = Calendar.getInstance();
calendar1.setTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(disDate)); calendar1.setTime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(disDate));
calendar1.add(10, 30); calendar1.add(Calendar.HOUR, disDateAmountHours);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String defaultStartDate = sdf.format(dBefore); String defaultStartDate = sdf.format(dBefore);
String defaultEndDate = sdf.format(calendar1.getTime()); String defaultEndDate = sdf.format(calendar1.getTime());

Loading…
Cancel
Save