新增lis ris报告生成通知相关数据获取接口。
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import com.joju.datamanager.common.annotation.EleganceLog;
|
import com.joju.datamanager.common.annotation.EleganceLog;
|
||||||
import com.joju.datamanager.common.result.Result;
|
import com.joju.datamanager.common.result.Result;
|
||||||
import com.joju.datamanager.common.result.ResultUtil;
|
import com.joju.datamanager.common.result.ResultUtil;
|
||||||
|
import com.joju.datamanager.model.lisris.LisRis;
|
||||||
import com.joju.datamanager.model.medicalprescription.MedicalPrescription;
|
import com.joju.datamanager.model.medicalprescription.MedicalPrescription;
|
||||||
import com.joju.datamanager.model.viewmodel.PatientList;
|
import com.joju.datamanager.model.viewmodel.PatientList;
|
||||||
import com.joju.datamanager.service.HisViewSearchService;
|
import com.joju.datamanager.service.HisViewSearchService;
|
||||||
@@ -61,6 +62,7 @@ public class HisViewSearchController {
|
|||||||
}
|
}
|
||||||
return ResultUtil.failureMsg("未获取到数据");
|
return ResultUtil.failureMsg("未获取到数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取今天的遗嘱开单信息
|
* 获取今天的遗嘱开单信息
|
||||||
*
|
*
|
||||||
@@ -84,4 +86,13 @@ public class HisViewSearchController {
|
|||||||
return ResultUtil.successData(medicalPrescriptions);
|
return ResultUtil.successData(medicalPrescriptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getLisRisReportStatus")
|
||||||
|
@EleganceLog(description = "获取lis和ris报告状态")
|
||||||
|
public Result getLisRisReportStatus() {
|
||||||
|
List<LisRis> lisRises = hisViewSearchService.getLisRisReportStatus();
|
||||||
|
if (!CollUtil.isEmpty(lisRises)) {
|
||||||
|
return ResultUtil.successData(lisRises);
|
||||||
|
}
|
||||||
|
return ResultUtil.failureMsg("获取失败!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.joju.datamanager.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.joju.datamanager.common.result.Result;
|
||||||
|
import com.joju.datamanager.common.result.ResultUtil;
|
||||||
|
import com.joju.datamanager.model.lisris.LisRis;
|
||||||
|
import com.joju.datamanager.service.LisRisService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: lisris报告接口
|
||||||
|
* @author: Mr.zs
|
||||||
|
* @create: 2024-04-17 12:28
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/lisRis")
|
||||||
|
public class LisRisController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
LisRisService lisRisService;
|
||||||
|
|
||||||
|
@GetMapping("/getLisRis")
|
||||||
|
public Result getLisRis() {
|
||||||
|
String today = DateUtil.today();
|
||||||
|
DateTime tomorrow = DateUtil.tomorrow();
|
||||||
|
String tomorrowStr = DateUtil.formatDate(tomorrow);
|
||||||
|
List<LisRis> lisRises = lisRisService.list(new QueryWrapper<LisRis>().between("bgfbsj", today, tomorrowStr));
|
||||||
|
if (CollUtil.isNotEmpty(lisRises)) {
|
||||||
|
return ResultUtil.successData(lisRises);
|
||||||
|
}
|
||||||
|
return ResultUtil.failureMsg("获取失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/insertLisRis")
|
||||||
|
public Result insertLisRis(@RequestBody List<LisRis> lisRises) {
|
||||||
|
boolean b = lisRisService.saveBatch(lisRises);
|
||||||
|
if (b) {
|
||||||
|
return ResultUtil.success();
|
||||||
|
}
|
||||||
|
return ResultUtil.failureMsg("插入失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,9 +57,10 @@ public class OrderController {
|
|||||||
}
|
}
|
||||||
return ResultUtil.failureMsg("获取失败");
|
return ResultUtil.failureMsg("获取失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/insertMissedAppoints")
|
@PostMapping("/insertMissedAppoints")
|
||||||
@EleganceLog(description = "批量插入爽约记录")
|
@EleganceLog(description = "批量插入爽约记录")
|
||||||
public Result insertMissedApponits(@RequestBody List<OrderVo> orderVos) {
|
public Result insertMissedAppoints(@RequestBody List<OrderVo> orderVos) {
|
||||||
Integer i = orderService.insertMissedAppoints(orderVos);
|
Integer i = orderService.insertMissedAppoints(orderVos);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
@@ -66,4 +68,18 @@ public class OrderController {
|
|||||||
return ResultUtil.failureMsg("插入失败!");
|
return ResultUtil.failureMsg("插入失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getInBlackList")
|
||||||
|
@EleganceLog(description = "查询是否在黑名单")
|
||||||
|
public Result getInBlackList(String patientId) {
|
||||||
|
Integer i = 0;
|
||||||
|
String isBlackList = orderService.getIsBlackList();
|
||||||
|
if (isBlackList.equals("false")) { //黑名单是关闭的
|
||||||
|
return ResultUtil.successData(i);
|
||||||
|
}
|
||||||
|
HashMap<String, String> searchMap = new HashMap<>();
|
||||||
|
searchMap.put("patientId", patientId);
|
||||||
|
i = orderService.getInblackList(searchMap);
|
||||||
|
return ResultUtil.successData(i);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/main/java/com/joju/datamanager/mapper/LisRisMapper.java
Normal file
14
src/main/java/com/joju/datamanager/mapper/LisRisMapper.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package com.joju.datamanager.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.joju.datamanager.model.lisris.LisRis;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: lisris业务Mapper
|
||||||
|
* @author: Mr.zs
|
||||||
|
* @create: 2024-04-17 12:30
|
||||||
|
**/
|
||||||
|
@Mapper
|
||||||
|
public interface LisRisMapper extends BaseMapper<LisRis> {
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import com.joju.datamanager.model.order.Order;
|
|||||||
import com.joju.datamanager.model.order.OrderVo;
|
import com.joju.datamanager.model.order.OrderVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,4 +20,9 @@ public interface OrderMapper extends BaseMapper<Order> {
|
|||||||
List<OrderVo> getOrderByDateAndDist(String yyrq);
|
List<OrderVo> getOrderByDateAndDist(String yyrq);
|
||||||
|
|
||||||
Integer insertMissedAppoints(List<OrderVo> orderVos);
|
Integer insertMissedAppoints(List<OrderVo> orderVos);
|
||||||
|
|
||||||
|
Integer getInblackList(HashMap<String,String> map);
|
||||||
|
|
||||||
|
String getIsBlackList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
22
src/main/java/com/joju/datamanager/model/lisris/LisRis.java
Normal file
22
src/main/java/com/joju/datamanager/model/lisris/LisRis.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package com.joju.datamanager.model.lisris;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: lis和ris报告状态实体类
|
||||||
|
* @author: Mr.zs
|
||||||
|
* @create: 2024-04-17 11:25
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class LisRis {
|
||||||
|
|
||||||
|
private String xmmc;
|
||||||
|
private String hzxm;
|
||||||
|
private String cdrq;
|
||||||
|
private String kdksmc;
|
||||||
|
private String bgzt;
|
||||||
|
private String kdys;
|
||||||
|
private String bgys;
|
||||||
|
private String bgfbsj;
|
||||||
|
private String kh;
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.joju.datamanager.service;
|
package com.joju.datamanager.service;
|
||||||
|
|
||||||
|
import com.joju.datamanager.model.lisris.LisRis;
|
||||||
import com.joju.datamanager.model.medicalprescription.MedicalPrescription;
|
import com.joju.datamanager.model.medicalprescription.MedicalPrescription;
|
||||||
import com.joju.datamanager.model.viewmodel.PatientList;
|
import com.joju.datamanager.model.viewmodel.PatientList;
|
||||||
|
|
||||||
@@ -20,4 +21,7 @@ public interface HisViewSearchService {
|
|||||||
List<MedicalPrescription> getMedicalPrescription();
|
List<MedicalPrescription> getMedicalPrescription();
|
||||||
|
|
||||||
List<MedicalPrescription> getMedicalPrescriptionByCardNo(String cardNo);
|
List<MedicalPrescription> getMedicalPrescriptionByCardNo(String cardNo);
|
||||||
|
|
||||||
|
List<LisRis> getLisRisReportStatus();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.joju.datamanager.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.joju.datamanager.model.lisris.LisRis;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: lisris业务接口
|
||||||
|
* @author: Mr.zs
|
||||||
|
* @create: 2024-04-17 12:29
|
||||||
|
**/
|
||||||
|
public interface LisRisService extends IService<LisRis> {
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
import com.joju.datamanager.model.order.Order;
|
import com.joju.datamanager.model.order.Order;
|
||||||
import com.joju.datamanager.model.order.OrderVo;
|
import com.joju.datamanager.model.order.OrderVo;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,4 +20,9 @@ public interface OrderService extends IService<Order> {
|
|||||||
List<OrderVo> getOrderByDateAndDist(String yyrq);
|
List<OrderVo> getOrderByDateAndDist(String yyrq);
|
||||||
|
|
||||||
Integer insertMissedAppoints(List<OrderVo> orderVos);
|
Integer insertMissedAppoints(List<OrderVo> orderVos);
|
||||||
|
|
||||||
|
Integer getInblackList(HashMap<String,String> map);
|
||||||
|
|
||||||
|
String getIsBlackList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.joju.datamanager.service.impl;
|
|||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.db.handler.BeanListHandler;
|
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.medicalprescription.MedicalPrescription;
|
||||||
import com.joju.datamanager.model.viewmodel.PatientList;
|
import com.joju.datamanager.model.viewmodel.PatientList;
|
||||||
import com.joju.datamanager.service.HisViewSearchService;
|
import com.joju.datamanager.service.HisViewSearchService;
|
||||||
@@ -195,5 +196,84 @@ public class HisViewSearchServiceImpl implements HisViewSearchService {
|
|||||||
return medicalPrescriptions;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.joju.datamanager.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.joju.datamanager.mapper.LisRisMapper;
|
||||||
|
import com.joju.datamanager.model.lisris.LisRis;
|
||||||
|
import com.joju.datamanager.service.LisRisService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: lisris业务接口实现类
|
||||||
|
* @author: Mr.zs
|
||||||
|
* @create: 2024-04-17 12:30
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class LisRisServiceImpl extends ServiceImpl<LisRisMapper, LisRis> implements LisRisService {
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import com.joju.datamanager.service.OrderService;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,4 +32,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
public Integer insertMissedAppoints(List<OrderVo> orderVos) {
|
public Integer insertMissedAppoints(List<OrderVo> orderVos) {
|
||||||
return orderMapper.insertMissedAppoints(orderVos);
|
return orderMapper.insertMissedAppoints(orderVos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getInblackList(HashMap<String,String> map) {
|
||||||
|
return orderMapper.getInblackList(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getIsBlackList() {
|
||||||
|
return orderMapper.getIsBlackList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,5 +37,13 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
</insert>
|
</insert>
|
||||||
|
<select id="getInblackList" parameterType="hashmap" resultType="integer">
|
||||||
|
select count(*)
|
||||||
|
from blacklist
|
||||||
|
where patient_id = #{patientId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getIsBlackList" resultType="string">
|
||||||
|
SELECT param_val FROM service_params WHERE param_code = 'is_blackList'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user