parent
c08a0e2b5f
commit
b00b10556c
64 changed files with 2020 additions and 1122 deletions
@ -0,0 +1,32 @@ |
||||
package com.ynxbd.common.action; |
||||
|
||||
import com.ynxbd.common.action.base.BaseAction; |
||||
import com.ynxbd.common.result.Result; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.common.service.MedToolService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.commons.lang3.ObjectUtils; |
||||
import org.apache.struts2.convention.annotation.Action; |
||||
import org.apache.struts2.convention.annotation.Namespace; |
||||
|
||||
@Slf4j |
||||
@Namespace("/medTool") |
||||
public class MedToolAction extends BaseAction { |
||||
/** |
||||
* [就医助手]修改流程标记 |
||||
*/ |
||||
@Action("saveMedToolMarkByTreatNum") |
||||
public Result saveMedToolMarkByTreatNum(String treatNum, Integer type, String processMark) { |
||||
treatNum = getDecodeString(treatNum); |
||||
log.info("[就医助手]根据就诊号修改流程标记 treatNum={}, type={}, processMark={}", treatNum, type, processMark); |
||||
if (ObjectUtils.isEmpty(treatNum) || processMark == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
try { |
||||
boolean isOK = new MedToolService().saveMedToolMarkByTreatNum(treatNum, type, processMark); |
||||
return Result.isOK(isOK); |
||||
} catch (Exception e) { |
||||
return Result.error(e); |
||||
} |
||||
} |
||||
} |
@ -1,320 +1,323 @@ |
||||
/* |
||||
* * |
||||
* * @Project 微信公众号 |
||||
* * @Author 张剑峰 |
||||
* * @Date 2020/12/3 下午4:35 |
||||
* * @Description |
||||
* * @Version v1.0.0 |
||||
* * @Copyright @ 2020 云南新八达科技有限公司 All rights reserved. |
||||
* |
||||
*/ |
||||
|
||||
package com.ynxbd.common.action; |
||||
|
||||
import com.ynxbd.common.action.base.BaseAction; |
||||
import com.ynxbd.common.bean.enums.ReportEnum; |
||||
import com.ynxbd.common.bean.lis.XBDLisBactResult; |
||||
import com.ynxbd.common.bean.lis.XBDLisImageResult; |
||||
import com.ynxbd.common.bean.lis.XBDLisReport; |
||||
import com.ynxbd.common.bean.lis.XBDLisResult; |
||||
import com.ynxbd.common.dao.ReportDao; |
||||
import com.ynxbd.common.dao.lis.RMLisDao; |
||||
import com.ynxbd.common.dao.lis.XBDLisDao; |
||||
import com.ynxbd.common.helper.common.Base64Helper; |
||||
import com.ynxbd.common.helper.common.ImageHelper; |
||||
import com.ynxbd.common.helper.common.NumHelper; |
||||
import com.ynxbd.common.result.Result; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.common.service.ReportService; |
||||
import com.ynxbd.wx.config.WeChatConfig; |
||||
import com.ynxbd.wx.wxfactory.ReqParamHelper; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.commons.codec.digest.DigestUtils; |
||||
import org.apache.commons.lang3.ObjectUtils; |
||||
import org.apache.struts2.convention.annotation.Action; |
||||
import org.apache.struts2.convention.annotation.Namespace; |
||||
|
||||
import java.io.File; |
||||
import java.io.FileInputStream; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
|
||||
@Slf4j |
||||
@Namespace("/lis") |
||||
public class LisReportAction extends BaseAction { |
||||
|
||||
/** |
||||
* 查询报告列表 |
||||
* |
||||
* @return 报告列表 |
||||
*/ |
||||
@Action("report") |
||||
public Result getReportList(String treatNum, String treatNumPrefix, String flag, String patientType, String startTime, String endTime) { |
||||
treatNum = getDecodeString(treatNum); |
||||
log.info("[Lis报告单]查询: flag={{}}, treatNumPrefix={{}}, treatNum={{}}, patientType={{}}", flag, treatNumPrefix, treatNum, patientType); |
||||
if (flag == null || patientType == null || treatNum == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
if (!ObjectUtils.isEmpty(treatNumPrefix)) { // 瑞美lis报告前缀
|
||||
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); |
||||
|
||||
String reportId; |
||||
for (XBDLisReport reportItem : lstReport) { |
||||
// 倒叙->base64->md5
|
||||
reportId = NumHelper.numDesc(reportItem.getId()); |
||||
if (reportId != null) { |
||||
reportId = Base64Helper.encode(reportId); |
||||
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; |
||||
} |
||||
|
||||
if (lstReport != null) { |
||||
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); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 普通报告 |
||||
*/ |
||||
@Action("result") |
||||
public Result getResult(String reportId, String sampleCode, String flag, String testDate, String openid) { |
||||
reportId = getDecodeString(reportId); |
||||
sampleCode = getDecodeString(sampleCode); |
||||
|
||||
log.info("[Lis结果]查询: flag={{}}, reportId={}, testDate={{}}, sampleCode={{}}", flag, reportId, testDate, sampleCode); |
||||
|
||||
if ("1".equals(flag) && (testDate == null || sampleCode == null)) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
if (("2".equals(flag) || "4".equals(flag)) && reportId == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
try { |
||||
List<XBDLisResult> lstResult = new ArrayList<>(); |
||||
switch (flag) { |
||||
case "1": // 新八达
|
||||
lstResult = new XBDLisDao().getResult(testDate, sampleCode); |
||||
break; |
||||
case "2": // 瑞美
|
||||
lstResult = new XBDLisDao().getResult4RM(Integer.parseInt(reportId)); |
||||
break; |
||||
case "3": // 科华
|
||||
lstResult = new XBDLisDao().getResult4KH(testDate, sampleCode); |
||||
break; |
||||
case "4": |
||||
lstResult = new XBDLisDao().getResult4Sl(reportId); |
||||
break; |
||||
case "5": |
||||
lstResult = RMLisDao.getReportResult(reportId); |
||||
break; |
||||
case "6": |
||||
lstResult = new XBDLisDao().getResult7RM(reportId); |
||||
break; |
||||
} |
||||
return Result.success(lstResult); |
||||
} catch (Exception e) { |
||||
return Result.success(ResultEnum.LIS_SELECT_DATA_ERROR); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 图像报告 |
||||
*/ |
||||
@Action("image") |
||||
public Result getImage(String reportId, String sampleCode, String flag, String testDate, String openid) { |
||||
reportId = getDecodeString(reportId); |
||||
sampleCode = getDecodeString(sampleCode); |
||||
|
||||
log.info("查询Lis图像: flag={{}}, reportId={}, testDate={{}}, sampleCode={{}}", flag, reportId, testDate, sampleCode); |
||||
if ("1".equals(flag) && (testDate == null || sampleCode == null)) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
if (("2".equals(flag) || "4".equals(flag)) && reportId == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
List<XBDLisImageResult> lstImage = new ArrayList<>(); |
||||
try { |
||||
switch (flag) { |
||||
case "1": |
||||
lstImage = new XBDLisDao().getImage(testDate, sampleCode); |
||||
break; |
||||
case "2": |
||||
lstImage = new XBDLisDao().getImage4RM(Integer.parseInt(reportId)); |
||||
break; |
||||
case "3": |
||||
lstImage = new XBDLisDao().getImage4KH(testDate, sampleCode); |
||||
break; |
||||
case "4": |
||||
lstImage = new XBDLisDao().getImage4Sl(reportId); |
||||
break; |
||||
case "6": |
||||
lstImage = new XBDLisDao().getImage7RM(reportId); |
||||
break; |
||||
} |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.LIS_SELECT_DATA_ERROR); |
||||
} |
||||
|
||||
FileInputStream fis = null; |
||||
byte[] bytes; |
||||
List<XBDLisImageResult> resultList = new ArrayList<>(); |
||||
for (XBDLisImageResult item : lstImage) { |
||||
if (item.getImage() == null && item.getUrl() != null) { |
||||
try { |
||||
fis = new FileInputStream(new File(item.getUrl())); |
||||
bytes = new byte[fis.available()]; |
||||
//将文件内容写入字节数组
|
||||
fis.read(bytes); |
||||
item.setImage(bytes); |
||||
item.setUrl(null); |
||||
|
||||
// 将图片字节码进行压缩
|
||||
byte[] decompressPicByte = ImageHelper.decompressPicByte(item.getImage(), 0); // 0:按100*200压缩、1:按原图片的50%压缩
|
||||
// 将图片字节进行base64编码(在word文档中显示图片时会用到base64转码)
|
||||
if (decompressPicByte != null) { |
||||
item.setImageBase64( |
||||
"data:image/jpg;base64," + ImageHelper.converPicBase64(decompressPicByte)); |
||||
} |
||||
item.setImage(null); |
||||
resultList.add(item); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} finally { |
||||
try { |
||||
if (fis != null) { |
||||
fis.close(); |
||||
} |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
return Result.success(resultList); |
||||
} |
||||
|
||||
/** |
||||
* 细菌报告 |
||||
*/ |
||||
@Action("bact") |
||||
public Result getBactResult(String reportId, String sampleCode, String flag, String testDate, String openid) { |
||||
reportId = getDecodeString(reportId); |
||||
sampleCode = getDecodeString(sampleCode); |
||||
|
||||
log.info("[Lis微生物结果]查询: flag={{}}, reportId={}, testDate={{}}, sampleCode={{}}", flag, reportId, testDate, sampleCode); |
||||
|
||||
if ("1".equals(flag) && (testDate == null || sampleCode == null)) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
if (("2".equals(flag) || "4".equals(flag)) && reportId == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
try { |
||||
List<XBDLisBactResult> bactResults = new ArrayList<>(); |
||||
switch (flag) { |
||||
case "1": |
||||
bactResults = new XBDLisDao().getBactResult(testDate, sampleCode); |
||||
break; |
||||
case "2": |
||||
bactResults = new XBDLisDao().getBactResult4RM(Integer.parseInt(reportId)); |
||||
break; |
||||
case "3": |
||||
bactResults = new XBDLisDao().getBactResult4KH(testDate, sampleCode); |
||||
break; |
||||
case "4": |
||||
bactResults = new XBDLisDao().getBactResult4Sl(reportId); |
||||
break; |
||||
case "5": |
||||
bactResults = RMLisDao.getBactResult(reportId); |
||||
break; |
||||
} |
||||
return Result.success(bactResults); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.LIS_SELECT_DATA_ERROR); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 下载报告 |
||||
*/ |
||||
@Action("downLisReport") |
||||
public Result downLisReport(String callNo) { |
||||
// LIS类型 { 1:新八达LIS 2:瑞美LIS(需要加前缀M,红河不用加) 3:科华LIS }
|
||||
log.info("[LIS报告]下载: callNo={{}}", callNo); |
||||
if ("2".equals(callNo)) { // 瑞美
|
||||
String queryCode = getString("queryCode"); |
||||
String queryType = getString("queryType"); |
||||
return RMLisDao.downLisReport(queryType, queryCode); |
||||
} |
||||
return Result.error(); |
||||
} |
||||
|
||||
/** |
||||
* 展示报告 瑞美专用 |
||||
*/ |
||||
@Action("showLisReport") |
||||
public Result showLisReport(String queryCode) { |
||||
queryCode = getDecodeString(queryCode); |
||||
String queryType = "1"; //ReportID 报告单ID
|
||||
return RMLisDao.downLisReport(queryType, queryCode); |
||||
} |
||||
} |
||||
/* |
||||
* * |
||||
* * @Project 微信公众号 |
||||
* * @Author 张剑峰 |
||||
* * @Date 2020/12/3 下午4:35 |
||||
* * @Description |
||||
* * @Version v1.0.0 |
||||
* * @Copyright @ 2020 云南新八达科技有限公司 All rights reserved. |
||||
* |
||||
*/ |
||||
|
||||
package com.ynxbd.common.action.report; |
||||
|
||||
import com.ynxbd.common.action.base.BaseAction; |
||||
import com.ynxbd.common.bean.lis.XBDLisBactResult; |
||||
import com.ynxbd.common.bean.lis.XBDLisImageResult; |
||||
import com.ynxbd.common.bean.lis.XBDLisReport; |
||||
import com.ynxbd.common.bean.lis.XBDLisResult; |
||||
import com.ynxbd.common.dao.lis.RMLisDao; |
||||
import com.ynxbd.common.dao.lis.XBDLisDao; |
||||
import com.ynxbd.common.helper.common.Base64Helper; |
||||
import com.ynxbd.common.helper.common.ImageHelper; |
||||
import com.ynxbd.common.helper.common.NumHelper; |
||||
import com.ynxbd.common.result.Result; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.common.service.ReportService; |
||||
import com.ynxbd.wx.config.WeChatConfig; |
||||
import com.ynxbd.wx.wxfactory.ReqParamHelper; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.commons.codec.digest.DigestUtils; |
||||
import org.apache.commons.lang3.ObjectUtils; |
||||
import org.apache.struts2.convention.annotation.Action; |
||||
import org.apache.struts2.convention.annotation.Namespace; |
||||
|
||||
import java.io.File; |
||||
import java.io.FileInputStream; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
|
||||
@Slf4j |
||||
@Namespace("/lis") |
||||
public class LisReportAction extends BaseAction { |
||||
|
||||
/** |
||||
* 查询报告列表 |
||||
* |
||||
* @return 报告列表 |
||||
*/ |
||||
@Action("report") |
||||
public Result getReportList(String treatNum, String treatNumPrefix, String flag, String patientType, String startTime, String endTime) { |
||||
treatNum = getDecodeString(treatNum); |
||||
log.info("[Lis报告单]查询: flag={{}}, treatNumPrefix={{}}, treatNum={{}}, patientType={{}}", flag, treatNumPrefix, treatNum, patientType); |
||||
if (flag == null || patientType == null || treatNum == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
if (!ObjectUtils.isEmpty(treatNumPrefix)) { // 瑞美lis报告前缀
|
||||
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); |
||||
|
||||
String reportId; |
||||
for (XBDLisReport reportItem : lstReport) { |
||||
// 倒叙->base64->md5
|
||||
reportId = NumHelper.numDesc(reportItem.getId()); |
||||
if (reportId != null) { |
||||
reportId = Base64Helper.encode(reportId); |
||||
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; |
||||
} |
||||
|
||||
if (lstReport != null) { |
||||
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); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 普通报告 |
||||
*/ |
||||
@Action("result") |
||||
public Result getResult(String reportId, String sampleCode, String flag, String testDate, String openid) { |
||||
reportId = getDecodeString(reportId); |
||||
sampleCode = getDecodeString(sampleCode); |
||||
|
||||
log.info("[Lis结果]查询: flag={{}}, reportId={}, testDate={{}}, sampleCode={{}}", flag, reportId, testDate, sampleCode); |
||||
|
||||
if ("1".equals(flag) && (testDate == null || sampleCode == null)) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
if (("2".equals(flag) || "4".equals(flag)) && reportId == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
try { |
||||
List<XBDLisResult> lstResult = new ArrayList<>(); |
||||
switch (flag) { |
||||
case "1": // 新八达
|
||||
lstResult = new XBDLisDao().getResult(testDate, sampleCode); |
||||
break; |
||||
case "2": // 瑞美
|
||||
lstResult = new XBDLisDao().getResult4RM(Integer.parseInt(reportId)); |
||||
break; |
||||
case "3": // 科华
|
||||
lstResult = new XBDLisDao().getResult4KH(testDate, sampleCode); |
||||
break; |
||||
case "4": |
||||
lstResult = new XBDLisDao().getResult4Sl(reportId); |
||||
break; |
||||
case "5": |
||||
lstResult = RMLisDao.getReportResult(reportId); |
||||
break; |
||||
case "6": |
||||
lstResult = new XBDLisDao().getResult7RM(reportId); |
||||
break; |
||||
} |
||||
return Result.success(lstResult); |
||||
} catch (Exception e) { |
||||
return Result.success(ResultEnum.LIS_SELECT_DATA_ERROR); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 图像报告 |
||||
*/ |
||||
@Action("image") |
||||
public Result getImage(String reportId, String sampleCode, String flag, String testDate, String openid) { |
||||
reportId = getDecodeString(reportId); |
||||
sampleCode = getDecodeString(sampleCode); |
||||
|
||||
log.info("查询Lis图像: flag={{}}, reportId={}, testDate={{}}, sampleCode={{}}", flag, reportId, testDate, sampleCode); |
||||
if ("1".equals(flag) && (testDate == null || sampleCode == null)) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
if (("2".equals(flag) || "4".equals(flag)) && reportId == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
List<XBDLisImageResult> lstImage = new ArrayList<>(); |
||||
try { |
||||
switch (flag) { |
||||
case "1": |
||||
lstImage = new XBDLisDao().getImage(testDate, sampleCode); |
||||
break; |
||||
case "2": |
||||
lstImage = new XBDLisDao().getImage4RM(Integer.parseInt(reportId)); |
||||
break; |
||||
case "3": |
||||
lstImage = new XBDLisDao().getImage4KH(testDate, sampleCode); |
||||
break; |
||||
case "4": |
||||
lstImage = new XBDLisDao().getImage4Sl(reportId); |
||||
break; |
||||
case "6": |
||||
lstImage = new XBDLisDao().getImage7RM(reportId); |
||||
break; |
||||
} |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.LIS_SELECT_DATA_ERROR); |
||||
} |
||||
|
||||
FileInputStream fis = null; |
||||
byte[] bytes; |
||||
List<XBDLisImageResult> resultList = new ArrayList<>(); |
||||
for (XBDLisImageResult item : lstImage) { |
||||
if (item.getImage() == null && item.getUrl() != null) { |
||||
try { |
||||
fis = new FileInputStream(new File(item.getUrl())); |
||||
bytes = new byte[fis.available()]; |
||||
//将文件内容写入字节数组
|
||||
fis.read(bytes); |
||||
item.setImage(bytes); |
||||
item.setUrl(null); |
||||
|
||||
// 将图片字节码进行压缩
|
||||
byte[] decompressPicByte = ImageHelper.decompressPicByte(item.getImage(), 0); // 0:按100*200压缩、1:按原图片的50%压缩
|
||||
// 将图片字节进行base64编码(在word文档中显示图片时会用到base64转码)
|
||||
if (decompressPicByte != null) { |
||||
item.setImageBase64( |
||||
"data:image/jpg;base64," + ImageHelper.converPicBase64(decompressPicByte)); |
||||
} |
||||
item.setImage(null); |
||||
resultList.add(item); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} finally { |
||||
try { |
||||
if (fis != null) { |
||||
fis.close(); |
||||
} |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
return Result.success(resultList); |
||||
} |
||||
|
||||
/** |
||||
* 细菌报告 |
||||
*/ |
||||
@Action("bact") |
||||
public Result getBactResult(String reportId, String sampleCode, String flag, String testDate, String openid) { |
||||
reportId = getDecodeString(reportId); |
||||
sampleCode = getDecodeString(sampleCode); |
||||
|
||||
log.info("[Lis微生物结果]查询: flag={{}}, reportId={}, testDate={{}}, sampleCode={{}}", flag, reportId, testDate, sampleCode); |
||||
|
||||
if ("1".equals(flag) && (testDate == null || sampleCode == null)) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
if (("2".equals(flag) || "4".equals(flag)) && reportId == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
try { |
||||
List<XBDLisBactResult> bactResults = new ArrayList<>(); |
||||
switch (flag) { |
||||
case "1": |
||||
bactResults = new XBDLisDao().getBactResult(testDate, sampleCode); |
||||
break; |
||||
case "2": |
||||
bactResults = new XBDLisDao().getBactResult4RM(Integer.parseInt(reportId)); |
||||
break; |
||||
case "3": |
||||
bactResults = new XBDLisDao().getBactResult4KH(testDate, sampleCode); |
||||
break; |
||||
case "4": |
||||
bactResults = new XBDLisDao().getBactResult4Sl(reportId); |
||||
break; |
||||
case "5": |
||||
bactResults = RMLisDao.getBactResult(reportId); |
||||
break; |
||||
} |
||||
return Result.success(bactResults); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.LIS_SELECT_DATA_ERROR); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 下载报告 |
||||
* |
||||
* @param callNo 调用类型 |
||||
* @param queryType 查询类型 |
||||
* @param reportId 报告单ID |
||||
* @return |
||||
*/ |
||||
@Action("downLisReport") |
||||
public Result downLisReport(String callNo, String queryType, String reportId) { |
||||
// LIS类型 { 1:新八达LIS 2:瑞美LIS(需要加前缀M,红河不用加) 3:科华LIS }
|
||||
reportId = getDecodeString(reportId); |
||||
log.info("[LIS报告]下载: callNo={}, queryType={}, reportId={}", callNo, queryType, reportId); |
||||
if ("2".equals(callNo)) { // 瑞美
|
||||
if (queryType == null) queryType = "1"; |
||||
return RMLisDao.downLisReport(queryType, reportId); |
||||
} |
||||
return Result.error(); |
||||
} |
||||
|
||||
/** |
||||
* 展示报告 瑞美专用 |
||||
*/ |
||||
@Action("showLisReport") |
||||
public Result showLisReport(String queryCode) { |
||||
queryCode = getDecodeString(queryCode); // ReportID 报告单ID
|
||||
String queryType = "1"; |
||||
return RMLisDao.downLisReport(queryType, queryCode); |
||||
} |
||||
} |
@ -1,267 +1,396 @@ |
||||
package com.ynxbd.common.action; |
||||
|
||||
import com.ynxbd.common.action.base.BaseAction; |
||||
import com.ynxbd.common.bean.TreatRecord; |
||||
import com.ynxbd.common.bean.lis.XBDLisReport; |
||||
import com.ynxbd.common.bean.report.CheckReport; |
||||
import com.ynxbd.common.bean.report.InspectionReport; |
||||
import com.ynxbd.common.bean.report.PEIS; |
||||
import com.ynxbd.common.dao.his.HisReportDao; |
||||
import com.ynxbd.common.helper.common.DateHelper; |
||||
import com.ynxbd.common.result.Result; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.common.service.ReportService; |
||||
import com.ynxbd.wx.wxfactory.ReqParamHelper; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.struts2.convention.annotation.Action; |
||||
import org.apache.struts2.convention.annotation.Namespace; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Comparator; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author wsq |
||||
* @Date 2020/8/15 12:35 |
||||
* @Copyright @ 2020 云南新八达科技有限公司 All rights reserved. |
||||
*/ |
||||
@Slf4j |
||||
@Namespace("/report") |
||||
public class ReportAction extends BaseAction { |
||||
|
||||
/** |
||||
* [体检报告] |
||||
*/ |
||||
@Action("getPEISByPatient") |
||||
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
|
||||
try { |
||||
log.info("[体检报告]查询:patientId={}, idCardNo={}, name={}, begDate={}, endDate={}", patientId, idCardNo, name, begDate, endDate); |
||||
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<>(); |
||||
for (PEIS report : reportList) { |
||||
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); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* [检查报告] |
||||
*/ |
||||
@Action("getCheckByPatient") |
||||
public Result getCheckByPatient(String begDate, String endDate, String patientId, String openid) { |
||||
try { |
||||
patientId = getDecodeString(patientId); |
||||
// http://localhost:8080/wx/report/getCheckByPatient.do?patientId=153671&token=123
|
||||
log.info("[检查报告]查询 patientId={}, begDate={}, endDate={}", patientId, begDate, endDate); |
||||
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> resultList = new ArrayList<>(); |
||||
for (CheckReport report : reportList) { |
||||
if (report.getApplyDate() != null && DateHelper.inDateRange(begDate, endDate, report.getApplyDate(), DateHelper.DateEnum.yyyy_MM_dd)) { |
||||
resultList.add(report); |
||||
} |
||||
} |
||||
new ReportService().updateReportPacsCount(); |
||||
|
||||
return Result.success(resultList); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* [就诊记录]查询 |
||||
* |
||||
* @param begDate 开始日期 |
||||
* @param endDate 结束日期 |
||||
* @param patientId 患者id |
||||
* @param patientType 0:全部,1:门诊号,2:住院号 |
||||
* @param reportType 0:全部,1:检查,2:检验,3:检查+检验 |
||||
* @param isLately 是否只查询最近一条记录 |
||||
*/ |
||||
@Action("getTreatRecordList") |
||||
public Result getTreatRecordList(String begDate, String endDate, String patientId, String patientType, String reportType, Boolean isLately, String deptCode) { |
||||
try { |
||||
patientId = getDecodeString(patientId); |
||||
// http://localhost:8081/wx/report/getTreatRecordList.do?patientId=406212&begDate=201801-01&endDate=2020-08-12&patientType=0&reportType=2
|
||||
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.isEmpty() && isLately != null && isLately) { |
||||
List<TreatRecord> resultList = new ArrayList<>(); |
||||
records.stream().max(Comparator.comparing(TreatRecord::getConsultDate)).ifPresent(resultList::add); |
||||
return Result.success(resultList); |
||||
} |
||||
|
||||
for (TreatRecord record : records) { |
||||
if (record.getTreatNum() != null) { |
||||
record.setEnTreatNum(ReqParamHelper.encode(record.getTreatNum())); |
||||
} |
||||
} |
||||
return Result.success(records); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* [患者]查询化验(检验)结果 |
||||
*/ |
||||
@Action("getInspectByPatient") |
||||
public Result getInspectByPatient(String openid, String patientId, String begDate, String endDate) { |
||||
try { |
||||
patientId = getDecodeString(patientId); |
||||
|
||||
// http://localhost:8080/wx/report/getInspectByPatient.do?patientId=153671&token=123
|
||||
log.info("化验(检验)结果查询:patientId={}, begDate={}, endDate={}", patientId, begDate, endDate); |
||||
if (patientId == null || begDate == null || endDate == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
List<InspectionReport> reportList = new HisReportDao().getInspectByPatient(patientId); |
||||
|
||||
List<InspectionReport> resultList = new ArrayList<>(); |
||||
for (InspectionReport report : reportList) { |
||||
if (report.getApplyDate() != null && DateHelper.inDateRange(begDate, endDate, report.getApplyDate(), DateHelper.DateEnum.yyyy_MM_dd)) { |
||||
resultList.add(report); |
||||
} |
||||
} |
||||
return Result.success(resultList); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* [门诊号]根据门诊号查询化验(检验)结果 |
||||
*/ |
||||
@Action("getInspectByTreatNum") |
||||
public Result getInspectByTreatNum(String type, String treatNum, String patientId) { |
||||
try { |
||||
treatNum = getDecodeString(treatNum); |
||||
patientId = getDecodeString(patientId); |
||||
// http://localhost:8080/wx/report/getInspectByTreatNum.do?patientId=153671&token=123
|
||||
log.info("[化验(检验)]结果查询:patientId={}, type={}, treatNum={}", patientId, type, treatNum); |
||||
if (patientId == null || type == null || treatNum == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
String mzNum = null, zyNum = null; |
||||
if ("1".equals(type)) { |
||||
mzNum = treatNum; |
||||
} else { |
||||
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()); |
||||
|
||||
resultList.add(xbdLisReport); |
||||
} |
||||
return Result.success(resultList); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
} |
||||
|
||||
|
||||
// /**
|
||||
// * 根据openid查询检查报告
|
||||
// */
|
||||
// @Action("getCheckAll")
|
||||
// public String getCheckAll() {
|
||||
// String openid = getString("openid");
|
||||
// log.info("根据openid查询检查报告 openid={}", openid);
|
||||
// if (openid == null) {
|
||||
// return Result.error(ResultEnum.PARAM_NOT_COMPLETE);
|
||||
// }
|
||||
//
|
||||
// List<Patient> patients = new PatientDao().selectListByOpenid(openid);
|
||||
//
|
||||
// List<List<CheckReport>> reports = new ArrayList<>();
|
||||
// HisReportDao hisReportDao = new HisReportDao();
|
||||
// for (Patient patient : patients) {
|
||||
// List<CheckReport> reportItem = hisReportDao.getCheckByPatient(patient);
|
||||
// reports.add(reportItem);
|
||||
// }
|
||||
// return Result.success(reports);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据openid查询体检报告
|
||||
// */
|
||||
// @Action("getPEISReportAll")
|
||||
// public String getPEISReportAll() {
|
||||
// String openid = getString("openid");
|
||||
// log.info("根据openid查询体检报告 openid={}", openid);
|
||||
// if (openid == null) {
|
||||
// return Result.error(ResultEnum.PARAM_NOT_COMPLETE);
|
||||
// }
|
||||
//
|
||||
// List<Patient> patients = new PatientDao().selectListByOpenid(openid);
|
||||
//
|
||||
// List<List<PEIS>> reports = new ArrayList<>();
|
||||
// HisReportDao hisReportDao = new HisReportDao();
|
||||
// for (Patient patient : patients) {
|
||||
// List<PEIS> reportItem = hisReportDao.getPEISReportByPatient(patient);
|
||||
// reports.add(reportItem);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// return Result.success(reports);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据openid查询检验结果
|
||||
// */
|
||||
// @Action("getInspectionAll")
|
||||
// public String getInspectionAll() {
|
||||
// String openid = getString("openid");
|
||||
// log.info("根据openid查询检验结果,openid={}", openid);
|
||||
// if (openid == null) {
|
||||
// return Result.error(ResultEnum.PARAM_NOT_COMPLETE);
|
||||
// }
|
||||
//
|
||||
// List<Patient> patients = new PatientDao().selectListByOpenid(openid);
|
||||
//
|
||||
// List<List<InspectionReport>> reports = new ArrayList<>();
|
||||
// HisReportDao hisReportDao = new HisReportDao();
|
||||
// for (Patient patient : patients) {
|
||||
// List<InspectionReport> reportItem = hisReportDao.getInspectByPatient(patient.getPatientId());
|
||||
// reports.add(reportItem);
|
||||
// }
|
||||
// return Result.success(reports);
|
||||
// }
|
||||
|
||||
} |
||||
package com.ynxbd.common.action.report; |
||||
|
||||
import com.ynxbd.common.action.base.BaseAction; |
||||
import com.ynxbd.common.bean.TreatRecord; |
||||
import com.ynxbd.common.bean.lis.XBDLisReport; |
||||
import com.ynxbd.common.bean.report.CheckReport; |
||||
import com.ynxbd.common.bean.report.InspectionReport; |
||||
import com.ynxbd.common.bean.report.PEIS; |
||||
import com.ynxbd.common.dao.his.HisReportDao; |
||||
import com.ynxbd.common.helper.common.DateHelper; |
||||
import com.ynxbd.common.result.Result; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.common.service.ReportService; |
||||
import com.ynxbd.wx.wxfactory.ReqParamHelper; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.commons.lang3.ObjectUtils; |
||||
import org.apache.struts2.convention.annotation.Action; |
||||
import org.apache.struts2.convention.annotation.Namespace; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Comparator; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @Author wsq |
||||
* @Date 2020/8/15 12:35 |
||||
* @Copyright @ 2020 云南新八达科技有限公司 All rights reserved. |
||||
*/ |
||||
@Slf4j |
||||
@Namespace("/report") |
||||
public class ReportAction extends BaseAction { |
||||
|
||||
/** |
||||
* [体检报告] |
||||
*/ |
||||
@Action("getPEISByPatient") |
||||
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
|
||||
try { |
||||
log.info("[体检报告]查询:patientId={}, idCardNo={}, name={}, begDate={}, endDate={}", patientId, idCardNo, name, begDate, endDate); |
||||
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<>(); |
||||
for (PEIS report : reportList) { |
||||
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); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* [检查报告] |
||||
* |
||||
* @param begDate 开始日期 |
||||
* @param endDate 结束日期 |
||||
* @param patientId 患者id |
||||
* @param treatNum 门诊号(可选) |
||||
* @param openid openid |
||||
* @return list |
||||
*/ |
||||
@Action("getCheckByPatient") |
||||
public Result getCheckByPatient(String begDate, String endDate, String patientId, String treatNum, String openid) { |
||||
try { |
||||
patientId = getDecodeString(patientId); |
||||
// http://localhost:8080/wx/report/getCheckByPatient.do?patientId=153671&token=123
|
||||
log.info("[检查报告]查询 patientId={}, begDate={}, endDate={}, treatNum={}", patientId, begDate, endDate, treatNum); |
||||
if (patientId == null || begDate == null || endDate == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
List<CheckReport> reportList = new HisReportDao().getCheckByPatient(patientId, begDate, endDate); |
||||
new ReportService().updateReportPacsCount(); |
||||
if (reportList.isEmpty()) { |
||||
return Result.success(reportList); |
||||
} |
||||
List<CheckReport> dataList = new ArrayList<>(); |
||||
String reportTreatNum; |
||||
for (CheckReport report : reportList) { |
||||
reportTreatNum = report.getMzNum(); |
||||
if (!ObjectUtils.isEmpty(reportTreatNum)) { |
||||
report.setTreatType("1"); // 门诊
|
||||
} else { |
||||
reportTreatNum = report.getZyNum(); |
||||
if (!ObjectUtils.isEmpty(reportTreatNum)) { |
||||
report.setTreatType("2"); // 住院
|
||||
} |
||||
} |
||||
report.setReportName(report.getName()); |
||||
report.setReportType(report.getType()); |
||||
report.setTreatNum(reportTreatNum); |
||||
report.setEnTreatNum(ReqParamHelper.encode(reportTreatNum)); |
||||
if (report.getApplyDate() != null && DateHelper.inDateRange(begDate, endDate, report.getApplyDate(), DateHelper.DateEnum.yyyy_MM_dd)) { |
||||
dataList.add(report); |
||||
} |
||||
} |
||||
|
||||
if (!dataList.isEmpty() && treatNum != null) { |
||||
dataList = reportList.stream().filter(o -> treatNum.equals(o.getTreatNum())).collect(Collectors.toList()); |
||||
} |
||||
return Result.success(dataList); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* [检查报告] |
||||
* |
||||
* @param begDate 开始日期 |
||||
* @param endDate 结束日期 |
||||
* @param patientId 患者id |
||||
* @param treatNum 门诊号(可选) |
||||
* @param isDistinctTreat 是否去重就诊记录 |
||||
* @param openid openid |
||||
* @return list |
||||
*/ |
||||
@Action("getHisCheckByTreat") |
||||
public Result getHisCheckByTreat(String begDate, String endDate, String patientId, String treatNum, Boolean isDistinctTreat, String openid) { |
||||
try { |
||||
patientId = getDecodeString(patientId); |
||||
// http://localhost:8080/wx/report/getCheckByPatient.do?patientId=153671&token=123
|
||||
log.info("[检查报告]查询 patientId={}, begDate={}, endDate={}, treatNum={}, isDistinctTreat={}", patientId, begDate, endDate, treatNum, isDistinctTreat); |
||||
if (patientId == null || begDate == null || endDate == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
List<CheckReport> reportList = new HisReportDao().getCheckByPatient(patientId, begDate, endDate); |
||||
if (reportList.isEmpty()) { |
||||
return Result.success(reportList); |
||||
} |
||||
|
||||
// 查询就诊记录
|
||||
if (isDistinctTreat != null && isDistinctTreat) { // 就诊记录去重
|
||||
List<CheckReport> treatList = new ArrayList<>(); |
||||
for (CheckReport item : reportList) { |
||||
item.filterInfo(); // 敏感数据过滤
|
||||
item.filterWebData(); |
||||
if (ObjectUtils.isEmpty(item.getTreatNum())) { |
||||
continue; |
||||
} |
||||
if (item.getApplyDate() != null && DateHelper.inDateRange(begDate, endDate, item.getApplyDate(), DateHelper.DateEnum.yyyy_MM_dd)) { |
||||
CheckReport findTreat = treatList.stream().filter(o -> item.getTreatNum().equals(o.getTreatNum())).findFirst().orElse(null); |
||||
if (findTreat == null) { |
||||
treatList.add(item); |
||||
} |
||||
} |
||||
} |
||||
return Result.success(treatList); |
||||
} |
||||
|
||||
new ReportService().updateReportPacsCount(); |
||||
|
||||
List<CheckReport> dataList = new ArrayList<>(); |
||||
if (!reportList.isEmpty() && treatNum != null) { |
||||
for (CheckReport item : reportList) { |
||||
item.filterWebData(); // 位置不能变
|
||||
if (treatNum.equals(item.getTreatNum())) { |
||||
dataList.add(item); |
||||
} |
||||
} |
||||
} |
||||
return Result.success(dataList); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* [就诊记录]查询 |
||||
* |
||||
* @param begDate 开始日期 |
||||
* @param endDate 结束日期 |
||||
* @param patientId 患者id |
||||
* @param patientType 0:全部,1:门诊号,2:住院号 |
||||
* @param reportType 0:全部,1:检查,2:检验,3:检查+检验 |
||||
* @param isLately 是否只查询最近一条记录 |
||||
*/ |
||||
@Action("getTreatRecordList") |
||||
public Result getTreatRecordList(String begDate, String endDate, String patientId, String patientType, String reportType, Boolean isLately, String deptCode) { |
||||
try { |
||||
patientId = getDecodeString(patientId); |
||||
// http://localhost:8081/wx/report/getTreatRecordList.do?patientId=406212&begDate=201801-01&endDate=2020-08-12&patientType=0&reportType=2
|
||||
if (patientId == null || begDate == null || endDate == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
List<TreatRecord> records = new HisReportDao().getReportTreatRecords(patientId, begDate, endDate, patientType, reportType, deptCode); |
||||
|
||||
if (!records.isEmpty() && isLately != null && isLately) { |
||||
List<TreatRecord> resultList = new ArrayList<>(); |
||||
records.stream().max(Comparator.comparing(TreatRecord::getConsultDate)).ifPresent(resultList::add); |
||||
return Result.success(resultList); |
||||
} |
||||
|
||||
for (TreatRecord record : records) { |
||||
if (record.getTreatNum() != null) { |
||||
record.setEnTreatNum(ReqParamHelper.encode(record.getTreatNum())); |
||||
} |
||||
} |
||||
return Result.success(records); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* [就诊记录]查询 |
||||
* |
||||
* @param begDate 开始日期 |
||||
* @param endDate 结束日期 |
||||
* @param patientId 患者id |
||||
* @param treatType 0:全部,1:门诊号,2:住院号 |
||||
* @param reportType 0:全部,1:检查,2:检验,3:检查+检验 |
||||
* @param isLately 是否只查询最近一条记录 |
||||
*/ |
||||
@Action("getReportTreatRecords") |
||||
public Result getReportTreatRecords(String begDate, String endDate, String patientId, String treatType, String reportType, Boolean isLately, String deptCode) { |
||||
try { |
||||
patientId = getDecodeString(patientId); |
||||
// http://localhost:8081/wx/report/getTreatRecords.do?patientId=406212&begDate=201801-01&endDate=2020-08-12&treatType=0&reportType=2
|
||||
if (patientId == null || begDate == null || endDate == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
List<TreatRecord> records = new HisReportDao().getReportTreatRecords(patientId, begDate, endDate, treatType, reportType, deptCode); |
||||
if (records == null || records.isEmpty()) { |
||||
return Result.success(new ArrayList<>()); |
||||
} |
||||
for (TreatRecord record : records) { |
||||
if (record.getTreatNum() != null) { |
||||
record.setEnTreatNum(ReqParamHelper.encode(record.getTreatNum())); |
||||
} |
||||
} |
||||
|
||||
if (isLately != null && isLately) { |
||||
List<TreatRecord> resultList = new ArrayList<>(); |
||||
records.stream().max(Comparator.comparing(TreatRecord::getConsultDate)).ifPresent(resultList::add); |
||||
return Result.success(resultList); |
||||
} |
||||
return Result.success(records); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* [患者]查询化验(检验)结果 |
||||
*/ |
||||
@Action("getInspectByPatient") |
||||
public Result getInspectByPatient(String openid, String patientId, String begDate, String endDate) { |
||||
try { |
||||
patientId = getDecodeString(patientId); |
||||
|
||||
// http://localhost:8080/wx/report/getInspectByPatient.do?patientId=153671&token=123
|
||||
log.info("化验(检验)结果查询:patientId={}, begDate={}, endDate={}", patientId, begDate, endDate); |
||||
if (patientId == null || begDate == null || endDate == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
List<InspectionReport> reportList = new HisReportDao().getInspectByPatient(patientId); |
||||
|
||||
List<InspectionReport> resultList = new ArrayList<>(); |
||||
for (InspectionReport report : reportList) { |
||||
if (report.getApplyDate() != null && DateHelper.inDateRange(begDate, endDate, report.getApplyDate(), DateHelper.DateEnum.yyyy_MM_dd)) { |
||||
resultList.add(report); |
||||
} |
||||
} |
||||
return Result.success(resultList); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* [门诊号]通过HIS根据门诊号查询化验(检验)结果 |
||||
*/ |
||||
@Action("getInspectByTreatNum") |
||||
public Result getInspectByTreatNum(String type, String treatNum, String patientId) { |
||||
try { |
||||
treatNum = getDecodeString(treatNum); |
||||
patientId = getDecodeString(patientId); |
||||
// http://localhost:8080/wx/report/getInspectByTreatNum.do?patientId=153671&token=123
|
||||
log.info("[化验(检验)]结果查询:patientId={}, type={}, treatNum={}", patientId, type, treatNum); |
||||
if (patientId == null || type == null || treatNum == null) { |
||||
return Result.error(ResultEnum.PARAM_IS_BLANK); |
||||
} |
||||
|
||||
String mzNum = null, zyNum = null; |
||||
if ("1".equals(type)) { |
||||
mzNum = treatNum; |
||||
} else { |
||||
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()); |
||||
|
||||
resultList.add(xbdLisReport); |
||||
} |
||||
return Result.success(resultList); |
||||
} catch (Exception e) { |
||||
return Result.error(ResultEnum.INTERFACE_HIS_INVOKE_ERROR); |
||||
} |
||||
} |
||||
|
||||
|
||||
// /**
|
||||
// * 根据openid查询检查报告
|
||||
// */
|
||||
// @Action("getCheckAll")
|
||||
// public String getCheckAll() {
|
||||
// String openid = getString("openid");
|
||||
// log.info("根据openid查询检查报告 openid={}", openid);
|
||||
// if (openid == null) {
|
||||
// return Result.error(ResultEnum.PARAM_NOT_COMPLETE);
|
||||
// }
|
||||
//
|
||||
// List<Patient> patients = new PatientDao().selectListByOpenid(openid);
|
||||
//
|
||||
// List<List<CheckReport>> reports = new ArrayList<>();
|
||||
// HisReportDao hisReportDao = new HisReportDao();
|
||||
// for (Patient patient : patients) {
|
||||
// List<CheckReport> reportItem = hisReportDao.getCheckByPatient(patient);
|
||||
// reports.add(reportItem);
|
||||
// }
|
||||
// return Result.success(reports);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据openid查询体检报告
|
||||
// */
|
||||
// @Action("getPEISReportAll")
|
||||
// public String getPEISReportAll() {
|
||||
// String openid = getString("openid");
|
||||
// log.info("根据openid查询体检报告 openid={}", openid);
|
||||
// if (openid == null) {
|
||||
// return Result.error(ResultEnum.PARAM_NOT_COMPLETE);
|
||||
// }
|
||||
//
|
||||
// List<Patient> patients = new PatientDao().selectListByOpenid(openid);
|
||||
//
|
||||
// List<List<PEIS>> reports = new ArrayList<>();
|
||||
// HisReportDao hisReportDao = new HisReportDao();
|
||||
// for (Patient patient : patients) {
|
||||
// List<PEIS> reportItem = hisReportDao.getPEISReportByPatient(patient);
|
||||
// reports.add(reportItem);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// return Result.success(reports);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据openid查询检验结果
|
||||
// */
|
||||
// @Action("getInspectionAll")
|
||||
// public String getInspectionAll() {
|
||||
// String openid = getString("openid");
|
||||
// log.info("根据openid查询检验结果,openid={}", openid);
|
||||
// if (openid == null) {
|
||||
// return Result.error(ResultEnum.PARAM_NOT_COMPLETE);
|
||||
// }
|
||||
//
|
||||
// List<Patient> patients = new PatientDao().selectListByOpenid(openid);
|
||||
//
|
||||
// List<List<InspectionReport>> reports = new ArrayList<>();
|
||||
// HisReportDao hisReportDao = new HisReportDao();
|
||||
// for (Patient patient : patients) {
|
||||
// List<InspectionReport> reportItem = hisReportDao.getInspectByPatient(patient.getPatientId());
|
||||
// reports.add(reportItem);
|
||||
// }
|
||||
// return Result.success(reports);
|
||||
// }
|
||||
|
||||
} |
@ -1,167 +1,163 @@ |
||||
package com.ynxbd.common.action; |
||||
|
||||
import com.ynxbd.common.action.base.BaseAction; |
||||
import com.ynxbd.common.bean.enums.MerchantEnum; |
||||
import com.ynxbd.common.helper.common.DateHelper; |
||||
import com.ynxbd.common.result.Result; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.common.result.ServiceException; |
||||
import com.ynxbd.common.service.MedicalService; |
||||
import com.ynxbd.common.service.OutCollectService; |
||||
import com.ynxbd.wx.wxfactory.WxMedicalHelper; |
||||
import com.ynxbd.wx.wxfactory.bean.MedicalOrder; |
||||
import com.ynxbd.wx.wxfactory.medical.MdConfig; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.struts2.convention.annotation.Action; |
||||
import org.apache.struts2.convention.annotation.Namespace; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* @Author wsq |
||||
* @Date 2021/3/17 10:57 |
||||
* @Copyright @ 2020 云南新八达科技有限公司 All rights reserved. |
||||
*/ |
||||
|
||||
@Slf4j |
||||
@Namespace("/test02") |
||||
public class TestAction extends BaseAction { |
||||
|
||||
|
||||
// @Action("a")
|
||||
// public String a() {
|
||||
// String sql = "select * from a limit 0, 100";
|
||||
// List<A> data = DataBase.select(sql, A.class);
|
||||
// for (A a : data) {
|
||||
// System.out.println(data);
|
||||
// }
|
||||
// return Result.success(data);
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// sb.append("http://10.20.10.60:8123/MessagePlatform/DaoYiXun?");
|
||||
// sb.append("templateId=");
|
||||
// sb.append("6hpr5eY-nnCIkFu2ZeuvFjd0YG1ZwlHOo_ikRSXJUg4");
|
||||
// //
|
||||
// sb.append("&patientName=");
|
||||
// sb.append("患者");
|
||||
// //
|
||||
// sb.append("&content=");
|
||||
// sb.append("内容");
|
||||
// //
|
||||
// sb.append("&openId=");
|
||||
// sb.append("32EBE22EF6C9437575AB7A043E456D25704583EFA5E6BE1B5CB899A6F3B7075A");
|
||||
// //
|
||||
// sb.append("&deptName=");
|
||||
// sb.append("科室");
|
||||
// //
|
||||
// sb.append("&deptCode=");
|
||||
// sb.append("1234");
|
||||
// ResponseEntity<String> responseEntity = new RestTemplate().getForEntity("http://10.20.10.60:8123/MessagePlatform/DaoYiXun?templateId=6hpr5eY-nnCIkFu2ZeuvFjd0YG1ZwlHOo_ikRSXJUg4&patientName=王绍全&content=挂号时间&openId=32EBE22EF6C9437575AB7A043E456D25704583EFA5E6BE1B5CB899A6F3B7075A&deptName=方便门诊&deptCode=5201", String.class);
|
||||
//
|
||||
// String body = responseEntity.getBody();
|
||||
// System.out.println(body);
|
||||
// System.out.println(responseEntity);
|
||||
// return Result.error();
|
||||
// }
|
||||
|
||||
|
||||
// @Action("ocPay")
|
||||
// public Result ocPay(String outTradeNo) throws ServiceException {
|
||||
// new OutCollectService().ocPayNotify(MerchantEnum.WX, "123", new BigDecimal("0.01"), outTradeNo, "123", "123");
|
||||
// return Result.success();
|
||||
// }
|
||||
|
||||
|
||||
@Action("test03") |
||||
public Result test03() throws ServiceException { |
||||
System.out.println("开关" + MdConfig.IS_AUTO_REFUND); |
||||
log.info("日志测试"); |
||||
return Result.success(); |
||||
} |
||||
|
||||
@Action("md_refund_test") |
||||
public Result md_refund_test() throws ServiceException { |
||||
// WxMedicalHelper.refundCash("", "", new BigDecimal("0.440"), "系统繁忙缴费失败,自动退费");
|
||||
return Result.success(); |
||||
} |
||||
|
||||
|
||||
// @Action("lock")
|
||||
// public String lock() {
|
||||
// return Result.success(update());
|
||||
// }
|
||||
// public synchronized Integer update(){
|
||||
// int update = DataBase.update("update pay set remark = ? where outTradeNo= ?, updateTime=now()", ps -> {
|
||||
// ps.setString(1, CodeHelper.getRandomCode(8));
|
||||
// ps.setString(2, "00015d3064434d8c8c4a016b84602f89");
|
||||
// });
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
// @Action("api")
|
||||
// public Result api(String callNo, String patientId, String refundDesc, String payOrdId) {
|
||||
// String verify = request.getHeader("verify");
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
//
|
||||
// map.put("callNo", callNo);
|
||||
// map.put("patientId", patientId);
|
||||
// map.put("refundDesc", refundDesc);
|
||||
// map.put("payOrdId", payOrdId);
|
||||
// map.put("verify", verify);
|
||||
//
|
||||
// map.put("transNo", "transNo123");
|
||||
// map.put("payWay", 4);
|
||||
// map.put("bankTransNo", "bankTransNo123");
|
||||
// map.put("payMoney", new BigDecimal("0.01"));
|
||||
//
|
||||
// if (patientId != null && payOrdId != null) {
|
||||
// String piMd5 = patientId + payOrdId + "xbd";
|
||||
// map.put("wx_verify", DigestUtils.md5Hex(piMd5).toUpperCase());
|
||||
// }
|
||||
// return Result.success(map);
|
||||
// }
|
||||
|
||||
// @Action(value = "api2")
|
||||
// public Result api2(String id) {
|
||||
// String post = HttpClientHelper.post("http://127.0.0.1:8081/wx/test02/api.do?a=123", null, null);
|
||||
// return Result.success(post);
|
||||
// }
|
||||
|
||||
|
||||
@Action("test") |
||||
public Result test(String billDate) { |
||||
if (!DateHelper.isValidDate(billDate, DateHelper.DateEnum.yyyy_MM_dd)) { |
||||
return Result.error(ResultEnum.PARAM_DATE_ERROR); |
||||
} |
||||
|
||||
System.out.println(DateHelper.getMoveDate(new Date(), -1)); |
||||
if (billDate.equals(DateHelper.getMoveDate(new Date(), -1))) { |
||||
if (!DateHelper.isCurTimeOver("03:00:00")) { |
||||
return Result.error("查询前一天的数据,需要在今天9点15之后"); |
||||
} |
||||
} |
||||
return Result.success(); |
||||
} |
||||
|
||||
//
|
||||
// @Action("refundReg")
|
||||
// public Result refundReg() {
|
||||
//
|
||||
// List<Order> orders = new RegisterDao().selectRefundList("2022-09-22", "2022-09-29");
|
||||
// log.info("退费笔数{}", orders.size());
|
||||
// if (orders.size() > 60) {
|
||||
// return Result.error("退费数量过多");
|
||||
// }
|
||||
// String payCode = "wx";
|
||||
// for (Order item : orders) {
|
||||
// String openid = item.getOpenid();
|
||||
// if (openid != null && openid.length() == 16) {
|
||||
// payCode = "ali";
|
||||
// }
|
||||
// new RegService().cancelRegReserve(payCode, item.getPatientId(), item.getTradeNo(), item.getHisTransNo());
|
||||
// }
|
||||
// return Result.success();
|
||||
// }
|
||||
package com.ynxbd.common.action.test; |
||||
|
||||
import com.ynxbd.common.action.base.BaseAction; |
||||
import com.ynxbd.common.helper.common.DateHelper; |
||||
import com.ynxbd.common.result.Result; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.common.result.ServiceException; |
||||
import com.ynxbd.wx.wxfactory.WxMedicalHelper; |
||||
import com.ynxbd.wx.wxfactory.medical.MdConfig; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.struts2.convention.annotation.Action; |
||||
import org.apache.struts2.convention.annotation.Namespace; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* @Author wsq |
||||
* @Date 2021/3/17 10:57 |
||||
* @Copyright @ 2020 云南新八达科技有限公司 All rights reserved. |
||||
*/ |
||||
|
||||
@Slf4j |
||||
@Namespace("/test02") |
||||
public class TestAction extends BaseAction { |
||||
|
||||
|
||||
// @Action("a")
|
||||
// public String a() {
|
||||
// String sql = "select * from a limit 0, 100";
|
||||
// List<A> data = DataBase.select(sql, A.class);
|
||||
// for (A a : data) {
|
||||
// System.out.println(data);
|
||||
// }
|
||||
// return Result.success(data);
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// sb.append("http://10.20.10.60:8123/MessagePlatform/DaoYiXun?");
|
||||
// sb.append("templateId=");
|
||||
// sb.append("6hpr5eY-nnCIkFu2ZeuvFjd0YG1ZwlHOo_ikRSXJUg4");
|
||||
// //
|
||||
// sb.append("&patientName=");
|
||||
// sb.append("患者");
|
||||
// //
|
||||
// sb.append("&content=");
|
||||
// sb.append("内容");
|
||||
// //
|
||||
// sb.append("&openId=");
|
||||
// sb.append("32EBE22EF6C9437575AB7A043E456D25704583EFA5E6BE1B5CB899A6F3B7075A");
|
||||
// //
|
||||
// sb.append("&deptName=");
|
||||
// sb.append("科室");
|
||||
// //
|
||||
// sb.append("&deptCode=");
|
||||
// sb.append("1234");
|
||||
// ResponseEntity<String> responseEntity = new RestTemplate().getForEntity("http://10.20.10.60:8123/MessagePlatform/DaoYiXun?templateId=6hpr5eY-nnCIkFu2ZeuvFjd0YG1ZwlHOo_ikRSXJUg4&patientName=王绍全&content=挂号时间&openId=32EBE22EF6C9437575AB7A043E456D25704583EFA5E6BE1B5CB899A6F3B7075A&deptName=方便门诊&deptCode=5201", String.class);
|
||||
//
|
||||
// String body = responseEntity.getBody();
|
||||
// System.out.println(body);
|
||||
// System.out.println(responseEntity);
|
||||
// return Result.error();
|
||||
// }
|
||||
|
||||
|
||||
// @Action("ocPay")
|
||||
// public Result ocPay(String outTradeNo) throws ServiceException {
|
||||
// new OutCollectService().ocPayNotify(MerchantEnum.WX, "123", new BigDecimal("0.01"), outTradeNo, "123", "123");
|
||||
// return Result.success();
|
||||
// }
|
||||
|
||||
|
||||
@Action("test03") |
||||
public Result test03() throws ServiceException { |
||||
System.out.println("开关" + MdConfig.IS_AUTO_REFUND); |
||||
log.info("日志测试"); |
||||
return Result.success(); |
||||
} |
||||
|
||||
@Action("md_refund_test") |
||||
public Result md_refund_test() throws ServiceException { |
||||
WxMedicalHelper.refundCash("WX_M202f622bb3444a033f7a014a421b", "ORD530100202505100932115202726", new BigDecimal("183.390"), "人工退费"); |
||||
return Result.success(); |
||||
} |
||||
|
||||
|
||||
// @Action("lock")
|
||||
// public String lock() {
|
||||
// return Result.success(update());
|
||||
// }
|
||||
// public synchronized Integer update(){
|
||||
// int update = DataBase.update("update pay set remark = ? where outTradeNo= ?, updateTime=now()", ps -> {
|
||||
// ps.setString(1, CodeHelper.getRandomCode(8));
|
||||
// ps.setString(2, "00015d3064434d8c8c4a016b84602f89");
|
||||
// });
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
// @Action("api")
|
||||
// public Result api(String callNo, String patientId, String refundDesc, String payOrdId) {
|
||||
// String verify = request.getHeader("verify");
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
//
|
||||
// map.put("callNo", callNo);
|
||||
// map.put("patientId", patientId);
|
||||
// map.put("refundDesc", refundDesc);
|
||||
// map.put("payOrdId", payOrdId);
|
||||
// map.put("verify", verify);
|
||||
//
|
||||
// map.put("transNo", "transNo123");
|
||||
// map.put("payWay", 4);
|
||||
// map.put("bankTransNo", "bankTransNo123");
|
||||
// map.put("payMoney", new BigDecimal("0.01"));
|
||||
//
|
||||
// if (patientId != null && payOrdId != null) {
|
||||
// String piMd5 = patientId + payOrdId + "xbd";
|
||||
// map.put("wx_verify", DigestUtils.md5Hex(piMd5).toUpperCase());
|
||||
// }
|
||||
// return Result.success(map);
|
||||
// }
|
||||
|
||||
// @Action(value = "api2")
|
||||
// public Result api2(String id) {
|
||||
// String post = HttpClientHelper.post("http://127.0.0.1:8081/wx/test02/api.do?a=123", null, null);
|
||||
// return Result.success(post);
|
||||
// }
|
||||
|
||||
|
||||
@Action("test") |
||||
public Result test(String billDate) { |
||||
if (!DateHelper.isValidDate(billDate, DateHelper.DateEnum.yyyy_MM_dd)) { |
||||
return Result.error(ResultEnum.PARAM_DATE_ERROR); |
||||
} |
||||
|
||||
System.out.println(DateHelper.getMoveDate(new Date(), -1)); |
||||
if (billDate.equals(DateHelper.getMoveDate(new Date(), -1))) { |
||||
if (!DateHelper.isCurTimeOver("03:00:00")) { |
||||
return Result.error("查询前一天的数据,需要在今天9点15之后"); |
||||
} |
||||
} |
||||
return Result.success(); |
||||
} |
||||
|
||||
//
|
||||
// @Action("refundReg")
|
||||
// public Result refundReg() {
|
||||
//
|
||||
// List<Order> orders = new RegisterDao().selectRefundList("2022-09-22", "2022-09-29");
|
||||
// log.info("退费笔数{}", orders.size());
|
||||
// if (orders.size() > 60) {
|
||||
// return Result.error("退费数量过多");
|
||||
// }
|
||||
// String payCode = "wx";
|
||||
// for (Order item : orders) {
|
||||
// String openid = item.getOpenid();
|
||||
// if (openid != null && openid.length() == 16) {
|
||||
// payCode = "ali";
|
||||
// }
|
||||
// new RegService().cancelRegReserve(payCode, item.getPatientId(), item.getTradeNo(), item.getHisTransNo());
|
||||
// }
|
||||
// return Result.success();
|
||||
// }
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ynxbd.common.bean; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.Setter; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Setter |
||||
@Getter |
||||
@ToString |
||||
@NoArgsConstructor |
||||
public class CommonOption implements Serializable { |
||||
private String optId; |
||||
private String value; |
||||
private String text; |
||||
} |
@ -0,0 +1,46 @@ |
||||
package com.ynxbd.common.bean; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.Setter; |
||||
import lombok.ToString; |
||||
import org.apache.commons.lang3.ObjectUtils; |
||||
|
||||
import java.io.Serializable; |
||||
import java.time.LocalDateTime; |
||||
|
||||
// 就医助手
|
||||
|
||||
@Setter |
||||
@Getter |
||||
@ToString |
||||
@NoArgsConstructor |
||||
public class MedTool implements Serializable { |
||||
private Long id; |
||||
// 类型:1.挂号;2.问诊
|
||||
private Integer type; |
||||
// 就诊号
|
||||
private String treatNum; |
||||
// 进度标识
|
||||
private String processMark; |
||||
// 修改时间
|
||||
private LocalDateTime updateTime; |
||||
|
||||
|
||||
// 拼接进度状态
|
||||
public String spliceProcessMark(String addMark) { |
||||
if (ObjectUtils.isEmpty(addMark)) { |
||||
return null; |
||||
} |
||||
String dbMark = this.processMark; |
||||
String updateMark = addMark; |
||||
if (!ObjectUtils.isEmpty(dbMark)) { |
||||
if (dbMark.contains(addMark)) { // 已存在
|
||||
return null; |
||||
} else { |
||||
updateMark = dbMark + "," + addMark; |
||||
} |
||||
} |
||||
return updateMark; |
||||
} |
||||
} |
@ -0,0 +1,29 @@ |
||||
package com.ynxbd.common.bean; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.Setter; |
||||
import lombok.ToString; |
||||
|
||||
@Setter |
||||
@Getter |
||||
@ToString |
||||
@NoArgsConstructor |
||||
public class RegSign { |
||||
private String treatNum; |
||||
private String patientId; |
||||
private String patientName; |
||||
private String deptCode; |
||||
private String deptName; |
||||
private String doctCode; |
||||
private String doctName; |
||||
|
||||
// 号源日期
|
||||
private String scheduleDate; |
||||
private String begTime; |
||||
private String endTime; |
||||
// His挂号日期
|
||||
private String regDateTime; |
||||
// His挂号预约日期(预约挂号才有)
|
||||
private String reservationDate; |
||||
} |
@ -0,0 +1,37 @@ |
||||
package com.ynxbd.common.dao; |
||||
|
||||
import com.ynxbd.common.bean.MedTool; |
||||
import com.ynxbd.common.config.db.DataBase; |
||||
|
||||
public class MedToolDao { |
||||
|
||||
public boolean add(String treatNum, Integer type, String processMark) { |
||||
String sql = "insert into med_tool(updateTime, treatNum, type, processMark) values(now(), ?, ?, ?)"; |
||||
return DataBase.update(sql, ps -> { |
||||
ps.setString(1, treatNum); |
||||
ps.setInt(2, type); |
||||
ps.setString(3, processMark); |
||||
}) > 0; |
||||
} |
||||
|
||||
// LOCATE未找到返回0
|
||||
public boolean updateProcessMark(String treatNum, Integer type, String addMark, String updateMark) { |
||||
String sql = "update med_tool set processMark=?, updateTime=now() where treatNum=? and type=? and Locate(?, ifNull(processMark, '')) = 0"; |
||||
return DataBase.update(sql, ps -> { |
||||
ps.setString(1, updateMark); |
||||
ps.setString(2, treatNum); |
||||
ps.setInt(3, type); |
||||
ps.setString(4, addMark); |
||||
}) > 0; |
||||
} |
||||
|
||||
|
||||
|
||||
public MedTool selectByTreatNumAndType(String treatNum, Integer type) { |
||||
String sql = "select * from med_tool where treatNum=? and type=?"; |
||||
return DataBase.selectOne(sql, MedTool.class, ps -> { |
||||
ps.setString(1, treatNum); |
||||
ps.setInt(2, type); |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,21 @@ |
||||
package com.ynxbd.common.service; |
||||
|
||||
import com.ynxbd.common.bean.MedTool; |
||||
import com.ynxbd.common.dao.MedToolDao; |
||||
|
||||
public class MedToolService { |
||||
|
||||
public boolean saveMedToolMarkByTreatNum(String treatNum, Integer type, String processMark) { |
||||
MedToolDao medToolDao = new MedToolDao(); |
||||
MedTool medTool = medToolDao.selectByTreatNumAndType(treatNum, type); |
||||
if (medTool == null) { |
||||
return medToolDao.add(treatNum, type, processMark); |
||||
} else { |
||||
String mark = medTool.spliceProcessMark(processMark); |
||||
if (mark == null) { // 为空说明无需修改
|
||||
return true; |
||||
} |
||||
return medToolDao.updateProcessMark(treatNum, type, processMark, mark); |
||||
} |
||||
} |
||||
} |
@ -1,12 +0,0 @@ |
||||
package com.ynxbd.common.test; |
||||
|
||||
import com.ynxbd.common.helper.common.AesHelper; |
||||
import com.ynxbd.wx.wxfactory.ReqParamHelper; |
||||
|
||||
public class Test01 { |
||||
|
||||
public static void main(String[] args) { |
||||
// 患者id
|
||||
System.out.println(ReqParamHelper.encode("282466")); |
||||
} |
||||
} |
@ -1 +1 @@ |
||||
# 开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
his.is_recipe_prepay=false
lis.url= 192.168.1.185:8090
lis.unifiedEntrance = true
# 本地
#his.url=127.0.0.1:8888
# 测试环境
# 是否强制打印webservice的xml返回数据
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
his.is_recipe_prepay=false
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
lis.url= 192.168.1.185:8090
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
lis.unifiedEntrance = true
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
# 本地
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
#his.url=127.0.0.1:8888
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
# 测试环境
ali_code = 675448357
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
# 是否强制打印webservice的xml返回数据
his.is_recipe_prepay=false
his.is_recipe_prepay=false
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
his.is_recipe_prepay=false
his.is_recipe_prepay=false
# 红河医保
#his.url=10.20.10.6:8888
#his.url=192.168.12.10:8888
his.is_recipe_prepay=false
lis.unifiedEntrance = true
his.is_recipe_prepay=false
# 本地
his.is_recipe_prepay=false
#his.url=127.0.0.1:8888
his.is_recipe_prepay=false
# 测试环境
his.is_recipe_prepay=false
his.is_recipe_prepay=false
# 是否强制打印webservice的xml返回数据
lis.url= 192.168.1.185:8090
lis.url= 192.168.1.185:8090
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
lis.url= 192.168.1.185:8090
his.is_recipe_prepay=false
lis.url= 192.168.1.185:8090
lis.url= 192.168.1.185:8090
lis.url= 192.168.1.185:8090
lis.unifiedEntrance = true
lis.url= 192.168.1.185:8090
# 本地
lis.url= 192.168.1.185:8090
#his.url=127.0.0.1:8888
lis.url= 192.168.1.185:8090
# 测试环境
lis.url= 192.168.1.185:8090
lis.url= 192.168.1.185:8090
# 是否强制打印webservice的xml返回数据
lis.unifiedEntrance = true
lis.unifiedEntrance = true
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
lis.unifiedEntrance = true
his.is_recipe_prepay=false
lis.unifiedEntrance = true
lis.url= 192.168.1.185:8090
lis.unifiedEntrance = true
lis.unifiedEntrance = true
lis.unifiedEntrance = true
# 本地
lis.unifiedEntrance = true
#his.url=127.0.0.1:8888
lis.unifiedEntrance = true
# 测试环境
lis.unifiedEntrance = true
lis.unifiedEntrance = true
# 是否强制打印webservice的xml返回数据
# 本地
# 本地
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
# 本地
his.is_recipe_prepay=false
#his.url=192.168.11.7:8888
lis.url= 192.168.1.185:8090
# 本地
lis.unifiedEntrance = true
# 本地
# 本地
# 本地
#his.url=127.0.0.1:8888
# 本地
# 测试环境
# 本地
# 西双版纳
#his.url=10.10.11.23:8888
#wx.password=ynxbd@6910 |
||||
# \u5F00\u542F\u5904\u65B9\u9884\u7ED3\u7B97\uFF08\u7B2C2\u5F00\u5173\uFF09\uFF08\u6CE8\u610F\u8BE5\u914D\u7F6E\u9700\u8054\u7CFBhis\u5F00\u53D1\u8005\u786E\u8BA4\u652F\u6301\u624D\u80FD\u5F00\u542F\uFF0C\u5426\u5219\u5B58\u5728\u98CE\u9669\uFF01\uFF09
#his.url=127.0.0.1:8888
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
#his.url=127.0.0.1:8888
his.is_recipe_prepay=false
#his.url=127.0.0.1:8888
lis.url= 192.168.1.185:8090
#his.url=127.0.0.1:8888
lis.unifiedEntrance = true
#his.url=127.0.0.1:8888
# 本地
#his.url=127.0.0.1:8888
#his.url=127.0.0.1:8888
#his.url=127.0.0.1:8888
# 测试环境
#his.url=127.0.0.1:8888
#his.url=127.0.0.1:8888
# 是否强制打印webservice的xml返回数据
# 测试环境
# 测试环境
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
# 测试环境
his.is_recipe_prepay=false
# 测试环境
lis.url= 192.168.1.185:8090
# 测试环境
lis.unifiedEntrance = true
# 测试环境
# 本地
# 测试环境
#his.url=127.0.0.1:8888
# 测试环境
# 测试环境
# 测试环境
# 测试环境
# 是否强制打印webservice的xml返回数据
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
his.is_recipe_prepay=false
#his.url=10.20.10.6:8888
#his.url=192.168.12.10:8888
#his.md_url=192.168.1.128:7885
lis.unifiedEntrance = true
# 本地
#his.url=127.0.0.1:8888
# 测试环境
# 是否强制打印webservice的xml返回数据
# 是否强制打印webservice的xml返回数据
# 是否强制打印webservice的xml返回数据
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
# 是否强制打印webservice的xml返回数据
his.is_recipe_prepay=false
# 是否强制打印webservice的xml返回数据
lis.url= 192.168.1.185:8090
# 是否强制打印webservice的xml返回数据
lis.unifiedEntrance = true
# 是否强制打印webservice的xml返回数据
# 本地
# 是否强制打印webservice的xml返回数据
#his.url=127.0.0.1:8888
# 是否强制打印webservice的xml返回数据
# 测试环境
# 是否强制打印webservice的xml返回数据
# 是否强制打印webservice的xml返回数据
# 是否强制打印webservice的xml返回数据
his.is_log_resp=true
his.is_log_resp=true
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
his.is_log_resp=true
his.is_recipe_prepay=false
his.is_log_resp=true
lis.url= 192.168.1.185:8090
his.is_log_resp=true
lis.unifiedEntrance = true
his.is_log_resp=true
# 本地
his.is_log_resp=true
#his.url=127.0.0.1:8888
his.is_log_resp=true
# 测试环境
his.is_log_resp=true
his.is_log_resp=true
# 是否强制打印webservice的xml返回数据
# 是否传递openid给his推送消息
# 是否传递openid给his推送消息
开启处方预结算(第2开关)(注意该配置需联系his开发者确认支持才能开启,否则存在风险!)
# 是否传递openid给his推送消息
his.is_recipe_prepay=false
#
# 是否传递openid给his推送消息
lis.url= 192.168.1.185:8090
# 是否传递openid给his推送消息
lis.unifiedEntrance = true
# 是否传递openid给his推送消息
# 本地
# 是否传递openid给his推送消息
#his.url=127.0.0.1:8888
# 是否传递openid给his推送消息
# 测试环境
# 是否传递openid给his推送消息
#his.url=10.10.11.23:8888
#wx.password=ynxbd@6910 |
Loading…
Reference in new issue