1、struts2框架安全性升级,移除废弃api

2、新增医保现金自动退费,和控制开关
debug
wangsq 7 months ago
parent 4783c455ad
commit a3d7ead435
  1. 2
      .gitignore
  2. 33
      sql/report.sql
  3. 4
      src/main/java/com/ynxbd/common/action/ApiAction.java
  4. 234
      src/main/java/com/ynxbd/common/action/LisReportAction.java
  5. 186
      src/main/java/com/ynxbd/common/action/ReportAction.java
  6. 26
      src/main/java/com/ynxbd/common/dao/ReportDao.java
  7. 83
      src/main/java/com/ynxbd/common/dao/his/HisReportDao.java
  8. 17
      src/main/java/com/ynxbd/common/result/ResultEnum.java
  9. 7
      src/main/java/com/ynxbd/wx/wxfactory/WxMedicalHelper.java

2
.gitignore vendored

@ -36,7 +36,7 @@
logs/ logs/
app-cache/ app-cache/
*.log *.log
.svn/
# BlueJ 文件,忽略所有以[.ctxt]结尾的文件. # BlueJ 文件,忽略所有以[.ctxt]结尾的文件.
*.ctxt *.ctxt

@ -0,0 +1,33 @@
/*
Navicat Premium Data Transfer
Source Server : conpany 102
Source Server Type : MySQL
Source Server Version : 80020 (8.0.20)
Source Host : 192.168.12.102:3306
Source Schema : wx
Target Server Type : MySQL
Target Server Version : 80020 (8.0.20)
File Encoding : 65001
Date: 15/09/2023 15:20:54
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for report
-- ----------------------------
DROP TABLE IF EXISTS `report`;
CREATE TABLE `report` (
`ReportId` int NOT NULL AUTO_INCREMENT,
`UpdateTime` date DEFAULT NULL,
`ReportCount` int DEFAULT NULL,
`ReportType` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`Remark` varchar(500) DEFAULT NULL,
PRIMARY KEY (`ReportId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS = 1;

@ -60,6 +60,10 @@ public class ApiAction extends BaseAction {
return Result.success(resp); return Result.success(resp);
} }
public static void main(String[] args) {
System.out.println(DesEncryptHelper.deCode("98EBC51EB92C6BC416BE23AE0622CC7445CCB4559637127984C5759A422DC4B81251FC4C8B32A9DB9743601A4C4D66A31FA5186B9BF10CBCF7ACB00A82EBC37122FD51700AC9D16D596D147FFC4D4973792E04B406288B88D08C6ACE9654DA3801B31D2F6B996D3572A3BA1E8124A5CE43394DF49E1B5F0DC7793566C06524A854161F38FF064F3B"));
}
@Action("getWxJsapiTicket") @Action("getWxJsapiTicket")
public Result getWxJsapiTicket() { public Result getWxJsapiTicket() {
String ticket = WxCacheHelper.getJsapiTicket(); String ticket = WxCacheHelper.getJsapiTicket();

@ -50,7 +50,7 @@ public class LisReportAction extends BaseAction {
* @return 报告列表 * @return 报告列表
*/ */
@Action("report") @Action("report")
public Result getReportList(String treatNum, String treatNumPrefix, String flag, String patientType,String startTime,String endTime) { public Result getReportList(String treatNum, String treatNumPrefix, String flag, String patientType, String startTime, String endTime) {
treatNum = getDecodeString(treatNum); treatNum = getDecodeString(treatNum);
log.info("[Lis报告单]查询: flag={{}}, treatNumPrefix={{}}, treatNum={{}}, patientType={{}}", flag, treatNumPrefix, treatNum, patientType); log.info("[Lis报告单]查询: flag={{}}, treatNumPrefix={{}}, treatNum={{}}, patientType={{}}", flag, treatNumPrefix, treatNum, patientType);
if (flag == null || patientType == null || treatNum == null) { if (flag == null || patientType == null || treatNum == null) {
@ -59,64 +59,70 @@ public class LisReportAction extends BaseAction {
if (!ObjectUtils.isEmpty(treatNumPrefix)) { // 瑞美lis报告前缀 if (!ObjectUtils.isEmpty(treatNumPrefix)) { // 瑞美lis报告前缀
treatNum = treatNumPrefix + treatNum; treatNum = treatNumPrefix + treatNum;
} }
try {
List<XBDLisReport> lstReport = new ArrayList<>();
switch (flag) {
case "1": // 新八达
lstReport = new XBDLisDao().getReport(treatNum, patientType);
break;
case "2": // 瑞美
lstReport = new XBDLisDao().getReport4RM(treatNum);
List<XBDLisReport> lstReport = new ArrayList<>(); String reportId;
switch (flag) { for (XBDLisReport reportItem : lstReport) {
case "1": // 新八达 // 倒叙->base64->md5
lstReport = new XBDLisDao().getReport(treatNum, patientType); reportId = NumHelper.numDesc(reportItem.getId());
break; if (reportId != null) {
case "2": // 瑞美 reportId = Base64Helper.encode(reportId);
lstReport = new XBDLisDao().getReport4RM(treatNum); reportId = DigestUtils.md5Hex(reportId);
reportItem.setRm_cipherText(reportId);
}
}
break;
case "3": // 科华
if (WeChatConfig.APP_ID.equals("wxc01532c55273dc6b")) { // 红河州妇幼门诊号从bed_no查
lstReport = new XBDLisDao().getReport4KH_Hhzfy(treatNum, patientType);
} else {
lstReport = new XBDLisDao().getReport4KH(treatNum, patientType);
}
break;
case "4": // 石林
lstReport = new XBDLisDao().getReport4Sl(treatNum, patientType);
break;
case "5":
lstReport = RMLisDao.getReportList("1", treatNum, startTime, endTime, "0");
break;
case "6":
lstReport = new XBDLisDao().getReport7RM(treatNum);
String report7Id;
for (XBDLisReport reportItem : lstReport) {
// 倒叙->base64->md5
report7Id = NumHelper.numDesc(reportItem.getId());
if (report7Id != null) {
report7Id = Base64Helper.encode(report7Id);
report7Id = DigestUtils.md5Hex(report7Id);
reportItem.setRm_cipherText(report7Id);
}
}
break;
}
String reportId; if (lstReport != null) {
for (XBDLisReport reportItem : lstReport) { for (XBDLisReport item : lstReport) {
// 倒叙->base64->md5 if (item.getId() != null) {
reportId = NumHelper.numDesc(reportItem.getId()); item.setEnReportId(ReqParamHelper.encode(item.getId()));
if (reportId != null) {
reportId = Base64Helper.encode(reportId);
reportId = DigestUtils.md5Hex(reportId);
reportItem.setRm_cipherText(reportId);
} }
} if (item.getSampleCode() != null) {
break; item.setEnSampleCode(ReqParamHelper.encode(item.getSampleCode()));
case "3": // 科华
if (WeChatConfig.APP_ID.equals("wxc01532c55273dc6b")) { // 红河州妇幼门诊号从bed_no查
lstReport = new XBDLisDao().getReport4KH_Hhzfy(treatNum, patientType);
} else {
lstReport = new XBDLisDao().getReport4KH(treatNum, patientType);
}
break;
case "4": // 石林
lstReport = new XBDLisDao().getReport4Sl(treatNum, patientType);
break;
case "5":
lstReport = RMLisDao.getReportList("1",treatNum,startTime,endTime,"0");
break;
case "6":
lstReport = new XBDLisDao().getReport7RM(treatNum);
String report7Id;
for (XBDLisReport reportItem : lstReport) {
// 倒叙->base64->md5
report7Id = NumHelper.numDesc(reportItem.getId());
if (report7Id != null) {
report7Id = Base64Helper.encode(report7Id);
report7Id = DigestUtils.md5Hex(report7Id);
reportItem.setRm_cipherText(report7Id);
} }
} }
break;
}
for (XBDLisReport item : lstReport) {
if (item.getId() != null) {
item.setEnReportId(ReqParamHelper.encode(item.getId()));
}
if (item.getSampleCode() != null) {
item.setEnSampleCode(ReqParamHelper.encode(item.getSampleCode()));
} }
new ReportService().updateReportLisCount();
return Result.success(lstReport);
} catch (Exception e) {
return Result.error(ResultEnum.LIS_SELECT_DATA_ERROR);
} }
new ReportService().updateReportLisCount();
return Result.success(lstReport);
} }
@ -138,28 +144,32 @@ public class LisReportAction extends BaseAction {
return Result.error(ResultEnum.PARAM_IS_BLANK); return Result.error(ResultEnum.PARAM_IS_BLANK);
} }
List<XBDLisResult> lstResult = new ArrayList<>(); try {
switch (flag) { List<XBDLisResult> lstResult = new ArrayList<>();
case "1": // 新八达 switch (flag) {
lstResult = new XBDLisDao().getResult(testDate, sampleCode); case "1": // 新八达
break; lstResult = new XBDLisDao().getResult(testDate, sampleCode);
case "2": // 瑞美 break;
lstResult = new XBDLisDao().getResult4RM(Integer.parseInt(reportId)); case "2": // 瑞美
break; lstResult = new XBDLisDao().getResult4RM(Integer.parseInt(reportId));
case "3": // 科华 break;
lstResult = new XBDLisDao().getResult4KH(testDate, sampleCode); case "3": // 科华
break; lstResult = new XBDLisDao().getResult4KH(testDate, sampleCode);
case "4": break;
lstResult = new XBDLisDao().getResult4Sl(reportId); case "4":
break; lstResult = new XBDLisDao().getResult4Sl(reportId);
case "5": break;
lstResult = RMLisDao.getReportResult(reportId); case "5":
break; lstResult = RMLisDao.getReportResult(reportId);
case "6": break;
lstResult = new XBDLisDao().getResult7RM(reportId); case "6":
break; lstResult = new XBDLisDao().getResult7RM(reportId);
break;
}
return Result.success(lstResult);
} catch (Exception e) {
return Result.success(ResultEnum.LIS_SELECT_DATA_ERROR);
} }
return Result.success(lstResult);
} }
/** /**
@ -180,22 +190,26 @@ public class LisReportAction extends BaseAction {
} }
List<XBDLisImageResult> lstImage = new ArrayList<>(); List<XBDLisImageResult> lstImage = new ArrayList<>();
switch (flag) { try {
case "1": switch (flag) {
lstImage = new XBDLisDao().getImage(testDate, sampleCode); case "1":
break; lstImage = new XBDLisDao().getImage(testDate, sampleCode);
case "2": break;
lstImage = new XBDLisDao().getImage4RM(Integer.parseInt(reportId)); case "2":
break; lstImage = new XBDLisDao().getImage4RM(Integer.parseInt(reportId));
case "3": break;
lstImage = new XBDLisDao().getImage4KH(testDate, sampleCode); case "3":
break; lstImage = new XBDLisDao().getImage4KH(testDate, sampleCode);
case "4": break;
lstImage = new XBDLisDao().getImage4Sl(reportId); case "4":
break; lstImage = new XBDLisDao().getImage4Sl(reportId);
case "6": break;
lstImage = new XBDLisDao().getImage7RM(reportId); case "6":
break; lstImage = new XBDLisDao().getImage7RM(reportId);
break;
}
} catch (Exception e) {
return Result.error(ResultEnum.LIS_SELECT_DATA_ERROR);
} }
FileInputStream fis = null; FileInputStream fis = null;
@ -254,25 +268,29 @@ public class LisReportAction extends BaseAction {
return Result.error(ResultEnum.PARAM_IS_BLANK); return Result.error(ResultEnum.PARAM_IS_BLANK);
} }
List<XBDLisBactResult> bactResults = new ArrayList<>(); try {
switch (flag) { List<XBDLisBactResult> bactResults = new ArrayList<>();
case "1": switch (flag) {
bactResults = new XBDLisDao().getBactResult(testDate, sampleCode); case "1":
break; bactResults = new XBDLisDao().getBactResult(testDate, sampleCode);
case "2": break;
bactResults = new XBDLisDao().getBactResult4RM(Integer.parseInt(reportId)); case "2":
break; bactResults = new XBDLisDao().getBactResult4RM(Integer.parseInt(reportId));
case "3": break;
bactResults = new XBDLisDao().getBactResult4KH(testDate, sampleCode); case "3":
break; bactResults = new XBDLisDao().getBactResult4KH(testDate, sampleCode);
case "4": break;
bactResults = new XBDLisDao().getBactResult4Sl(reportId); case "4":
break; bactResults = new XBDLisDao().getBactResult4Sl(reportId);
case "5": break;
bactResults = RMLisDao.getBactResult(reportId); case "5":
break; bactResults = RMLisDao.getBactResult(reportId);
break;
}
return Result.success(bactResults);
} catch (Exception e) {
return Result.error(ResultEnum.LIS_SELECT_DATA_ERROR);
} }
return Result.success(bactResults);
} }
/** /**
@ -294,7 +312,7 @@ public class LisReportAction extends BaseAction {
* 展示报告 瑞美专用 * 展示报告 瑞美专用
*/ */
@Action("showLisReport") @Action("showLisReport")
public Result showLisReport(String queryCode ) { public Result showLisReport(String queryCode) {
queryCode = getDecodeString(queryCode); queryCode = getDecodeString(queryCode);
String queryType = "1"; //ReportID 报告单ID String queryType = "1"; //ReportID 报告单ID
return RMLisDao.downLisReport(queryType, queryCode); return RMLisDao.downLisReport(queryType, queryCode);

@ -2,12 +2,10 @@ package com.ynxbd.common.action;
import com.ynxbd.common.action.base.BaseAction; import com.ynxbd.common.action.base.BaseAction;
import com.ynxbd.common.bean.TreatRecord; import com.ynxbd.common.bean.TreatRecord;
import com.ynxbd.common.bean.enums.ReportEnum;
import com.ynxbd.common.bean.lis.XBDLisReport; import com.ynxbd.common.bean.lis.XBDLisReport;
import com.ynxbd.common.bean.report.CheckReport; import com.ynxbd.common.bean.report.CheckReport;
import com.ynxbd.common.bean.report.InspectionReport; import com.ynxbd.common.bean.report.InspectionReport;
import com.ynxbd.common.bean.report.PEIS; import com.ynxbd.common.bean.report.PEIS;
import com.ynxbd.common.dao.ReportDao;
import com.ynxbd.common.dao.his.HisReportDao; import com.ynxbd.common.dao.his.HisReportDao;
import com.ynxbd.common.helper.common.DateHelper; import com.ynxbd.common.helper.common.DateHelper;
import com.ynxbd.common.result.Result; import com.ynxbd.common.result.Result;
@ -37,20 +35,23 @@ public class ReportAction extends BaseAction {
@Action("getPEISByPatient") @Action("getPEISByPatient")
public Result getPEISByPatient(String name, String idCardNo, String patientId, String begDate, String endDate) { public Result getPEISByPatient(String name, String idCardNo, String patientId, String begDate, String endDate) {
// http://localhost:8080/wx/report/getPEISByPatient.do?patientId=153671&idCardNo=533103198212184014&name=%E8%82%96%E7%81%BF&token=123 // http://localhost:8080/wx/report/getPEISByPatient.do?patientId=153671&idCardNo=533103198212184014&name=%E8%82%96%E7%81%BF&token=123
log.info("[体检报告]查询:patientId={}, idCardNo={}, name={}, begDate={}, endDate={}", patientId, idCardNo, name, begDate, endDate); try {
if (patientId == null || idCardNo == null || name == null || begDate == null || endDate == null) { log.info("[体检报告]查询:patientId={}, idCardNo={}, name={}, begDate={}, endDate={}", patientId, idCardNo, name, begDate, endDate);
return Result.error(ResultEnum.PARAM_IS_DEFECT); if (patientId == null || idCardNo == null || name == null || begDate == null || endDate == null) {
} return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
List<PEIS> reportList = new HisReportDao().getPEISReportByPatient(name, idCardNo, begDate, endDate);
List<PEIS> resultList = new ArrayList<>(); List<PEIS> reportList = new HisReportDao().getPEISReportByPatient(name, idCardNo, begDate, endDate);
for (PEIS report : reportList) { List<PEIS> resultList = new ArrayList<>();
if (report.getExamDate() != null && DateHelper.inDateRange(begDate, endDate, report.getExamDate(), DateHelper.DateEnum.yyyy_MM_dd)) { for (PEIS report : reportList) {
resultList.add(report); if (report.getExamDate() != null && DateHelper.inDateRange(begDate, endDate, report.getExamDate(), DateHelper.DateEnum.yyyy_MM_dd)) {
resultList.add(report);
}
} }
return Result.success(resultList);
} catch (Exception e) {
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR);
} }
return Result.success(resultList);
} }
@ -59,23 +60,28 @@ public class ReportAction extends BaseAction {
*/ */
@Action("getCheckByPatient") @Action("getCheckByPatient")
public Result getCheckByPatient(String begDate, String endDate, String patientId, String openid) { public Result getCheckByPatient(String begDate, String endDate, String patientId, String openid) {
patientId = getDecodeString(patientId); try {
// http://localhost:8080/wx/report/getCheckByPatient.do?patientId=153671&token=123 patientId = getDecodeString(patientId);
log.info("[检查报告]查询 patientId={}, begDate={}, endDate={}", patientId, begDate, endDate); // http://localhost:8080/wx/report/getCheckByPatient.do?patientId=153671&token=123
if (patientId == null || begDate == null || endDate == null) { log.info("[检查报告]查询 patientId={}, begDate={}, endDate={}", patientId, begDate, endDate);
return Result.error(ResultEnum.PARAM_IS_DEFECT); if (patientId == null || begDate == null || endDate == null) {
} return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
List<CheckReport> reportList = new HisReportDao().getCheckByPatient(patientId, begDate, endDate); List<CheckReport> reportList = new HisReportDao().getCheckByPatient(patientId, begDate, endDate);
List<CheckReport> resultList = new ArrayList<>(); List<CheckReport> resultList = new ArrayList<>();
for (CheckReport report : reportList) { for (CheckReport report : reportList) {
if (report.getApplyDate() != null && DateHelper.inDateRange(begDate, endDate, report.getApplyDate(), DateHelper.DateEnum.yyyy_MM_dd)) { if (report.getApplyDate() != null && DateHelper.inDateRange(begDate, endDate, report.getApplyDate(), DateHelper.DateEnum.yyyy_MM_dd)) {
resultList.add(report); resultList.add(report);
}
} }
new ReportService().updateReportPacsCount();
return Result.success(resultList);
} catch (Exception e) {
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR);
} }
new ReportService().updateReportPacsCount();
return Result.success(resultList);
} }
@ -90,29 +96,32 @@ public class ReportAction extends BaseAction {
* @param isLately 是否只查询最近一条记录 * @param isLately 是否只查询最近一条记录
*/ */
@Action("getTreatRecordList") @Action("getTreatRecordList")
public Result getTreatRecordList(String begDate, String endDate, String patientId, String patientType, String reportType, Boolean isLately,String deptCode) { public Result getTreatRecordList(String begDate, String endDate, String patientId, String patientType, String reportType, Boolean isLately, String deptCode) {
patientId = getDecodeString(patientId); try {
// http://localhost:8081/wx/report/getTreatRecordList.do?patientId=406212&begDate=201801-01&endDate=2020-08-12&patientType=0&reportType=2 patientId = getDecodeString(patientId);
if (patientId == null || begDate == null || endDate == null) { // http://localhost:8081/wx/report/getTreatRecordList.do?patientId=406212&begDate=201801-01&endDate=2020-08-12&patientType=0&reportType=2
return Result.error(ResultEnum.PARAM_IS_DEFECT); if (patientId == null || begDate == null || endDate == null) {
} return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
List<TreatRecord> records = new HisReportDao().getTreatRecordList(patientId, begDate, endDate, patientType, reportType,deptCode);
if (records.size() > 0 && isLately != null && isLately) { List<TreatRecord> records = new HisReportDao().getTreatRecordList(patientId, begDate, endDate, patientType, reportType, deptCode);
List<TreatRecord> resultList = new ArrayList<>();
records.stream().max(Comparator.comparing(TreatRecord::getConsultDate)).ifPresent(resultList::add); if (!records.isEmpty() && isLately != null && isLately) {
return Result.success(resultList); List<TreatRecord> resultList = new ArrayList<>();
} records.stream().max(Comparator.comparing(TreatRecord::getConsultDate)).ifPresent(resultList::add);
return Result.success(resultList);
}
for (TreatRecord record : records) { for (TreatRecord record : records) {
if (record.getTreatNum() != null) { if (record.getTreatNum() != null) {
record.setEnTreatNum(ReqParamHelper.encode(record.getTreatNum())); record.setEnTreatNum(ReqParamHelper.encode(record.getTreatNum()));
}
} }
return Result.success(records);
} catch (Exception e) {
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR);
} }
return Result.success(records);
} }
@ -121,23 +130,27 @@ public class ReportAction extends BaseAction {
*/ */
@Action("getInspectByPatient") @Action("getInspectByPatient")
public Result getInspectByPatient(String openid, String patientId, String begDate, String endDate) { public Result getInspectByPatient(String openid, String patientId, String begDate, String endDate) {
patientId = getDecodeString(patientId); try {
patientId = getDecodeString(patientId);
// http://localhost:8080/wx/report/getInspectByPatient.do?patientId=153671&token=123 // http://localhost:8080/wx/report/getInspectByPatient.do?patientId=153671&token=123
log.info("化验(检验)结果查询:patientId={}, begDate={}, endDate={}", patientId, begDate, endDate); log.info("化验(检验)结果查询:patientId={}, begDate={}, endDate={}", patientId, begDate, endDate);
if (patientId == null || begDate == null || endDate == null) { if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT); return Result.error(ResultEnum.PARAM_IS_DEFECT);
} }
List<InspectionReport> reportList = new HisReportDao().getInspectByPatient(patientId); List<InspectionReport> reportList = new HisReportDao().getInspectByPatient(patientId);
List<InspectionReport> resultList = new ArrayList<>(); List<InspectionReport> resultList = new ArrayList<>();
for (InspectionReport report : reportList) { for (InspectionReport report : reportList) {
if (report.getApplyDate() != null && DateHelper.inDateRange(begDate, endDate, report.getApplyDate(), DateHelper.DateEnum.yyyy_MM_dd)) { if (report.getApplyDate() != null && DateHelper.inDateRange(begDate, endDate, report.getApplyDate(), DateHelper.DateEnum.yyyy_MM_dd)) {
resultList.add(report); resultList.add(report);
}
} }
return Result.success(resultList);
} catch (Exception e) {
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR);
} }
return Result.success(resultList);
} }
/** /**
@ -145,41 +158,44 @@ public class ReportAction extends BaseAction {
*/ */
@Action("getInspectByTreatNum") @Action("getInspectByTreatNum")
public Result getInspectByTreatNum(String type, String treatNum, String patientId) { public Result getInspectByTreatNum(String type, String treatNum, String patientId) {
treatNum = getDecodeString(treatNum); try {
patientId = getDecodeString(patientId); treatNum = getDecodeString(treatNum);
// http://localhost:8080/wx/report/getInspectByTreatNum.do?patientId=153671&token=123 patientId = getDecodeString(patientId);
log.info("[化验(检验)]结果查询:patientId={}, type={}, treatNum={}", patientId, type, treatNum); // http://localhost:8080/wx/report/getInspectByTreatNum.do?patientId=153671&token=123
if (patientId == null || type == null || treatNum == null) { log.info("[化验(检验)]结果查询:patientId={}, type={}, treatNum={}", patientId, type, treatNum);
return Result.error(ResultEnum.PARAM_IS_BLANK); if (patientId == null || type == null || treatNum == null) {
} return Result.error(ResultEnum.PARAM_IS_BLANK);
}
String mzNum = null, zyNum = null; String mzNum = null, zyNum = null;
if ("1".equals(type)) { if ("1".equals(type)) {
mzNum = treatNum; mzNum = treatNum;
} else { } else {
zyNum = treatNum; zyNum = treatNum;
} }
ArrayList<XBDLisReport> resultList = new ArrayList<>();
XBDLisReport xbdLisReport;
List<InspectionReport> reports = new HisReportDao().getInspectByTreatNum(patientId, zyNum, mzNum);
for (InspectionReport report : reports) {
xbdLisReport = new XBDLisReport();
xbdLisReport.setReportName(report.getName());
xbdLisReport.setSpecimenName(report.getType());
xbdLisReport.setReportDate(report.getReportDate());
xbdLisReport.setReporter(report.getReportDoctName());
xbdLisReport.setItem(report.getItem());
xbdLisReport.setTreatId(report.getMzNum() != null ? report.getMzNum() : report.getZyNum());
xbdLisReport.setBedNo(report.getBedNum());
ArrayList<XBDLisReport> resultList = new ArrayList<>(); resultList.add(xbdLisReport);
XBDLisReport xbdLisReport; }
List<InspectionReport> reports = new HisReportDao().getInspectByTreatNum(patientId, zyNum, mzNum); return Result.success(resultList);
for (InspectionReport report : reports) { } catch (Exception e) {
xbdLisReport = new XBDLisReport(); return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR);
xbdLisReport.setReportName(report.getName());
xbdLisReport.setSpecimenName(report.getType());
xbdLisReport.setReportDate(report.getReportDate());
xbdLisReport.setReporter(report.getReportDoctName());
xbdLisReport.setItem(report.getItem());
xbdLisReport.setTreatId(report.getMzNum() != null ? report.getMzNum() : report.getZyNum());
xbdLisReport.setBedNo(report.getBedNum());
resultList.add(xbdLisReport);
} }
return Result.success(resultList);
} }
// /** // /**
// * 根据openid查询检查报告 // * 根据openid查询检查报告
// */ // */

@ -16,26 +16,26 @@ import java.util.List;
@Slf4j @Slf4j
public class ReportDao { public class ReportDao {
public boolean insertToday(Integer reportCount, String reportType, String remark){ public boolean insertToday(Integer reportCount, String reportType, String remark) {
String sql = "insert into report (UpdateTime, ReportCount, ReportType, Remark) values(now(),?,?,?)"; String sql = "insert into report (UpdateTime, ReportCount, ReportType, Remark) values(now(),?,?,?)";
return DataBase.insert(sql,ps-> { return DataBase.insert(sql, ps -> {
ps.setInt(1,reportCount); ps.setInt(1, reportCount);
ps.setString(2,reportType); ps.setString(2, reportType);
ps.setString(3,remark); ps.setString(3, remark);
})>0; }) > 0;
} }
public boolean existToday(String reportType){ public boolean existToday(String reportType) {
String sql = "select ReportType from report where UpdateTime = DATE(now()) and ReportType = ?"; String sql = "select ReportType from report where UpdateTime = DATE(now()) and ReportType = ?";
return !DataBase.select(sql,String.class,ps -> { return !DataBase.select(sql, String.class, ps -> {
ps.setString(1,reportType); ps.setString(1, reportType);
}).isEmpty(); }).isEmpty();
} }
public boolean updateCount(String reportType){ public boolean updateCount(String reportType) {
String sql = "update report set ReportCount = ReportCount+1 where UpdateTime = DATE(now()) and ReportType = ?"; String sql = "update report set ReportCount = ReportCount+1 where UpdateTime = DATE(now()) and ReportType = ?";
return DataBase.update(sql,ps->{ return DataBase.update(sql, ps -> {
ps.setString(1,reportType); ps.setString(1, reportType);
})>0; }) > 0;
} }
} }

@ -9,6 +9,7 @@ import com.ynxbd.common.bean.report.PEIS;
import com.ynxbd.common.helper.his.HisEnum; import com.ynxbd.common.helper.his.HisEnum;
import com.ynxbd.common.helper.his.HisHelper; import com.ynxbd.common.helper.his.HisHelper;
import com.ynxbd.common.result.JsonResult; import com.ynxbd.common.result.JsonResult;
import com.ynxbd.common.result.ServiceException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList; import java.util.ArrayList;
@ -59,17 +60,15 @@ public class HisReportDao {
* @param bedDate 开始时间 * @param bedDate 开始时间
* @param endDate 结束时间 * @param endDate 结束时间
*/ */
public List<CheckReport> getCheckByPatient(String patientId, String bedDate, String endDate) { public List<CheckReport> getCheckByPatient(String patientId, String bedDate, String endDate) throws ServiceException {
List<CheckReport> reports = new ArrayList<>();
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_CheckApplication, params -> { JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_CheckApplication, params -> {
params.put("PatientID", patientId); params.put("PatientID", patientId);
}); });
if (jsonResult.success()) { if (!jsonResult.success()) {
reports = jsonResult.getDataMapList(CheckReport.class, "Report"); throw new ServiceException(jsonResult.getMessage());
} }
return reports; return jsonResult.getDataMapList(CheckReport.class, "Report");
} }
@ -80,16 +79,16 @@ public class HisReportDao {
* @param idCardNo 身份证号码 * @param idCardNo 身份证号码
* @return list * @return list
*/ */
public List<PEIS> getPEISReportByPatient(String name, String idCardNo, String bedDate, String endDate) { public List<PEIS> getPEISReportByPatient(String name, String idCardNo, String bedDate, String endDate) throws ServiceException {
List<PEIS> reports = new ArrayList<>();
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_PEISReport, params -> { JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_PEISReport, params -> {
params.put("Name", name); params.put("Name", name);
params.put("IdCardNo", idCardNo); params.put("IdCardNo", idCardNo);
}); });
if (jsonResult.success()) {
reports = jsonResult.getDataMapList(PEIS.class, "Enrollment"); if (!jsonResult.success()) {
throw new ServiceException(jsonResult.getMessage());
} }
return reports; return jsonResult.getDataMapList(PEIS.class, "Enrollment");
} }
/** /**
@ -98,16 +97,15 @@ public class HisReportDao {
* @param patientId 患者 * @param patientId 患者
* @return 报告集合 * @return 报告集合
*/ */
public List<InspectionReport> getInspectByPatient(String patientId) { public List<InspectionReport> getInspectByPatient(String patientId) throws ServiceException {
List<InspectionReport> reports = new ArrayList<>();
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_InspectionApplication, params -> { JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_InspectionApplication, params -> {
params.put("PatientID", patientId); params.put("PatientID", patientId);
}); });
if (jsonResult.success()) { if (!jsonResult.success()) {
reports = jsonResult.getDataMapList(InspectionReport.class, "Report"); throw new ServiceException(jsonResult.getMessage());
} }
return reports; return jsonResult.getDataMapList(InspectionReport.class, "Report");
} }
@ -117,18 +115,17 @@ public class HisReportDao {
* @param patientId 患者 * @param patientId 患者
* @return 报告集合 * @return 报告集合
*/ */
public List<InspectionReport> getInspectByTreatNum(String patientId, String zyNum, String mzNum) { public List<InspectionReport> getInspectByTreatNum(String patientId, String zyNum, String mzNum) throws ServiceException {
List<InspectionReport> reportList = new ArrayList<>();
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_InspectionApplication, params -> { JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_InspectionApplication, params -> {
params.put("PatientID", patientId); params.put("PatientID", patientId);
params.put("ZYNum", zyNum == null ? "" : zyNum); params.put("ZYNum", zyNum == null ? "" : zyNum);
params.put("MZNum", mzNum == null ? "" : mzNum); params.put("MZNum", mzNum == null ? "" : mzNum);
}); });
if (jsonResult.success()) { if (!jsonResult.success()) {
reportList = jsonResult.getDataMapList(InspectionReport.class, "Report"); throw new ServiceException(jsonResult.getMessage());
} }
return reportList; return jsonResult.getDataMapList(InspectionReport.class, "Report");
} }
/** /**
@ -136,36 +133,36 @@ public class HisReportDao {
* *
* @return 就诊记录 * @return 就诊记录
*/ */
public List<TreatRecord> getTreatRecordList(String patientId, String begDate, String endDate, String patientType, String reportType,String deptCode) { public List<TreatRecord> getTreatRecordList(String patientId, String begDate, String endDate, String patientType, String reportType, String deptCode) throws ServiceException {
List<TreatRecord> resultList = new ArrayList<>();
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.Query_TreatRecords, params -> { JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.Query_TreatRecords, params -> {
params.put("PatientId", patientId); params.put("PatientId", patientId);
params.put("BegDate", begDate); params.put("BegDate", begDate);
params.put("EndDate", endDate); params.put("EndDate", endDate);
params.put("DeptCode",deptCode); params.put("DeptCode", deptCode);
params.put("InOutState", patientType == null ? "0" : patientType); // 0:全部; 1:门诊号; 2:住院号 params.put("InOutState", patientType == null ? "0" : patientType); // 0:全部; 1:门诊号; 2:住院号
params.put("CheckOrInspection", reportType == null ? "0" : reportType); // 0:全部; 1:检查; 2:检验; 3:检查+检验 params.put("CheckOrInspection", reportType == null ? "0" : reportType); // 0:全部; 1:检查; 2:检验; 3:检查+检验
}); });
if (jsonResult.success()) { // 0成功 -1异常 if (!jsonResult.success()) {
JSONArray jsonArray = jsonResult.getJsonArray("Records", "Record"); throw new ServiceException(jsonResult.getMessage());
}
TreatRecord item; List<TreatRecord> resultList = new ArrayList<>();
JSONObject nodeItem; JSONArray jsonArray = jsonResult.getJsonArray("Records", "Record");
for (int i = 0; i < jsonArray.size(); i++) { TreatRecord item;
nodeItem = jsonArray.getJSONObject(i); JSONObject nodeItem;
item = new TreatRecord(); for (int i = 0; i < jsonArray.size(); i++) {
nodeItem = jsonArray.getJSONObject(i);
item.setInOutState(nodeItem.getString("InOutState")); item = new TreatRecord();
item.setTreatNum(nodeItem.getString("MZNum"));
item.setDeptCode(nodeItem.getString("DeptCode")); // 职称 item.setInOutState(nodeItem.getString("InOutState"));
item.setDeptName(nodeItem.getString("DeptName")); // item.setTreatNum(nodeItem.getString("MZNum"));
item.setDoctCode(nodeItem.getString("DoctCode")); // item.setDeptCode(nodeItem.getString("DeptCode")); // 职称
item.setDoctName(nodeItem.getString("DoctName")); // item.setDeptName(nodeItem.getString("DeptName")); //
item.setRegisterDate(nodeItem.getString("RegisterDate")); // 描述 item.setDoctCode(nodeItem.getString("DoctCode")); //
item.setConsultDate(nodeItem.getString("ConsultDate")); // 描述 item.setDoctName(nodeItem.getString("DoctName")); //
resultList.add(item); item.setRegisterDate(nodeItem.getString("RegisterDate")); // 描述
} item.setConsultDate(nodeItem.getString("ConsultDate")); // 描述
resultList.add(item);
} }
return resultList; return resultList;
} }

@ -28,7 +28,7 @@ public enum ResultEnum {
PARAM_ADDRESS_ERROR(10007, "地址缺失"), PARAM_ADDRESS_ERROR(10007, "地址缺失"),
PARAM_LIST_SIZE_ZERO(10008, "参数集为空"), PARAM_LIST_SIZE_ZERO(10008, "参数集为空"),
PARAM_VERIFY_ERROR(10009, "参数验证失败"), PARAM_VERIFY_ERROR(10009, "参数验证失败"),
FACE_VERIFY_ERROR(10010,"人脸识别未通过"), FACE_VERIFY_ERROR(10010, "人脸识别未通过"),
DATE_IS_TODAY(10100, "日期不能为今天"), DATE_IS_TODAY(10100, "日期不能为今天"),
DATE_IS_ERROR(10101, "日期错误"), DATE_IS_ERROR(10101, "日期错误"),
@ -89,12 +89,12 @@ public enum ResultEnum {
REFUND_RES_REG_NOT_ALLOW(30107, "[退费]预约挂号禁止退费"), REFUND_RES_REG_NOT_ALLOW(30107, "[退费]预约挂号禁止退费"),
REFUND_IS_REPEAT(30107, "[退费]订单已退费请勿重复申请"), REFUND_IS_REPEAT(30107, "[退费]订单已退费请勿重复申请"),
REFUND_CASH_IS_NULL(30016, "[退费]现金不存在"), REFUND_CASH_IS_NULL(30016, "[退费]现金不存在"),
REFUND_IS_FAIL_FOR_MD(30201,"[退费]医保挂号订单不允许线上退费,请到线下窗口进行退款"), REFUND_IS_FAIL_FOR_MD(30201, "[退费]医保挂号订单不允许线上退费,请到线下窗口进行退款"),
// 挂号 // 挂号
REG_TODAY_HAS(38100, "[挂号]同一天,同一科室,已挂过号"), REG_TODAY_HAS(38100, "[挂号]同一天,同一科室,已挂过号"),
REG_OCCUPY_SOURCE(38101, "[挂号]号源已被占用"), REG_OCCUPY_SOURCE(38101, "[挂号]号源已被占用"),
REG_NOT_FIND(38102,"[退号]未查询到挂号支付信息;若是医保支付则不允许线上退号,请到窗口进行退费"), REG_NOT_FIND(38102, "[退号]未查询到挂号支付信息;若是医保支付则不允许线上退号,请到窗口进行退费"),
SELF_HELP_EXCEED_MAX(38190, "[自助申请单]今日检测数量已达最大限制"), SELF_HELP_EXCEED_MAX(38190, "[自助申请单]今日检测数量已达最大限制"),
// 处方 // 处方
RECIPE_REPEAT_BILL(38200, "[处方]重复开单"), // 核酸重复开单提示-不要动 RECIPE_REPEAT_BILL(38200, "[处方]重复开单"), // 核酸重复开单提示-不要动
@ -122,14 +122,15 @@ public enum ResultEnum {
DATA_IS_DISABLED(50007, "数据已禁用"), DATA_IS_DISABLED(50007, "数据已禁用"),
/* 接口错误:60000-69999 */ /* 接口错误:60000-69999 */
INTERFACE_INVOKE_ERROR(60000, "接口调用异常"),
INTERFACE_WX_INVOKE_ERROR(61001, "【微信】接口调用异常"), INTERFACE_WX_INVOKE_ERROR(61001, "【微信】接口调用异常"),
INTERFACE_ALI_INVOKE_ERROR(62002, "【支付宝】接口调用异常"), INTERFACE_ALI_INVOKE_ERROR(62002, "【支付宝】接口调用异常"),
INTERFACE_HIS_INVOKE_ERROR(69000, "【HIS】接口调用异常"), INTERFACE_HIS_INVOKE_ERROR(69000, "【HIS】接口调用异常"),
INTERFACE_HIS_DATA_ERROR(69001, "【HIS】接口返回数据异常"), INTERFACE_HIS_DATA_ERROR(69001, "【HIS】接口返回数据异常"),
INTERFACE_HIS_REQ_TIMEOUT(69408, "【HIS】接口请求超时"), INTERFACE_HIS_REQ_TIMEOUT(69408, "【HIS】接口请求超时"),
INTERFACE_HIS_NO_DATA(69404, "【HIS】没有查找到数据"), INTERFACE_HIS_NO_DATA(69404, "【HIS】没有查找到数据"),
// // LIS
INTERFACE_INVOKE_ERROR(60000, "接口调用异常"), LIS_SELECT_DATA_ERROR(69501, "【LIS】查询数据异常"),
INTERFACE_EXCEED_LOAD(60001, "接口负载过高"), INTERFACE_EXCEED_LOAD(60001, "接口负载过高"),
INTERFACE_FORBID_VISIT(60002, "该接口禁止访问"), INTERFACE_FORBID_VISIT(60002, "该接口禁止访问"),
@ -168,7 +169,7 @@ public enum ResultEnum {
SMS_CODE_VERIFY_ERROR(90006, "验证码错误或已失效"), SMS_CODE_VERIFY_ERROR(90006, "验证码错误或已失效"),
// 慢病 和 病历复印 // 慢病 和 病历复印
APPLY_REPEAT(100001,"申请已存在,请勿重复申请"); APPLY_REPEAT(100001, "申请已存在,请勿重复申请");
public final Integer status; public final Integer status;
@ -203,8 +204,8 @@ public enum ResultEnum {
return this.name(); return this.name();
} }
public String makeMessage(String message){ public String makeMessage(String message) {
if(message == null) message = ""; if (message == null) message = "";
return this.message + message; return this.message + message;
} }

@ -273,6 +273,13 @@ public class WxMedicalHelper {
); );
} }
/**
* [医保]退现金部分
*/
public static MedicalOrder refundCash(String outTradeNo, String tradeNo, BigDecimal cashFee, String reason) {
return refundCash(outTradeNo, "R" + tradeNo, tradeNo, cashFee, reason);
}
/** /**
* [医保] 下载对账单 * [医保] 下载对账单

Loading…
Cancel
Save