新增lis ris报告生成通知相关数据获取接口。
This commit is contained in:
@@ -3,6 +3,7 @@ package com.joju.datamanager.service.impl;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.db.handler.BeanListHandler;
|
||||
import com.joju.datamanager.model.lisris.LisRis;
|
||||
import com.joju.datamanager.model.medicalprescription.MedicalPrescription;
|
||||
import com.joju.datamanager.model.viewmodel.PatientList;
|
||||
import com.joju.datamanager.service.HisViewSearchService;
|
||||
@@ -195,5 +196,84 @@ public class HisViewSearchServiceImpl implements HisViewSearchService {
|
||||
return medicalPrescriptions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LisRis> getLisRisReportStatus() {
|
||||
log.info("拼接数据");
|
||||
// String URL = "jdbc:sqlserver:thin:@//168.168.0.10:1433/THIS4";
|
||||
String URL = "jdbc:sqlserver://168.168.0.11:1433;databaseName=MIIS6.0";//ris
|
||||
String USER = "joju";
|
||||
String PASSWORD = "Joju@123";
|
||||
List<LisRis> lisRises = null;
|
||||
String today = DateUtil.today();
|
||||
DateTime tomorrow = DateUtil.tomorrow();
|
||||
String tomorrowStr = DateUtil.formatDate(tomorrow);
|
||||
// 1.加载驱动程序
|
||||
try {
|
||||
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
|
||||
// 2.获得数据库链接
|
||||
log.info("开始链接数据库");
|
||||
Connection conn = DriverManager.getConnection(URL, USER, PASSWORD);
|
||||
log.info("打印链接状态:" + conn);
|
||||
// 3.通过数据库的连接操作数据库,实现增删改查(使用Statement类)
|
||||
// SELECT
|
||||
// *
|
||||
//FROM
|
||||
// EXAM_RIS_BGZT
|
||||
//WHERE
|
||||
// bgfbsj BETWEEN '2024-04-17'
|
||||
// AND '2024-04-18'
|
||||
String sql = " SELECT * FROM EXAM_RIS_BGZT WHERE bgfbsj BETWEEN '" + today + "' and '" + tomorrowStr + "'";
|
||||
log.info("打印sql" + sql);
|
||||
Statement statement = conn.createStatement();
|
||||
ResultSet rs = statement.executeQuery(sql);
|
||||
log.info("返回结果是:" + rs);
|
||||
BeanListHandler<LisRis> lisRisBeanListHandler = new BeanListHandler<>(LisRis.class);
|
||||
lisRises.addAll(lisRisBeanListHandler.handle(rs));
|
||||
// 关闭资源【多谢指正】
|
||||
rs.close();
|
||||
statement.close();
|
||||
conn.close();
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String URL_LIS = "jdbc:sqlserver://168.168.0.11:1433;databaseName=DBLIS50";//ris
|
||||
String USER_LIS = "joju";
|
||||
String PASSWORD_LIS = "Joju@123";
|
||||
// 1.加载驱动程序
|
||||
try {
|
||||
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
|
||||
// 2.获得数据库链接
|
||||
log.info("开始链接数据库");
|
||||
Connection conn = DriverManager.getConnection(URL_LIS, USER_LIS, PASSWORD_LIS);
|
||||
log.info("打印链接状态:" + conn);
|
||||
// 3.通过数据库的连接操作数据库,实现增删改查(使用Statement类)
|
||||
// SELECT
|
||||
// *
|
||||
//FROM
|
||||
// EXAM_LIS_BGZT
|
||||
//WHERE
|
||||
// bgfbsj BETWEEN '2024-04-17'
|
||||
// AND '2024-04-18'
|
||||
String sql = " SELECT * FROM EXAM_LIS_BGZT WHERE bgfbsj BETWEEN '" + today + "' and '" + tomorrowStr + "'";
|
||||
log.info("打印sql" + sql);
|
||||
Statement statement = conn.createStatement();
|
||||
ResultSet rs = statement.executeQuery(sql);
|
||||
log.info("返回结果是:" + rs);
|
||||
BeanListHandler<LisRis> lisRisBeanListHandler = new BeanListHandler<>(LisRis.class);
|
||||
lisRises.addAll(lisRisBeanListHandler.handle(rs));
|
||||
// 关闭资源【多谢指正】
|
||||
rs.close();
|
||||
statement.close();
|
||||
conn.close();
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return lisRises;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user