报告单相关接口优化

debug
wangsq 3 months ago
parent c08a0e2b5f
commit b00b10556c
  1. 13
      pom.xml
  2. 2
      src/main/java/com/ynxbd/ali/helper/AliMessageHelper.java
  3. 4
      src/main/java/com/ynxbd/common/action/AliAction.java
  4. 6
      src/main/java/com/ynxbd/common/action/ApiAction.java
  5. 32
      src/main/java/com/ynxbd/common/action/MedToolAction.java
  6. 5
      src/main/java/com/ynxbd/common/action/PatientAction.java
  7. 149
      src/main/java/com/ynxbd/common/action/RecipeAction.java
  8. 209
      src/main/java/com/ynxbd/common/action/RegisterAction.java
  9. 3
      src/main/java/com/ynxbd/common/action/SmsAction.java
  10. 1
      src/main/java/com/ynxbd/common/action/base/BaseAction.java
  11. 23
      src/main/java/com/ynxbd/common/action/pay/MedicalAction.java
  12. 2
      src/main/java/com/ynxbd/common/action/pay/MedicalTestAction.java
  13. 6
      src/main/java/com/ynxbd/common/action/pay/PayAction.java
  14. 643
      src/main/java/com/ynxbd/common/action/report/LisReportAction.java
  15. 34
      src/main/java/com/ynxbd/common/action/report/PacsReportAction.java
  16. 663
      src/main/java/com/ynxbd/common/action/report/ReportAction.java
  17. 328
      src/main/java/com/ynxbd/common/action/test/TestAction.java
  18. 18
      src/main/java/com/ynxbd/common/bean/CommonOption.java
  19. 2
      src/main/java/com/ynxbd/common/bean/Dept.java
  20. 2
      src/main/java/com/ynxbd/common/bean/Doctor.java
  21. 21
      src/main/java/com/ynxbd/common/bean/HisRecipe.java
  22. 46
      src/main/java/com/ynxbd/common/bean/MedTool.java
  23. 29
      src/main/java/com/ynxbd/common/bean/RegSign.java
  24. 2
      src/main/java/com/ynxbd/common/bean/TreatRecord.java
  25. 21
      src/main/java/com/ynxbd/common/bean/pay/Order.java
  26. 17
      src/main/java/com/ynxbd/common/bean/pay/Register.java
  27. 47
      src/main/java/com/ynxbd/common/bean/report/CheckReport.java
  28. 2
      src/main/java/com/ynxbd/common/bean/report/InspectionItem.java
  29. 2
      src/main/java/com/ynxbd/common/bean/report/InspectionReport.java
  30. 2
      src/main/java/com/ynxbd/common/bean/wxMessage/WaitReg.java
  31. 37
      src/main/java/com/ynxbd/common/dao/MedToolDao.java
  32. 4
      src/main/java/com/ynxbd/common/dao/NatRecordDao.java
  33. 26
      src/main/java/com/ynxbd/common/dao/PatientDao.java
  34. 61
      src/main/java/com/ynxbd/common/dao/RegisterDao.java
  35. 40
      src/main/java/com/ynxbd/common/dao/his/HisRecipeDao.java
  36. 54
      src/main/java/com/ynxbd/common/dao/his/HisRegisterDao.java
  37. 13
      src/main/java/com/ynxbd/common/dao/his/HisReportDao.java
  38. 26
      src/main/java/com/ynxbd/common/dao/pacs/RISPacsDao.java
  39. 18
      src/main/java/com/ynxbd/common/helper/common/DateHelper.java
  40. 1
      src/main/java/com/ynxbd/common/helper/common/SmbHelper.java
  41. 3
      src/main/java/com/ynxbd/common/helper/his/HisEnum.java
  42. 2
      src/main/java/com/ynxbd/common/helper/his/HisHelper.java
  43. 12
      src/main/java/com/ynxbd/common/helper/pacs/RISPacsHelper.java
  44. 8
      src/main/java/com/ynxbd/common/helper/xbd/XBDHelper.java
  45. 4
      src/main/java/com/ynxbd/common/result/JsonResult.java
  46. 52
      src/main/java/com/ynxbd/common/result/Result.java
  47. 21
      src/main/java/com/ynxbd/common/service/MedToolService.java
  48. 16
      src/main/java/com/ynxbd/common/service/MedicalService.java
  49. 16
      src/main/java/com/ynxbd/common/service/PatientService.java
  50. 2
      src/main/java/com/ynxbd/common/service/RecipeService.java
  51. 280
      src/main/java/com/ynxbd/common/service/RegService.java
  52. 33
      src/main/java/com/ynxbd/common/service/ReportService.java
  53. 12
      src/main/java/com/ynxbd/common/test/Test01.java
  54. 13
      src/main/java/com/ynxbd/wx/servlet/test/RefundTest.java
  55. 7
      src/main/java/com/ynxbd/wx/wxfactory/ReqParamHelper.java
  56. 2
      src/main/java/com/ynxbd/wx/wxfactory/WxAuthHelper.java
  57. 24
      src/main/java/com/ynxbd/wx/wxfactory/WxMedicalHelper.java
  58. 2
      src/main/java/com/ynxbd/wx/wxfactory/medical/Client.java
  59. 4
      src/main/java/com/ynxbd/wx/wxfactory/utils/MdRespHelper.java
  60. 2
      src/main/resources/ehcache.xml
  61. 4
      src/main/resources/logback.xml
  62. 2
      src/main/resources/webservice.properties
  63. 2
      src/main/resources/xbd.properties
  64. 5
      src/main/webapp/WEB-INF/web.xml

@ -17,7 +17,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<struts.version>6.7.0</struts.version>
<struts.version>6.7.4</struts.version>
<jsckson.version>2.14.1</jsckson.version>
<fastjson.version>1.2.83</fastjson.version>
</properties>
@ -59,17 +59,12 @@
<scope>compile</scope>
</dependency>
<!-- logback含sl4j 1.2.x系支持jdk1.8 -->
<!-- logback含sl4j 1.3.x系支持jdk1.8 -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.13</version>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
<version>1.3.15</version>
<scope>compile</scope>
</dependency>
<dependency>

@ -42,7 +42,7 @@ public class AliMessageHelper {
return;
}
Patient patient = new PatientService().getMyself(openid);
Patient patient = new PatientService().queryMyself(openid);
if (patient == null || patient.getName() == null) {
log.error("[支付宝]消息推送 trueName为空");
return;

@ -66,7 +66,7 @@ public class AliAction extends BaseAction {
} else {
user = new User();
user.setOpenid(openid);
user.setPatientList(new PatientService().getPatientList(openid, null, true));
user.setPatientList(new PatientService().queryPatientList(openid, null, true));
cache.put(openid, user);
}
@ -80,7 +80,7 @@ public class AliAction extends BaseAction {
}
if (user.getPatientList() == null) {
user.setPatientList(new PatientService().getPatientList(openid, null, true));
user.setPatientList(new PatientService().queryPatientList(openid, null, true));
}
AliCacheHelper.setUserAccessToken(scopes, user, accessToken);

@ -57,9 +57,6 @@ public class ApiAction extends BaseAction {
return Result.success(resp);
}
public static void main(String[] args) {
System.out.println(DesEncryptHelper.deCode("98EBC51EB92C6BC416BE23AE0622CC7445CCB4559637127984C5759A422DC4B81251FC4C8B32A9DB9743601A4C4D66A31FA5186B9BF10CBCF7ACB00A82EBC37122FD51700AC9D16D596D147FFC4D4973792E04B406288B88D08C6ACE9654DA3801B31D2F6B996D3572A3BA1E8124A5CE43394DF49E1B5F0DC7793566C06524A854161F38FF064F3B"));
}
@Action("getWxJsapiTicket")
public Result getWxJsapiTicket() {
@ -214,6 +211,7 @@ public class ApiAction extends BaseAction {
@Action("version")
public Result version() {
log.info(VersionHelper.getAppVersion());
return Result.success(VersionHelper.getAppVersion());
}
@ -270,4 +268,6 @@ public class ApiAction extends BaseAction {
return respEnd("ERROR:发送失败");
}
}

@ -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);
}
}
}

@ -12,14 +12,11 @@ import com.ynxbd.common.result.Result;
import com.ynxbd.common.result.ResultEnum;
import com.ynxbd.common.result.ServiceException;
import com.ynxbd.common.service.PatientService;
import com.ynxbd.wx.utils.DesEncryptHelper;
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.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.UUID;
@ -246,7 +243,7 @@ public class PatientAction extends BaseAction {
mIDCardNo = getString("mIDCardNo");
Result result = new PatientService().noCardBind(fTel, fName, fIDCardNo, mTel, mName, mIDCardNo);
if (!result.isSuccess()) {
if (!result.isOK()) {
return result;
}
} else {

@ -19,6 +19,7 @@ import com.ynxbd.common.result.ResultEnum;
import com.ynxbd.common.service.RecipeService;
import com.ynxbd.wx.config.WeChatConfig;
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;
@ -43,26 +44,109 @@ public class RecipeAction extends BaseAction {
*/
@Action("getPayedList")
public Result getPayedList(String patientId, String personNo, String begDate, String endDate) {
log.info("[处方]已缴费项目查询 patientId={}, begDate={}, endDate={}, personNo-{}", patientId, begDate, endDate,personNo);
log.info("[处方]已缴费项目查询 patientId={}, begDate={}, endDate={}, personNo-{}", patientId, begDate, endDate, personNo);
patientId = getDecodeString(patientId);
if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
patientId = getDecodeString(patientId);
List<HisRecipe> recipeList = new HisRecipeDao().getPaidRecipeList(patientId, begDate, endDate,personNo);
List<HisRecipe> recipeList = new HisRecipeDao().getPaidRecipeList(patientId, begDate, endDate, personNo);
return Result.success(recipeList);
}
/**
* 查询已缴费项目
*/
@Action("getRxPaidList")
public Result getRxPaidList(String patientId, String personNo, String begDate, String endDate) {
log.info("[处方]查询已缴费项目 patientId={}, begDate={}, endDate={}, personNo-{}", patientId, begDate, endDate, personNo);
patientId = getDecodeString(patientId);
if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
if (!ObjectUtils.isEmpty(personNo)) {
personNo = getDecodeString(personNo);
if (personNo == null) {
return Result.error(ResultEnum.PARAM_IS_INVALID);
}
}
List<HisRecipe> hisRecipeList = new HisRecipeDao().getPaidRecipeList(patientId, begDate, endDate, personNo);
List<HisRecipe> dataList = new ArrayList<>();
HisRecipe treatItem;
List<HisRecipe> groupList;
for (HisRecipe item : hisRecipeList) {
String treatNum = item.getMzNum();
if (ObjectUtils.isEmpty(treatNum)) {
continue;
}
String execDate = item.getExecDate();
item.setTreatNum(treatNum);
HisRecipe findTreat = dataList.stream().filter(o -> o.getTreatNum().equals(treatNum)).findFirst().orElse(null);
if (findTreat == null) {
treatItem = new HisRecipe();
treatItem.setTreatNum(treatNum);
treatItem.setDate(execDate);
groupList = new ArrayList<>();
groupList.add(item);
treatItem.setGroupList(groupList);
dataList.add(treatItem);
} else {
if (findTreat.getGroupList() == null) {
findTreat.setGroupList(new ArrayList<>());
}
Boolean isGreaterThan = DateHelper.leftGreaterThanRight(execDate, findTreat.getDate(), null);
if (isGreaterThan != null && isGreaterThan) {
findTreat.setDate(execDate);
}
findTreat.getGroupList().add(item);
}
}
return Result.success(dataList);
}
/**
* 获取未缴费项目
*/
@Action("getUnPayList")
public Result getUnPayList(String patientId, String personNo, String begDate, String endDate ) {
log.info("[处方]未缴费项目查询 patientId={},personNo-{}, begDate={}, endDate={}", patientId, personNo, begDate, endDate);
@Action("getRxUnPayList")
public Result getRxUnPayList(String patientId, String personNo, String begDate, String endDate) {
log.info("[处方]未缴费项目查询 patientId={}, personNo={}, begDate={}, endDate={}", patientId, personNo, begDate, endDate);
patientId = getDecodeString(patientId);
if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
if (!ObjectUtils.isEmpty(personNo)) {
personNo = getDecodeString(personNo);
if (personNo == null) {
return Result.error(ResultEnum.PARAM_IS_INVALID);
}
}
int days = DateHelper.intervalDays(begDate, endDate, true);
List<HisRecipe> hisRecipes = new HisRecipeDao().getUnPayRecipe(patientId, personNo, days);
List<HisRecipe> resultList = new ArrayList<>();
for (HisRecipe hisRecipe : hisRecipes) {
hisRecipe.setTreatNum(hisRecipe.getMzNum());
if (hisRecipe.getDate() != null && DateHelper.inDateRange(begDate, endDate, hisRecipe.getDate(), DateHelper.DateEnum.yyyy_MM_dd)
&& !"1".equals(hisRecipe.getSTDFlag()) && (!"1".equals(hisRecipe.getInternetHospFlag()) || "1".equals(hisRecipe.getYJSAuditFlag()))) {
resultList.add(hisRecipe);
}
}
return Result.success(resultList);
}
/**
* 获取未缴费项目
*/
@Action("getUnPayList")
public Result getUnPayList(String patientId, String personNo, String begDate, String endDate) {
log.info("[处方]未缴费项目查询 patientId={}, personNo={}, begDate={}, endDate={}", patientId, personNo, begDate, endDate);
patientId = getDecodeString(patientId);
if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
int days = DateHelper.intervalDays(begDate, endDate, true);
List<HisRecipe> hisRecipes = new HisRecipeDao().getUnPayRecipe(patientId, personNo, days);
@ -77,19 +161,20 @@ public class RecipeAction extends BaseAction {
/**
* 获取所以未缴费订单 包括互联网医院未审核医保双通道订单
*
* @param patientId patientId
* @param begDate 开始时间
* @param endDate 结束时间
* @param begDate 开始时间
* @param endDate 结束时间
*/
@Action("getMedicalRecipe")
public Result getMedicalRecipe(String patientId, String begDate, String endDate ) {
public Result getMedicalRecipe(String patientId, String begDate, String endDate) {
log.info("[处方]未缴费项目查询 patientId={}", patientId);
patientId = getDecodeString(patientId);
if (patientId == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
patientId = getDecodeString(patientId);
int days = DateHelper.intervalDays(begDate, endDate, true);
List<HisRecipe> hisRecipes = new HisRecipeDao().getUnPayRecipe(patientId,"",days);
List<HisRecipe> hisRecipes = new HisRecipeDao().getUnPayRecipe(patientId, "", days);
List<HisRecipe> resultList = new ArrayList<>();
for (HisRecipe hisRecipe : hisRecipes) {
if (hisRecipe.getDate() != null && DateHelper.inDateRange(begDate, endDate, hisRecipe.getDate(), DateHelper.DateEnum.yyyy_MM_dd)) {
@ -101,17 +186,18 @@ public class RecipeAction extends BaseAction {
/**
* 将订单上传到医保双通道
*
* @param treatNum 门诊号
* @param personID 身份证
* @param recipes 处方号合集中间用英文逗号隔开
* @param recipes 处方号合集中间用英文逗号隔开
*/
@Action("uploadMedicalRecipe")
public Result uploadMedicalRecipe(String treatNum, String personID, String recipes){
public Result uploadMedicalRecipe(String treatNum, String personID, String recipes) {
log.info("[互联网医院]处方医保双通道流转 treatNum={},personNo-{}, recipes={}", treatNum, personID, recipes);
if(treatNum==null||personID==null||recipes==null){
if (treatNum == null || personID == null || recipes == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
return new HisRecipeDao().uploadMedicalRecipe(treatNum,personID,recipes);
return new HisRecipeDao().uploadMedicalRecipe(treatNum, personID, recipes);
}
// /**
@ -139,32 +225,33 @@ public class RecipeAction extends BaseAction {
/**
* 预约体检his缴费
* @param treatNum 体检号
* @param payMoney 缴费金额
* @param payDate 缴费日期
* @param payTime 缴费时间
*
* @param treatNum 体检号
* @param payMoney 缴费金额
* @param payDate 缴费日期
* @param payTime 缴费时间
* @param bankTransNo bankTransNo
* @param outTranNo outTranNo
* @param outTranNo outTranNo
*/
@Action("peisHisPay")
public Result peisHisPay(String treatNum,String payMoney,String payDate,String payTime,String bankTransNo,String outTranNo){
log.info("[体检预约请求his计费]treatNum-{},payMoney-{},payDate-{},payTime-{},bankTransNo-{},outTranNo-{}",treatNum,payMoney,payDate,payTime,bankTransNo,outTranNo);
if("".equals(treatNum)||"".equals(outTranNo)){
public Result peisHisPay(String treatNum, String payMoney, String payDate, String payTime, String bankTransNo, String outTranNo) {
log.info("[体检预约请求his计费]treatNum-{},payMoney-{},payDate-{},payTime-{},bankTransNo-{},outTranNo-{}", treatNum, payMoney, payDate, payTime, bankTransNo, outTranNo);
if ("".equals(treatNum) || "".equals(outTranNo)) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
Recipe recipe = new PeisDao().selectByOutTradeNo(outTranNo);
if(recipe==null){
Recipe recipe = new PeisDao().selectByOutTradeNo(outTranNo);
if (recipe == null) {
return Result.error(ResultEnum.DATA_NOT_FOUND);
}
if(!recipe.getBankTransNo().equals(bankTransNo)){
log.info("[体检预约请求his计费]体检系统跟微信支付系统两笔订单不一致,体检系统:bankTransNo-{},微信系统:bankTransNo-{}",bankTransNo,recipe.getBankTransNo());
if (!recipe.getBankTransNo().equals(bankTransNo)) {
log.info("[体检预约请求his计费]体检系统跟微信支付系统两笔订单不一致,体检系统:bankTransNo-{},微信系统:bankTransNo-{}", bankTransNo, recipe.getBankTransNo());
return Result.error(ResultEnum.DATA_IS_WRONG);
}
Map<String,Object> params = new HashMap<>();
Map<String, Object> params = new HashMap<>();
params.put("MZNum", "0");
params.put("PatientID", "0");
params.put("TJBH",treatNum);
params.put("GroupFlag","1");
params.put("TJBH", treatNum);
params.put("GroupFlag", "1");
params.put("PayMoney", payMoney);
params.put("PayDate", payDate);
params.put("PayTime", payTime);
@ -175,7 +262,7 @@ public class RecipeAction extends BaseAction {
params.put("OpenId", recipe.getOpenid());
params.put("Token", WeChatConfig.TOKEN);
JsonResult result = HisHelper.getJsonResult(HisEnum.AP_Pay_Invoice, params, MerchantEnum.WX);
return result.success()?Result.success(result):Result.error(result.getMessage());
return result.success() ? Result.success(result) : Result.error(result.getMessage());
}
/**

@ -6,14 +6,19 @@ import com.ynxbd.ali.helper.AliUploadHelper;
import com.ynxbd.common.action.base.BaseAction;
import com.ynxbd.common.bean.Dept;
import com.ynxbd.common.bean.Doctor;
import com.ynxbd.common.bean.Patient;
import com.ynxbd.common.bean.RegSign;
import com.ynxbd.common.bean.enums.MerchantEnum;
import com.ynxbd.common.bean.pay.Register;
import com.ynxbd.common.dao.RegisterDao;
import com.ynxbd.common.dao.his.HisRegisterDao;
import com.ynxbd.common.helper.common.DateHelper;
import com.ynxbd.common.result.JsonResult;
import com.ynxbd.common.result.Result;
import com.ynxbd.common.result.ResultEnum;
import com.ynxbd.common.service.DoctorService;
import com.ynxbd.common.service.MedToolService;
import com.ynxbd.common.service.PatientService;
import com.ynxbd.common.service.RegService;
import com.ynxbd.wx.wxfactory.ReqParamHelper;
import lombok.extern.slf4j.Slf4j;
@ -200,7 +205,7 @@ public class RegisterAction extends BaseAction {
if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
List<Register> resultList = new HisRegisterDao().getRegReserveHistory(patientId, null);
List<Register> resultList = new HisRegisterDao().getRegReserveRecords(patientId, null);
return Result.success(resultList);
}
@ -216,7 +221,7 @@ public class RegisterAction extends BaseAction {
}
patientId = getDecodeString(patientId);
List<Register> regRecords = new RegService().getHisRegRecords(patientId, begDate, endDate);
List<Register> regRecords = new RegService().getHisRegRecordsByRegDate(patientId, begDate, endDate);
return Result.success(regRecords);
} catch (Exception e) {
return Result.error(e);
@ -224,10 +229,10 @@ public class RegisterAction extends BaseAction {
}
/**
* [挂号]查询挂号历史
* [挂号]查询挂号历史记录
*/
@Action("getHisRegRecords")
public Result getRegHistory(String begDate, String endDate, String patientId) {
@Action("getRegHistoryRecords")
public Result getRegHistoryRecords(String begDate, String endDate, String patientId) {
try {
log.info("[挂号]查询挂号记录 patientId={}, begDate={},endDate={}", patientId, begDate, endDate);
if (patientId == null || begDate == null || endDate == null) {
@ -235,7 +240,7 @@ public class RegisterAction extends BaseAction {
}
patientId = getDecodeString(patientId);
List<Register> regRecords = new RegService().getHisRegRecords(patientId, begDate, endDate);
List<Register> regRecords = new RegService().getHisRegRecordsByRegDate(patientId, begDate, endDate);
return Result.success(regRecords);
} catch (Exception e) {
return Result.error(e);
@ -243,7 +248,7 @@ public class RegisterAction extends BaseAction {
}
/**
* [预约挂号]获取预约记录
* [预约挂号]查询预约记录
*/
@Action("getHisRegReserveRecords")
public Result getHisRegReserveRecords(String begDate, String endDate, String patientId) {
@ -371,7 +376,7 @@ public class RegisterAction extends BaseAction {
begDate = DateHelper.getCurDate() + " 06:00:00";
endDate = DateHelper.getCurDate() + " 23:59:59";
}
JSONArray dataList = new HisRegisterDao().getReLineSignInRecord(begDate, endDate);
JSONArray dataList = new HisRegisterDao().getRegLineSignInRecordsOld(begDate, endDate);
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("date", DateHelper.getCurDateTime());
if (dataList == null || dataList.isEmpty()) {
@ -383,8 +388,47 @@ public class RegisterAction extends BaseAction {
return Result.success(dataMap);
}
/**
* 执行预约签到
* 根据患者id,查询挂号待签到记录
*
* @param begDate 开始时间
* @param endDate 结束时间
* @return 待预约记录
*/
@Action("getRegSignInByPatientId")
public Result getRegSignInByPatientId(String patientId, String begDate, String endDate) {
patientId = getDecodeString(patientId);
log.info("[挂号待签到记录]查询 patientId={} begDate={}, endDate={}", patientId, begDate, endDate);
if (patientId == null) {
return Result.error(ResultEnum.PARAM_IS_INVALID);
}
List<RegSign> records = new RegService().getRegLineSignInRecordsByPatientId(patientId, begDate, endDate);
return Result.success(records);
}
/**
* 根据门诊号查询挂号待签到记录
*
* @param treatNum 门诊号
* @return 待预约记录
*/
@Action("getRegSignInByTreatNum")
public Result getRegSignInByTreatNum(String treatNum) {
treatNum = getDecodeString(treatNum);
log.info("[挂号待签到记录]查询 treatNum={}", treatNum);
if (treatNum == null) {
return Result.error(ResultEnum.PARAM_IS_INVALID);
}
RegSign record = new RegService().getRegLineSignInRecordByTreatNum(treatNum);
if (record == null) {
return Result.error(ResultEnum.DATA_NOT_FOUND);
}
return Result.success(record);
}
/**
* 执行预约签到将废弃
*
* @param treatNum 门诊号
* @return 预约签到结果
@ -398,6 +442,28 @@ public class RegisterAction extends BaseAction {
return Result.success(new HisRegisterDao().handleLineSignIn(treatNum));
}
/**
* 执行预约签到
*
* @param treatNum 门诊号
* @return 预约签到结果
*/
@Action("regSignIn")
public Result regSignIn(String treatNum) {
log.info("[执行挂号签到(只进行分诊叫号)] treatNum={}", treatNum);
if (treatNum == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
JsonResult jsonResult = new HisRegisterDao().handleLineSignIn(treatNum);
if (!jsonResult.success()) {
return Result.error(jsonResult.getMessage());
}
String fzNum = jsonResult.getDataMapString("FZNum"); // 分诊号
Map<Object, Object> dataMap = new HashMap<>();
dataMap.put("fzNum", fzNum);
return Result.success(dataMap);
}
/**
* 查询预约今天号源的患者信息用以推送候诊信息
*
@ -416,25 +482,54 @@ public class RegisterAction extends BaseAction {
/**
* [就医助手]根据挂号日期范围查询挂号记录
* [就医助手]根据日期范围查询待诊的挂号记录
*/
@Action("getRegRecordsByOpenId")
public Result getRegRecordsByOpenId(String begDate, String endDate, String openid) {
@Action("getHisWaitRegRecords")
public Result getHisWaitRegRecords(String openid) {
try {
log.info("[就医助手]根据挂号日期范围,查询挂号记录 begDate={}, endDate={}, openid={}", begDate, endDate, openid);
if (begDate == null || endDate == null || openid == null) {
log.info("[就医助手]根据挂号日期范围,查询待诊的挂号记录 openid={}", openid);
if (openid == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
List<Register> regList = new RegisterDao().selectListByRegDate(begDate, endDate, openid);
for (Register item : regList) {
item.setEnId(ReqParamHelper.encode(String.valueOf(item.getId())));
item.setId(null);
item.filterInfo(); // 数据过滤
List<Register> regList = new ArrayList<>();
List<Patient> patients = new PatientService().queryPatientIdsByOpenId(openid);
if (patients.isEmpty()) {
return Result.success(regList);
}
String curDate = DateHelper.getCurDate();
for (Patient pItem : patients) {
String patientId = pItem.getPatientId();
List<Register> hisWaitRegRecords = new RegService().getHisWaitRegRecords(patientId);
if (hisWaitRegRecords != null && !hisWaitRegRecords.isEmpty()) {
for (Register regItem : hisWaitRegRecords) {
if (regItem.hasIsTake(-1) || regItem.hasIsTreat(-1)) { // 过滤退号的挂号数据
continue;
}
String regDate = regItem.getRegDate();
if (!ObjectUtils.isEmpty(regDate)) {
Date date = DateHelper.strToDate(regDate, DateHelper.DateEnum.yyyy_MM_dd);
if (date != null) {
regItem.setQueryBegDate(DateHelper.getMoveDate(date, -7));
regItem.setQueryEndDate(DateHelper.getMoveDate(date, 7));
}
}
regItem.setCurDate(curDate);
regItem.setPatientId(patientId);
regItem.setEnPatientId(ReqParamHelper.encode(patientId));
regItem.setPatientName(pItem.getName());
regItem.setBirthday(pItem.getBirthday());
regItem.setSex(pItem.getSex());
regItem.setIdCardNo(pItem.getIdCardNo());
regItem.setTel(pItem.getTel());
regItem.filterInfo();
regList.add(regItem);
}
}
}
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("date", DateHelper.getCurDateTime());
dataMap.put("list", regList);
return Result.success(dataMap);
return Result.success(regList);
} catch (Exception e) {
return Result.error(e);
}
@ -451,34 +546,76 @@ public class RegisterAction extends BaseAction {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
try {
Register record = new RegService().findHisRegRecord(patientId, regDate, hisTransNo);
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("date", DateHelper.getCurDateTime());
dataMap.put("info", record);
return Result.success(dataMap);
Register record = new RegService().findHisRegRecordByHisTransNo(patientId, regDate, hisTransNo);
return Result.success(record);
} catch (Exception e) {
return Result.error(e);
}
}
/**
* [就医助手]修改流程状态
* [挂号订单]查询信息
*/
@Action("updateRegMedToolMark")
public Result updateRegMedToolMark(String id, String medToolMark, String openId) {
id = getDecodeString(id);
log.info("[就医助手]修改流程状态 id={}, medToolMark={}, openId={}", id, medToolMark, openId);
if (ObjectUtils.isEmpty(id) || medToolMark == null) {
@Action("getRegOrder")
public Result getRegOrder(String patientId, String tradeNo, String hisTransNo) {
patientId = getDecodeString(patientId);
log.info("[挂号订单]查询信息 patientId={}, tradeNo={}, hisTransNo={}", patientId, tradeNo, hisTransNo);
if (ObjectUtils.isEmpty(patientId) || ObjectUtils.isEmpty(hisTransNo)) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
try {
boolean isOK = new RegService().updateRegMedToolMark(id, medToolMark, openId);
return Result.isOK(isOK);
Register register = new RegService().queryRegByHisInfo(patientId, tradeNo, hisTransNo);
if (register == null) {
return Result.error("未找到[线上挂号]的订单信息");
}
register.filterInfo();
return Result.success(register);
} catch (Exception e) {
return Result.error(e);
}
}
/**
* [就医助手]修改流程标记
*/
@Action("completeRegTreatNum")
public Result completeRegTreatNum(String treatNum, String processMark, String openId, String patientId, String tradeNo, String hisTransNo, String orderFromOwner) {
try {
patientId = getDecodeString(patientId);
log.info("[就医助手]修改流程标记 treatNum={}, processMark={}, openId={}, patientId={}, tradeNo={}, hisTransNo={}, orderFromOwner={}", treatNum, processMark, openId, patientId, tradeNo, hisTransNo, orderFromOwner);
if (ObjectUtils.isEmpty(treatNum) || ObjectUtils.isEmpty(patientId)) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
new RegService().completeRegTreatNum(treatNum, openId, patientId, tradeNo, hisTransNo, orderFromOwner);
new MedToolService().saveMedToolMarkByTreatNum(treatNum, 1, processMark);
return Result.success();
} catch (Exception e) {
return Result.error(e);
}
}
// /**
// * [就医助手]根据挂号日期范围,查询挂号记录
// */
// @Action("getRegRecordsByOpenId")
// public Result getRegRecordsByOpenId(String begDate, String endDate, String openid) {
// try {
// log.info("[就医助手]根据挂号日期范围,查询挂号记录 begDate={}, endDate={}, openid={}", begDate, endDate, openid);
// if (begDate == null || endDate == null || openid == null) {
// return Result.error(ResultEnum.PARAM_IS_DEFECT);
// }
// List<Register> regList = new RegisterDao().selectListByRegDate(begDate, endDate, openid);
// for (Register item : regList) {
// item.setEnId(ReqParamHelper.encode(String.valueOf(item.getId())));
// item.setId(null);
// item.filterInfo(); // 数据过滤
// }
// return Result.success(regList);
// } catch (Exception e) {
// return Result.error(e);
// }
// }
// /**
// * [预约挂号]获取指定科室医生信息

@ -195,12 +195,13 @@ public class SmsAction extends BaseAction {
/**
* 天助平台短信推送红河州第一人民医院影像报告使用
* 备注2025-05-07 只有放射科会发短信
* @param tel 电话号码
* @param content 内容
* @return 返回发送结果
*/
@Action("danMiSms")
public Result DanMiSms(String tel, String content) {
public Result danMiSms(String tel, String content) {
log.info("[天助平台短信]url-{}, content={}", tel, content);
if (tel == null || content == null) {
return Result.error(ResultEnum.PARAM_IS_INVALID);

@ -5,6 +5,7 @@ import com.ynxbd.common.helper.common.HttpHelper;
import com.ynxbd.common.helper.common.JsonHelper;
import com.ynxbd.wx.wxfactory.ReqParamHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.action.ServletRequestAware;

@ -45,7 +45,7 @@ public class MedicalAction extends BaseAction {
@Action("getFeeDetails")
public Result getFeeDetails(String callNo, String payCode, String openid, String qrCode, String patientId, String cardNo, String realName, BigDecimal totalFee, Boolean isTime, String ybAttrib, String ybBZCode, String ybBZName) {
try {
log.info("【医保】上传明细下单 callNo={}, payCode={}, openid={}, qrCode={}, patientId={}, totalFee={}, ybAttrib={}, ybBZCode={}, ybBZName={}", callNo, payCode, openid, qrCode, patientId, totalFee, ybAttrib, ybBZCode, ybBZName);
log.info("[医保]上传明细下单 callNo={}, payCode={}, openid={}, qrCode={}, patientId={}, totalFee={}, ybAttrib={}, ybBZCode={}, ybBZName={}", callNo, payCode, openid, qrCode, patientId, totalFee, ybAttrib, ybBZCode, ybBZName);
if (callNo == null || payCode == null || openid == null || qrCode == null || patientId == null || cardNo == null || totalFee == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -162,7 +162,7 @@ public class MedicalAction extends BaseAction {
public Result order(String callNo, String payCode, String openid, String patientId, String cardNo, String realName, String treatNum, String payOrdId, String payAuthNo, String mdTrtId, String chrgBchno, String mdUserId,
BigDecimal totalFee, BigDecimal acctFee, BigDecimal hifpFee, BigDecimal insuranceFee, BigDecimal cashFee, String notifyType) {
try {
log.info("【医保】下单 callNo={}, payCode={}, openid={}, patientId={}, totalFee={}", callNo, payCode, openid, patientId, totalFee);
log.info("[医保]下单 callNo={}, payCode={}, openid={}, patientId={}, totalFee={}", callNo, payCode, openid, patientId, totalFee);
if (callNo == null || payCode == null || openid == null || patientId == null || cardNo == null || totalFee == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -223,7 +223,7 @@ public class MedicalAction extends BaseAction {
BigDecimal hifpFee = recipe.getHifpFee();
if (payStatus == null || hisStatus == null || chrgBchno == null || bankTransNo == null || mdUserId == null || cashFee == null || acctFee == null || hifpFee == null) {
log.info("【医保】退费参数缺失 outTradeNo={}, bankTransNo={}, payStatus={}, hisStatus={}, chrgBchno={}, cashFee={}, acctFee={}, hifpFee={}", outTradeNo, bankTransNo, payStatus, hisStatus, chrgBchno, cashFee, acctFee, hifpFee);
log.info("[医保]退费参数缺失 outTradeNo={}, bankTransNo={}, payStatus={}, hisStatus={}, chrgBchno={}, cashFee={}, acctFee={}, hifpFee={}", outTradeNo, bankTransNo, payStatus, hisStatus, chrgBchno, cashFee, acctFee, hifpFee);
return Result.error(ResultEnum.PAY_ORDER_PARAMS_IS_DEFECT);
}
@ -238,11 +238,11 @@ public class MedicalAction extends BaseAction {
Result result = MedicalService.refund(userInfo.getPayAuthNo(), chrgBchno.substring(1), outTradeNo, bankTransNo, tradeNo, mdUserId, cashFee, insuranceFee);
String message = result.isSuccess() ? WxPayHelper.OK : result.getMessage();
String message = result.isOK() ? WxPayHelper.OK : result.getMessage();
if (!recipeDao.updateRefundByTradeNo(tradeNo, message)) {
log.info("【医保】修改退费信息失败 [{}] outTradeNo={}, tradeNo={}", message, outTradeNo, tradeNo);
log.info("[医保]修改退费信息失败 [{}] outTradeNo={}, tradeNo={}", message, outTradeNo, tradeNo);
}
if (result.isSuccess()) {
if (result.isOK()) {
return Result.success();
}
return Result.error();
@ -286,7 +286,7 @@ public class MedicalAction extends BaseAction {
*/
@Action("queryOrder")
public Result queryOrder(String outTradeNo, String medTransId) {
log.info("【医保】查询订单 outTradeNo={}, medTransId={}", outTradeNo, medTransId);
log.info("[医保]查询订单 outTradeNo={}, medTransId={}", outTradeNo, medTransId);
MedicalOrder order = WxMedicalHelper.queryOrder(WxCacheHelper.getAccessToken(), outTradeNo, medTransId);
if (order.isOk()) {
return Result.success(order);
@ -334,24 +334,23 @@ public class MedicalAction extends BaseAction {
String notifyType = notifyInfo.getAttach();
log.info("【医保】[{}] 收到通知 outTradeNo={}, bankTransNo={}, notifyType={}",
log.info("[医保][{}] 收到通知 outTradeNo={}, bankTransNo={}, notifyType={}",
notifyType, outTradeNo, bankTransNo, notifyType);
switch (PEnum.toEnum(notifyType)) {
case RECIPE:
MedicalService.recipePay(MerchantEnum.WX, outTradeNo, bankTransNo, payDate, payTime, openid, payInfo);
MedicalService.recipePayNotify(MerchantEnum.WX, outTradeNo, bankTransNo, payDate, payTime, openid, payInfo);
break;
case REG: // 挂号
MedicalService.regPay(MerchantEnum.WX, outTradeNo, bankTransNo, payDate, payTime, openid, payInfo);
MedicalService.regPayNotify(MerchantEnum.WX, outTradeNo, bankTransNo, payDate, payTime, openid, payInfo);
break;
case IN_HOSP:
break;
default:
log.info("【医保】通知类型错误");
log.info("[医保]通知类型错误");
break;
}

@ -113,7 +113,7 @@ public class MedicalTestAction extends BaseAction {
*/
@Action("queryWxOrder")
public Result queryWxOrder(String accessToken, String outTradeNo, String medTransId) {
log.info("【医保】现金退费 outTradeNo={}, medTransId={}", outTradeNo, medTransId);
log.info("[医保]现金退费 outTradeNo={}, medTransId={}", outTradeNo, medTransId);
MedicalOrder order = WxMedicalHelper.queryOrder(accessToken, outTradeNo, medTransId);
if (order.isOk()) {

@ -95,7 +95,7 @@ public class PayAction extends BaseAction {
}
Result result = recipeService.recipeHand(merchantEnum, openid, patientId, treatNum, totalFee, recipeJson, payWay, awaitSecond);
if (!result.isSuccess() || result.getData() != null) { // 业务错误 || 存在返回数据-需提前返回
if (!result.isOK() || result.getData() != null) { // 业务错误 || 存在返回数据-需提前返回
return result;
}
@ -189,7 +189,7 @@ public class PayAction extends BaseAction {
}
String pushMessage = "已申请退款,原因:患者主动取消退费,订单号:" + outTradeNo + "orderNo:" + recipeId;
Result result = peisService.peisAutoRefund(recipeId, merchantEnum, outTradeNo, new BigDecimal(totalFee), pushMessage, new Date(), openid);
if (result.isSuccess()) {
if (result.isOK()) {
peisService.peisRefund(recipeId, "OK", "");
} else {
peisService.peisRefund(recipeId, "FAIL", result.getMessage());
@ -323,7 +323,7 @@ public class PayAction extends BaseAction {
/**
* 医保微信现金退费
* [医保]微信现金退费
*
* @param callNo 调用码 { recipe处方register挂号in_hosp住院预交金 }
* @param payOrdId 医保订单号

@ -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,4 +1,4 @@
package com.ynxbd.common.action;
package com.ynxbd.common.action.report;
import com.ynxbd.common.action.base.BaseAction;
import com.ynxbd.common.bean.pacs.RISPacsReportInfo;
@ -13,13 +13,13 @@ import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* 上海岱嘉PACS
*
* @author 李进才
* @ClassName PacsRisAction
* @Description description
@ -32,27 +32,27 @@ public class PacsReportAction extends BaseAction {
@Action("/list")
public Result list(String outPatientNum, String inPatientNum,Integer pageNum){
public Result list(String outPatientNum, String inPatientNum, Integer pageNum) {
outPatientNum = ReqParamHelper.decode(outPatientNum);
inPatientNum = ReqParamHelper.decode(inPatientNum);
if(outPatientNum==null&&inPatientNum==null){
if (outPatientNum == null && inPatientNum == null) {
return Result.error(ResultEnum.PARAM_IS_BLANK);
}
List<RISPacsReportInfo> risPacsReportInfos = new ArrayList<>();
if(outPatientNum!=null){
if (outPatientNum != null) {
risPacsReportInfos = new RISPacsDao().getReportInfoForOutPatientNum(outPatientNum);
}
if(inPatientNum!=null){
risPacsReportInfos =new RISPacsDao().getReportInfoForInPatientNum(inPatientNum);
if (inPatientNum != null) {
risPacsReportInfos = new RISPacsDao().getReportInfoForInPatientNum(inPatientNum);
}
Integer pageTotal = risPacsReportInfos.size();
if(pageTotal>1){
risPacsReportInfos = risPacsReportInfos.subList(pageNum-1,pageNum);
int pageTotal = risPacsReportInfos.size();
if (pageTotal > 1) {
risPacsReportInfos = risPacsReportInfos.subList(pageNum - 1, pageNum);
}
List<RISPacsReportInfo> resultList = new ArrayList<>();
for(RISPacsReportInfo risPacsReportInfo : risPacsReportInfos) {
for (RISPacsReportInfo risPacsReportInfo : risPacsReportInfos) {
try {
log.info("[Pacs]报告单路径-{},报告单Id-{}",risPacsReportInfo.getReportFile(),risPacsReportInfo.getReportId());
log.info("[Pacs]报告单路径-{}, 报告单Id-{}", risPacsReportInfo.getReportFile(), risPacsReportInfo.getReportId());
risPacsReportInfo.setReportFile("data:application/jpg;base64," +
ImageHelper.convertPDFtoImageBase64(
RISPacsHelper.smbHelper.smbGet("smb:" +
@ -62,7 +62,7 @@ public class PacsReportAction extends BaseAction {
throw new RuntimeException(e);
}
}
return Result.success(resultList,pageTotal);
return Result.success(resultList, pageTotal);
}
@Action("/download")
@ -71,10 +71,10 @@ public class PacsReportAction extends BaseAction {
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment; filename=file.pdf");
ServletOutputStream outputStream = response.getOutputStream();
byte[] fileByte = RISPacsHelper.smbHelper.smbGet("smb:"+
byte[] fileByte = RISPacsHelper.smbHelper.smbGet("smb:" +
new RISPacsDao().
getReportPath(reportId).
replaceAll("\\\\","/"));
replaceAll("\\\\", "/"));
outputStream.write(fileByte);
outputStream.flush();
return Result.success();
@ -87,7 +87,7 @@ public class PacsReportAction extends BaseAction {
images.add("2");
images.add("2");
images.add("2");
images = images.subList(1,2);
images = images.subList(1, 2);
return Result.success(images);
}
}

@ -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;
}

@ -22,7 +22,7 @@ import java.util.List;
@ToString
@NoArgsConstructor
public class Dept implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 202504141516002L;
private Integer id;
// 科室编码

@ -16,7 +16,7 @@ import java.util.List;
@ToString
@NoArgsConstructor
public class Doctor implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 202504141516003L;
private Long id;
// 科室代码

@ -42,6 +42,8 @@ public class HisRecipe {
private String execDate;
// 门诊号
private String mzNum;
// 门诊号
private String treatNum;
// 执行位置
private String address;
// 备注
@ -59,24 +61,23 @@ public class HisRecipe {
// 院区名称
private String hospitalAreaName;
//互联网医院
// 互联网医院处方标识
private String internetHospFlag;
// 是否为双通道处方 [1:双通道处方]
private String sTDFlag;
private String sTDUploadDate;
// 处方是否已经审核
private String yJSAuditFlag;
private String ybAttrib; // 医保属性[4:为慢性病,5:为特殊病]
private String ybAttrib; //医保属性,值域:4为慢性病,5为特殊病
private Integer ybJsFlag; //是否允许医保支付
private Integer ybJsFlag; // 是否允许医保支付
private String ybBZCode; //病种编码
private String ybBZCode; // 病种编码
private String ybBZName; //病种名称
private String ybBZName; // 病种名称
private List<HisRecipeItem> item;
// 处方集合
private List<HisRecipe> groupList;
}

@ -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;
}

@ -24,6 +24,8 @@ public class TreatRecord implements Serializable {
private String inOutState;
private String treatNum;
// 就诊类型[1:门诊; 2:住院]
private String treatType;
// 加密的患者id
private String enPatientId;
// 加密的就诊号

@ -10,6 +10,7 @@ import org.apache.commons.lang3.ObjectUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
@ -27,6 +28,8 @@ public class Order implements Serializable {
private static final long serialVersionUID = 3666666777881604L;
private Long id;
// 加密的id
private String enId;
// 修改时间
private Date updateTime;
// openid
@ -59,6 +62,8 @@ public class Order implements Serializable {
private String tradeTime;
// 门诊号 | 住院号
private String treatNum;
// 加密的门诊号
private String enTreatNum;
// 支付方式统计(微信:{0:程序内;1:扫码;2:盒子支付;3:native支付};支付宝:{10:程序内,11:扫码:12:盒子支付})
private String payWay;
// 商户名称
@ -128,6 +133,11 @@ public class Order implements Serializable {
private String mdTrtId;
// 医保-用户ID
private String mdUserId;
// 今天日期
private String curDate;
// 查询报告的日期范围
private String queryBegDate;
private String queryEndDate;
// 缴费订单类型
private String orderType;
@ -135,12 +145,16 @@ public class Order implements Serializable {
// PEIS通知状态
private Integer peisStatus;
// PEIS返回提示
private String peisResult;
public void filterInfo() {
if (id != null) {
this.enId = ReqParamHelper.encode(String.valueOf(id));
this.id = null;
}
String _cardNo = this.idCardNo;
if (!ObjectUtils.isEmpty(_cardNo)) {
this.idCardNo = null;
@ -158,5 +172,10 @@ public class Order implements Serializable {
if (!ObjectUtils.isEmpty(this.patientId)) {
this.enPatientId = ReqParamHelper.encode(this.patientId);
}
if (!ObjectUtils.isEmpty(treatNum)) {
this.enTreatNum = ReqParamHelper.encode(String.valueOf(treatNum));
}
}
}

@ -18,7 +18,6 @@ import java.math.BigDecimal;
@NoArgsConstructor
public class Register extends Order {
private Long id;
private String enId;
private String deptCode;
private String subDeptCode;
@ -56,7 +55,7 @@ public class Register extends Order {
private String sourceId;
private String begTime;
private String endTime;
// 【今日挂号】是否就诊[0:未就诊,1:已就诊,-1:退号]
// 【今日挂号】是否就诊[0:未就诊,1:已就诊,-1:退号]
private Integer isTreat;
// 【预约挂号】是否取号[0:未取号,1:已取号,-1:取消预约]
private Integer isTake;
@ -66,16 +65,22 @@ public class Register extends Order {
private Integer sourceCount;
// 剩余号源数
private Integer remainCount;
// 0-没有号源不允许挂号,1-有号源可以挂号
// 0:没有号源不允许挂号;1:有号源可以挂号
private Integer allowReg;
// 是否被占用
private Integer isUsed;
// 院区
private String hospitalArea;
// 挂号订单来源
// 挂号订单来源平台
private String orderFromOwner;
// 判断是否为分时段挂号
private Boolean isSplitTime;
// 就医助手流程标记
private String medToolMark;
public boolean hasIsTake(int val) {
return isTake != null && isTake == val;
}
public boolean hasIsTreat(int val) {
return isTreat != null && isTreat == val;
}
}

@ -1,9 +1,13 @@
package com.ynxbd.common.bean.report;
import com.ynxbd.wx.wxfactory.ReqParamHelper;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.apache.commons.lang3.ObjectUtils;
import java.io.Serializable;
/**
* @Author wsq
@ -14,8 +18,8 @@ import lombok.ToString;
@Getter
@ToString
@NoArgsConstructor
public class CheckReport {
private static final long serialVersionUID = 1L;
public class CheckReport implements Serializable {
private static final long serialVersionUID = 202504141516001L;
private String id;
private String name;
private String type;
@ -38,8 +42,45 @@ public class CheckReport {
private String bodyPart;
private String description;
private String conclusion;
private String note;
private String note; // 描述
private String diagnose;
private String reportDoctName;
private String reportDate;
// 就诊号
private String treatNum;
private String enTreatNum;
// 就诊类型[1:门诊; 2:住院]
private String treatType;
private String reportName;
private String reportType;
private String reportState;
public void filterInfo() {
this.diagnose = null;
this.note = null;
this.conclusion = null;
this.description = null;
this.reportName = null;
this.name = null;
this.bodyPart = null;
}
// web数据过滤
public void filterWebData() {
String reportTreatNum = this.mzNum;
if (!ObjectUtils.isEmpty(reportTreatNum)) {
this.treatType = "1"; // 门诊
} else {
reportTreatNum = this.zyNum;
if (!ObjectUtils.isEmpty(reportTreatNum)) {
this.treatType = "2"; // 住院
}
}
this.treatNum = reportTreatNum;
this.reportName = this.name;
this.reportType = this.type;
this.enTreatNum = ReqParamHelper.encode(reportTreatNum);
}
}

@ -13,7 +13,7 @@ import java.io.Serializable;
@NoArgsConstructor
public class InspectionItem implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 202504141516004L;
private String specimen;
private String assayCode;
private String assayName;

@ -13,7 +13,7 @@ import java.util.List;
@ToString
@NoArgsConstructor
public class InspectionReport implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 202504141516006L;
private String id;
private String name;
private String type;

@ -13,7 +13,7 @@ import java.io.Serializable;
@ToString
@NoArgsConstructor
public class WaitReg implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 202504141516009L;
// openId
public String openId;
// 患者姓名

@ -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);
});
}
}

@ -44,9 +44,9 @@ public class NatRecordDao {
*/
public boolean hasRecord(String patientId, String updateTime) {
String sql = "select * from nat_record where patientId=? and CONCAT(date_format(updateTime,'%Y-%m-%d'), '')=?";
return DataBase.select(sql, NatRecord.class, ps -> {
return !DataBase.select(sql, NatRecord.class, ps -> {
ps.setString(1, patientId);
ps.setString(2, updateTime);
}).size() > 0;
}).isEmpty();
}
}

@ -1,5 +1,6 @@
package com.ynxbd.common.dao;
import com.ynxbd.common.bean.CommonOption;
import com.ynxbd.common.bean.Patient;
import com.ynxbd.common.bean.PatientLink;
import com.ynxbd.common.bean.enums.HCardTypeEnum;
@ -113,7 +114,7 @@ public class PatientDao {
/**
* 根据身份证查询患者
* 查询患者本人
*
* @param openid openid
* @return 患者信息
@ -123,7 +124,7 @@ public class PatientDao {
List<Patient> resultList = DataBase.select(sql, Patient.class, ps -> {
ps.setString(1, openid);
});
return resultList.size() > 0 ? resultList.get(0) : null;
return !resultList.isEmpty() ? resultList.get(0) : null;
}
@ -140,7 +141,20 @@ public class PatientDao {
ps.setString(1, openid);
ps.setString(2, patientId);
});
return resultList.size() > 0 ? resultList.get(0) : null;
return !resultList.isEmpty() ? resultList.get(0) : null;
}
/**
* 查询患者本人
*
* @param openId openId
* @return 患者信息
*/
public List<Patient> selectPatientsByOpenId(String openId) {
String sql = "select patientId, name, sex, birthday, idCardNo, tel from patientBase where openId= ? and deletedState = 0 order by isDefault desc";
return DataBase.select(sql, Patient.class, ps -> {
ps.setString(1, openId);
});
}
/**
@ -310,7 +324,7 @@ public class PatientDao {
ps.setString(1, patientId);
});
if (dataList.size() == 0) {
if (dataList.isEmpty()) {
return new ArrayList<>();
}
return dataList;
@ -321,7 +335,7 @@ public class PatientDao {
ps.setString(1, cardNo);
});
if (dataList.size() == 0) {
if (dataList.isEmpty()) {
return new ArrayList<>();
}
return dataList;
@ -332,7 +346,7 @@ public class PatientDao {
ps.setString(1, patientId);
});
if (dataList.size() == 0) {
if (dataList.isEmpty()) {
return new ArrayList<>();
}
return dataList;

@ -25,7 +25,6 @@ import java.util.List;
@Slf4j
public class RegisterDao {
/**
* 获取今日挂号的所有患者的openId用作到诊推送
*
@ -49,13 +48,13 @@ public class RegisterDao {
if (doctCode != null && !"".equals(doctCode)) {
String sqlCode = "select title, customTitle, metaTitle, meta tel, skill, headImg, description, pym, isDisabled, deletedState from doctor where doctCode='" + doctCode + "'";
resultList = DataBase.select(sqlCode, Doctor.class);
if (resultList.size() > 0) {
if (!resultList.isEmpty()) {
return resultList.get(0);
} else {
if (doctName != null && !"".equals(doctName)) {
String sqlName = "select title, customTitle, tel, skill, headImg, description, pym, isDisabled, deletedState from doctor where doctName='" + doctName + "'";
resultList = DataBase.select(sqlName, Doctor.class);
return resultList.size() > 0 ? resultList.get(0) : null;
return !resultList.isEmpty() ? resultList.get(0) : null;
}
}
}
@ -68,7 +67,7 @@ public class RegisterDao {
* @return 医生信息
*/
public List<Doctor> selectDocListByCodes(List<Doctor> docList) {
if (docList == null || docList.size() == 0) {
if (docList == null || docList.isEmpty()) {
return new ArrayList<>();
}
@ -84,7 +83,7 @@ public class RegisterDao {
}
String codeStr = sb.toString();
if (codeStr.length() == 0) {
if (codeStr.isEmpty()) {
return new ArrayList<>();
}
@ -147,9 +146,9 @@ public class RegisterDao {
*/
public boolean isMerPaidByOutTradeNo(String outTradeNo) {
String sql = "select hisStatus from register where outTradeNo= ? and payStatus = 0";
return DataBase.select(sql, Register.class, ps -> {
return !DataBase.select(sql, Register.class, ps -> {
ps.setString(1, outTradeNo);
}).size() > 0;
}).isEmpty();
}
/**
@ -197,7 +196,7 @@ public class RegisterDao {
}
/**
* 根据hisTransNo获取挂号信息
* 根据[hisTransNo]查询挂号信息
*
* @param hisTransNo hisTransNo
*/
@ -206,7 +205,35 @@ public class RegisterDao {
List<Register> resultList = DataBase.select(sql, Register.class, ps -> {
ps.setString(1, hisTransNo);
});
return resultList.size() > 0 ? resultList.get(0) : null;
return resultList.isEmpty() ? null : resultList.get(0);
}
/**
* 根据[tradeNo]查询挂号信息
*
* @param tradeNo tradeNo
*/
public Register selectRegByPatientIdAndTradeNo(String patientId, String tradeNo) {
String sql = "select * from register where tradeNo= ? and patientId=? and hisStatus= 0 and refundTime is null";
return DataBase.selectOne(sql, Register.class, ps -> {
ps.setString(1, tradeNo);
ps.setString(2, patientId);
});
}
/**
* 防止 hisTransNo不唯一第一次挂号失败第二次挂号后可能会返回相同的号
*
* @param patientId 患者id
* @param hisTransNo His交易流水号
* @return list
*/
public List<Register> selectListByPatientIdAndHisTransNo(String patientId, String hisTransNo) {
String sql = "select * from register where hisTransNo= ? and patientId= ? and hisStatus= 0 and refundTime is null";
return DataBase.select(sql, Register.class, ps -> {
ps.setString(1, hisTransNo);
ps.setString(2, patientId);
});
}
@ -641,9 +668,9 @@ public class RegisterDao {
/**
* 查询订单状态异常订单
*
* @param bankTransNo
* @param tradeNo
* @param timePoint
* @param bankTransNo 支付订单号
* @param tradeNo HIS交易流水号
* @param timePoint 时间点
* @return
*/
public Register selectStatusErrOrder(String bankTransNo, String tradeNo, String timePoint) {
@ -735,12 +762,11 @@ public class RegisterDao {
}
// LOCATE未找到返回0
public int updateRegMedToolMark(String id, String addMedToolMark, String updateMedToolMark) {
String sql = "update register set medToolMark=? where id=? and Locate(?, ifNull(medToolMark, '')) = 0";
public int updateTreatNum(Long id, String treatNum) {
String sql = "update register set treatNum=? where id=? and ifNull(treatNum, '') = ''";
return DataBase.update(sql, ps -> {
ps.setString(1, updateMedToolMark);
ps.setString(2, id);
ps.setString(3, addMedToolMark);
ps.setString(1, treatNum);
ps.setLong(2, id);
});
}
@ -750,4 +776,5 @@ public class RegisterDao {
ps.setString(1, id);
});
}
}

@ -47,7 +47,7 @@ public class HisRecipeDao {
* @param endDate 结束日期
* @return 已缴费项目
*/
public List<HisRecipe> getPaidRecipeList(String patientId, String begDate, String endDate,String personNo) {
public List<HisRecipe> getPaidRecipeList(String patientId, String begDate, String endDate, String personNo) {
List<HisRecipe> resultList = new ArrayList<>();
Map<String, Object> params = new HashMap<>();
@ -55,7 +55,7 @@ public class HisRecipeDao {
params.put("RecipeID", "");
params.put("StartTime", begDate);
params.put("EndTime", endDate);
params.put("PersonNo",personNo);
params.put("PersonNo", personNo);
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_OutpatientFee, params);
if (!jsonResult.success()) { // 请求失败
@ -80,9 +80,9 @@ public class HisRecipeDao {
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_UnPay_Invoice, params -> {
params.put("PatientID", patientId);
params.put("PersonNo",personNo);
params.put("PersonNo", personNo);
params.put("IsLastWeekFlag", days <= 7 ? "1" : "");
params.put("CallNo",HisHelper.CALL_NO);
params.put("CallNo", HisHelper.CALL_NO);
});
if (!jsonResult.success()) { // 失败
@ -100,17 +100,17 @@ public class HisRecipeDao {
List<medicalRecipe> resultList = new ArrayList<>();
JsonResult jsonResult = HisHelper.getMdJsonResult(HisEnum.XK_MEDICAL_RECIPE, params -> {
params.put("PersonID",personID);
params.put("PersonID", personID);
params.put("MZNum", treatNum);
params.put("CallNo",HisHelper.CALL_NO);
params.put("CFNums",recipes);
params.put("CallNo", HisHelper.CALL_NO);
params.put("CFNums", recipes);
});
if (!jsonResult.success()) { // 失败
return Result.error(jsonResult.getMessage());
}
List<medicalRecipe> medicalRecipe = jsonResult.getDataMapList(medicalRecipe.class, "CFNums","Item");
List<medicalRecipe> medicalRecipe = jsonResult.getDataMapList(medicalRecipe.class, "CFNums", "Item");
if (medicalRecipe != null) {
resultList = medicalRecipe;
}
@ -118,7 +118,6 @@ public class HisRecipeDao {
}
/**
* HIS申请单预缴费
*
@ -154,11 +153,10 @@ public class HisRecipeDao {
params.put("BankTransNo", UUID.randomUUID().toString().replace("-", ""));
params.put("PayWay", merchantEnum.HIS_PAY_WAY);
},merchantEnum);
}, merchantEnum);
}
/**
* 缴费更新recipeId参数为List支持多个处方单同时缴费
*
@ -171,16 +169,16 @@ public class HisRecipeDao {
* @param payTime 支付时间
* @param tradeNo HIS交易流水号
* @param payDeviceId payDeviceID
* @param transId 银行流水号
* @param transId 银行流水号
* @return bean
*/
public static JsonResult payInvoice(String openid, String patientId, String treatNum, List<String> recipeIds, String payMoney,String totalFee,
public static JsonResult payInvoice(String openid, String patientId, String treatNum, List<String> recipeIds, String payMoney, String totalFee,
String payDate, String payTime, String tradeNo, String payDeviceId, String transId, MerchantEnum merchantEnum, String feeId, String feeInfo) {
String fpOrderId = (tradeNo != null && tradeNo.indexOf("ORD") == 0 ? tradeNo : transId);
if (ObjectUtils.isNotEmpty(feeId)
&& ObjectUtils.isNotEmpty(feeInfo)){ // 新版本预缴费
&& ObjectUtils.isNotEmpty(feeInfo)) { // 新版本预缴费
log.info("[预结算]回调 feeId={}", feeId);
return HisHelper.getJsonResult(HisEnum.AP_Pay_Invoice_New, params -> {
params.put("PatientID", patientId);
@ -192,7 +190,7 @@ public class HisRecipeDao {
// 预结算
params.put("FeeID", feeId);
params.put("FeeInfo", feeInfo);
},merchantEnum);
}, merchantEnum);
}
StringBuilder recipeIdsXml = new StringBuilder();
@ -200,7 +198,7 @@ public class HisRecipeDao {
recipeIdsXml.append("<Id>").append(id).append("</Id>");
}
Map<String,Object> params = new HashMap<>();
Map<String, Object> params = new HashMap<>();
params.put("Recipe", recipeIdsXml.toString());
params.put("PatientID", patientId);
params.put("MZNum", treatNum);
@ -213,16 +211,16 @@ public class HisRecipeDao {
params.put("BankTransNo", fpOrderId); // 商户订单号
params.put("OpenId", openid);
params.put("Token", WeChatConfig.TOKEN);
if(treatNum.contains("P-")){
log.info("[{}支付回调-体检,体检号-{}]",merchantEnum.NAME,treatNum);
if (treatNum.contains("P-")) {
log.info("[{}支付回调-体检,体检号-{}]", merchantEnum.NAME, treatNum);
params.put("MZNum", "0");
params.put("PatientID", "0");
params.put("TJBH",treatNum.split("-")[1]);
params.put("GroupFlag","1");
params.put("TJBH", treatNum.split("-")[1]);
params.put("GroupFlag", "1");
params.remove("Recipe");
params.put("PayMoney", totalFee); //如果是体检支付就传入总金额
}
return HisHelper.getJsonResult(HisEnum.AP_Pay_Invoice, params,merchantEnum);
return HisHelper.getJsonResult(HisEnum.AP_Pay_Invoice, params, merchantEnum);
}

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ynxbd.common.bean.Dept;
import com.ynxbd.common.bean.Doctor;
import com.ynxbd.common.bean.RegSign;
import com.ynxbd.common.bean.enums.MerchantEnum;
import com.ynxbd.common.bean.pay.Register;
import com.ynxbd.common.dao.RegisterDao;
@ -455,7 +456,7 @@ public class HisRegisterDao {
* @param patientId 患者id
* @return 挂号记录
*/
public List<Register> getRegTodayHistory(String patientId, String regDate) {
public List<Register> getHisRegHistoryRecords(String patientId, String regDate) {
List<Register> resultList = new ArrayList<>();
Map<String, Object> params = new HashMap<>();
params.put("PatientID", patientId);
@ -511,7 +512,7 @@ public class HisRegisterDao {
* @param regDate 挂号日期
* @return 预约记录
*/
public List<Register> getRegReserveHistory(String patientId, String regDate) {
public List<Register> getRegReserveRecords(String patientId, String regDate) {
List<Register> resultList = new ArrayList<>();
Map<String, Object> params = new HashMap<>();
params.put("PatientID", patientId);
@ -620,7 +621,7 @@ public class HisRegisterDao {
* @return boolean
*/
public List<Register> hasRegSite(String patientId, String regDate) {
return getRegTodayHistory(patientId, regDate);
return getHisRegHistoryRecords(patientId, regDate);
}
/**
@ -631,7 +632,7 @@ public class HisRegisterDao {
* @return boolean
*/
public List<Register> hasRegReserve(String patientId, String regDate) {
return getRegReserveHistory(patientId, regDate);
return getRegReserveRecords(patientId, regDate);
}
@ -958,7 +959,6 @@ public class HisRegisterDao {
*/
public JSONArray getDoctorSchedule(String begDate, String endDate, String doctCode) {
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Doctor_Schedule, params -> {
params.put("BegDate", begDate);
params.put("EndDate", endDate);
@ -1008,7 +1008,7 @@ public class HisRegisterDao {
* @param endDate 结束时间
* @return 待签到记录
*/
public JSONArray getReLineSignInRecord(String begDate, String endDate) {
public JSONArray getRegLineSignInRecordsOld(String begDate, String endDate) {
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_Line_SignIn, params -> {
params.put("BegDate", begDate);
params.put("EndDate", endDate);
@ -1019,6 +1019,48 @@ public class HisRegisterDao {
return null;
}
/**
* 查询预约待签到记录包含今日挂号的
*
* @param begDate 开始时间
* @param endDate 结束时间
* @return list
*/
public List<RegSign> getRegLineSignInRecords(String begDate, String endDate) {
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.AP_Query_Line_SignIn, params -> {
params.put("BegDate", begDate);
params.put("EndDate", endDate);
});
if (jsonResult.success()) {
List<RegSign> regSignList = new ArrayList<>();
JSONArray jsonArray = jsonResult.getJsonArray("Items", "Item");
RegSign regSign;
JSONObject item;
for (int i = 0; i < jsonArray.size(); i++) {
item = jsonArray.getJSONObject(i);
regSign = new RegSign();
regSign.setTreatNum(item.getString("MZNum"));
regSign.setPatientId(item.getString("PatientId"));
regSign.setPatientName(item.getString("PatientName"));
regSign.setDeptCode(item.getString("DeptCode"));
regSign.setDeptName(item.getString("DeptName"));
regSign.setDoctCode(item.getString("DoctCode"));
regSign.setDoctName(item.getString("DoctName"));
regSign.setBegTime(item.getString("BegTime"));
regSign.setEndTime(item.getString("EndTime"));
regSign.setReservationDate(item.getString("ReservationDate"));
regSign.setScheduleDate(item.getString("ScheduleDate"));
regSign.setRegDateTime(item.getString("RegistDate"));
regSignList.add(regSign);
}
return regSignList;
}
return null;
}
/**
* 执行预约签到(只执行分时段)
*

@ -66,6 +66,10 @@ public class HisReportDao {
});
if (!jsonResult.success()) {
String message = jsonResult.getMessage();
if (message != null && message.contains("没有查询到")) {
return new ArrayList<>();
}
throw new ServiceException(jsonResult.getMessage());
}
return jsonResult.getDataMapList(CheckReport.class, "Report");
@ -133,17 +137,21 @@ public class HisReportDao {
*
* @return 就诊记录
*/
public List<TreatRecord> getTreatRecordList(String patientId, String begDate, String endDate, String patientType, String reportType, String deptCode) throws ServiceException {
public List<TreatRecord> getReportTreatRecords(String patientId, String begDate, String endDate, String treatType, String reportType, String deptCode) throws ServiceException {
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.Query_TreatRecords, params -> {
params.put("PatientId", patientId);
params.put("BegDate", begDate);
params.put("EndDate", endDate);
params.put("DeptCode", deptCode);
params.put("InOutState", patientType == null ? "0" : patientType); // 0:全部; 1:门诊号; 2:住院号
params.put("InOutState", treatType == null ? "0" : treatType); // 0:全部; 1:门诊号; 2:住院号
params.put("CheckOrInspection", reportType == null ? "0" : reportType); // 0:全部; 1:检查; 2:检验; 3:检查+检验
});
if (!jsonResult.success()) {
String message = jsonResult.getMessage();
if (message != null && message.contains("没有要查找的记录")) {
return new ArrayList<>();
}
throw new ServiceException(jsonResult.getMessage());
}
List<TreatRecord> resultList = new ArrayList<>();
@ -155,6 +163,7 @@ public class HisReportDao {
item = new TreatRecord();
item.setInOutState(nodeItem.getString("InOutState"));
item.setTreatType(nodeItem.getString("InOutState")); // 就诊类型
item.setTreatNum(nodeItem.getString("MZNum"));
item.setDeptCode(nodeItem.getString("DeptCode")); // 职称
item.setDeptName(nodeItem.getString("DeptName")); //

@ -13,35 +13,35 @@ import java.util.List;
*/
public class RISPacsDao {
public List<RISPacsReportInfo> getReportInfoForOutPatientNum(String outPatientNum){
return getReportInfo(outPatientNum,null);
public List<RISPacsReportInfo> getReportInfoForOutPatientNum(String outPatientNum) {
return getReportInfo(outPatientNum, null);
}
public List<RISPacsReportInfo> getReportInfoForInPatientNum(String inPatientNum){
return getReportInfo(null,inPatientNum);
public List<RISPacsReportInfo> getReportInfoForInPatientNum(String inPatientNum) {
return getReportInfo(null, inPatientNum);
}
public List<RISPacsReportInfo> getReportInfo(String outPatientNum, String inPatientNum){
if(outPatientNum!=null){
public List<RISPacsReportInfo> getReportInfo(String outPatientNum, String inPatientNum) {
if (outPatientNum != null) {
return PacsDB.select("select * from V_PACS_ReportInfo where outPatientNum = ? and ReportFile is not null",
RISPacsReportInfo.class,
ps ->{
ps.setString(1,outPatientNum);
ps -> {
ps.setString(1, outPatientNum);
});
}
return PacsDB.select("select * from V_PACS_ReportInfo where inPatientNum = ? and ReportFile is not null",
RISPacsReportInfo.class,
ps ->{
ps.setString(1,inPatientNum);
ps -> {
ps.setString(1, inPatientNum);
});
}
public String getReportPath(String reportId){
public String getReportPath(String reportId) {
return PacsDB.select("select reportFile from V_PACS_ReportInfo where ReportID = ?",
String.class,
ps ->{
ps.setString(1,reportId);
ps -> {
ps.setString(1, reportId);
}).get(0);
}
}

@ -8,6 +8,7 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
@ -40,6 +41,7 @@ public class DateHelper {
}
}
public static LocalDateTime strToLocalDateTime(String date) {
try {
return LocalDateTime.parse(date, DateTimeFormatter.ofPattern(DateEnum.yyyy_MM_dd_HH_mm_ss.TYPE));
@ -50,7 +52,7 @@ public class DateHelper {
}
public static String DateTimeToString(Date date) {
if(date==null||"".equals(date.toString())){
if (date == null || "".equals(date.toString())) {
return "";
}
DateFormat df = new SimpleDateFormat(DateEnum.yyyy_MM_dd_HH_mm_ss.TYPE);
@ -589,4 +591,18 @@ public class DateHelper {
}
}
public static Boolean leftGreaterThanRight(String dateStr1, String dateStr2, String format) {
if (ObjectUtils.isEmpty(dateStr1) && ObjectUtils.isEmpty(dateStr2)) {
return null;
}
if (format == null) {
format = "yyyy-MM-dd HH:mm:ss";
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
LocalDateTime date1 = LocalDateTime.parse(dateStr1, formatter);
LocalDateTime date2 = LocalDateTime.parse(dateStr2, formatter);
return date1.isAfter(date2);
}
}

@ -25,7 +25,6 @@ public class SmbHelper {
private final String user;
private final String pass;
public byte[] smbGet(String shareUrl) throws Exception {
CIFSContext base = SingletonContext.getInstance();
CIFSContext auth = base.withCredentials(new NtlmPasswordAuthentication(base,null, user, pass));

@ -108,9 +108,6 @@ public enum HisEnum {
AP_Query_Line_SignIn("[在线签到]查询已挂号未签到记录","7009","AP_Query_LineSignIn",true),
AP_Line_SignIN("[在线签到]执行挂号患者签到","7010","AP_LineSignIn",true),
;
public final String NAME;

@ -164,7 +164,7 @@ public class HisHelper {
}
/**
* 医保环境
* 测试环境
*
* @param hisEnum 枚举
* @param params 发送的参数

@ -1,9 +1,6 @@
package com.ynxbd.common.helper.pacs;
import com.ynxbd.common.config.db.PacsDB;
import com.ynxbd.common.dao.pacs.RISPacsDao;
import com.ynxbd.common.helper.ProperHelper;
import com.ynxbd.common.helper.common.FtpHelper;
import com.ynxbd.common.helper.common.SmbHelper;
import lombok.extern.slf4j.Slf4j;
@ -18,16 +15,15 @@ public class RISPacsHelper {
private static final String FTP_USER;
private static final String FTP_PASS;
public static SmbHelper smbHelper;
static {
ProperHelper config = new ProperHelper().read("pacs.properties");
FTP_USER = config.getString("ris.ftpUser");
FTP_PASS = config.getString("ris.ftpPass");
if(FTP_USER ==null){
if (FTP_USER == null) {
log.error("上海岱嘉PACS配置文件读取失败");
}
else {
smbHelper = new SmbHelper(FTP_USER,FTP_PASS);
} else {
smbHelper = new SmbHelper(FTP_USER, FTP_PASS);
}
}
}

@ -12,7 +12,7 @@ import lombok.extern.slf4j.Slf4j;
*/
@Slf4j
public class XBDHelper {
private static final String CLOUD_FILM_LINK;
private static final String CLOUD_FILM_URL;
public static final String MED_RECORD_COPY_URL;
public static final String XBD_PEIS;
public static OutTeamDao outTeamDao;
@ -20,12 +20,12 @@ public class XBDHelper {
static {
ProperHelper config = new ProperHelper().read("xbd.properties");
CLOUD_FILM_LINK = config.getString("xbd.200.cloud_film_link");
CLOUD_FILM_URL = config.getString("xbd.200.cloud_film_url");
MED_RECORD_COPY_URL = config.getString("xbd.200.med_record_copy_url");
XBD_PEIS = config.getString("xbd.100.peis_url");
if (CLOUD_FILM_LINK == null) {
if (CLOUD_FILM_URL == null) {
log.error("新八达200团队配置文件读取失败");
}
outTeamDao = new OutTeamDao(CLOUD_FILM_LINK);
outTeamDao = new OutTeamDao(CLOUD_FILM_URL);
}
}

@ -336,7 +336,7 @@ public class JsonResult {
JSONObject jsonObject;
for (String node : nodes) {
jsonArray = JsonHelper.parseArray(result);
if (jsonArray == null || jsonArray.size() == 0) {
if (jsonArray == null || jsonArray.isEmpty()) {
return new JSONArray();
}
if (jsonArray.size() == 1) { // 如果只有一个值继续处理
@ -439,7 +439,7 @@ public class JsonResult {
String result = rootObj == null ? new JSONObject().toJSONString() : rootObj.toString();
try {
JSONArray jsonArray = JSONArray.parseArray(result);
if (jsonArray == null || jsonArray.size() == 0) {
if (jsonArray == null || jsonArray.isEmpty()) {
return new JSONObject();
}

@ -2,9 +2,15 @@ package com.ynxbd.common.result;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ynxbd.common.helper.common.DateHelper;
import com.ynxbd.common.result.struts2.BaseResult;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -12,20 +18,26 @@ import java.util.Map;
@Slf4j
@Setter
@Getter
@ToString
@NoArgsConstructor
public class Result extends BaseResult {
private static final long serialVersionUID = -1005L;
//
private Integer code;
private String message;
private Object data;
private String date;
/**
* 判断是否成功
*/
@JsonIgnore
@JSONField(serialize = false)
public boolean isSuccess() {
public boolean isOK() {
return ResultEnum.SUCCESS.status.equals(this.code);
}
@ -153,51 +165,17 @@ public class Result extends BaseResult {
return new Result(resultEnum.status, resultEnum.message);
}
public Result() {
}
private Result(Integer code, String message) {
this.code = code;
this.message = message;
this.date = DateHelper.getCurDateTime();
}
public Result(Integer code, String message, Object data) {
this.code = code;
this.message = message;
this.data = data;
}
@Override
public String toString() {
return "Result{" +
"code=" + code +
", message='" + message + '\'' +
", data=" + data +
'}';
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
this.date = DateHelper.getCurDateTime();
}

@ -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);
}
}
}

@ -284,7 +284,7 @@ public class MedicalService {
}
/**
* [医保]处方缴费
* [医保]挂号回调通知
*
* @param merchantEnum 类型
* @param outTradeNo 订单号
@ -294,7 +294,7 @@ public class MedicalService {
* @param openid openid
* @param payInfo 支付信息
*/
public static boolean regPay(MerchantEnum merchantEnum, String outTradeNo, String bankTransNo, String payDate, String payTime, String openid, String payInfo) {
public static boolean regPayNotify(MerchantEnum merchantEnum, String outTradeNo, String bankTransNo, String payDate, String payTime, String openid, String payInfo) {
if (outTradeNo == null || bankTransNo == null || payDate == null || payTime == null) {
log.info("[医保][挂号]HIS结算参数缺失 outTradeNo={}, bankTransNo={}, payDate={}, payTime={}", outTradeNo, bankTransNo, payDate, payTime);
return false;
@ -393,7 +393,7 @@ public class MedicalService {
* @param openid openid
* @param payInfo 支付信息
*/
public static boolean recipePay(MerchantEnum merchantEnum, String outTradeNo, String bankTransNo, String payDate, String payTime, String openid, String payInfo) {
public static boolean recipePayNotify(MerchantEnum merchantEnum, String outTradeNo, String bankTransNo, String payDate, String payTime, String openid, String payInfo) {
if (outTradeNo == null || bankTransNo == null || payDate == null || payTime == null) {
log.info("[医保][处方]HIS结算参数缺失 outTradeNo={}, bankTransNo={}, payDate={}, payTime={}", outTradeNo, bankTransNo, payDate, payTime);
return false;
@ -502,16 +502,16 @@ public class MedicalService {
*/
public static Result refund(String payAuthNo, String fpNum, String outTradeNo, String bankTransNo, String tradeNo, String mdUserId, BigDecimal cashFee, BigDecimal insuranceFee) {
if (insuranceFee.compareTo(BigDecimal.ZERO) == 0 && cashFee.compareTo(BigDecimal.ZERO) == 0) {
log.info("【医保】[处方]退费金额为0不退费");
return Result.error("【医保】[处方]金额为0不退费");
log.info("[医保][处方]退费金额为0不退费");
return Result.error("[医保][处方]金额为0不退费");
}
// 医保退费-必须先执行
log.info("【医保】[处方][个账]退费开始 tradeNo={}, payAuthNo={}, fpNum={}", tradeNo, payAuthNo, fpNum);
log.info("[医保][处方][个账]退费开始 tradeNo={}, payAuthNo={}, fpNum={}", tradeNo, payAuthNo, fpNum);
JsonResult jsonResult = HisMedicalDao.mdRefund(payAuthNo, fpNum, bankTransNo, ("R" + tradeNo), cashFee);
if (!jsonResult.success()) { // 失败
log.info("【医保】[处方][个账]退费失败 outTradeNo={}, bankTransNo={}, tradeNo={}", outTradeNo, bankTransNo, tradeNo);
log.info("[医保][处方][个账]退费失败 outTradeNo={}, bankTransNo={}, tradeNo={}", outTradeNo, bankTransNo, tradeNo);
String message = jsonResult.getMessage();
if (message != null && !message.contains("已医保全部退款")) {
return Result.error(message);
@ -523,7 +523,7 @@ public class MedicalService {
// 现金退费
if (cashFee.compareTo(BigDecimal.ZERO) != 0) {
log.info("【医保】[处方]现金开始退费");
log.info("[医保][处方]现金开始退费");
// MedicalInfo info = getMedicalAccounts(mdUserId);
// if (info == null) {
// return Result.error("[订单]未找到结算信息");

@ -32,7 +32,7 @@ import java.util.UUID;
@Slf4j
public class PatientService {
public Patient getMyself(String openid) {
public Patient queryMyself(String openid) {
return new PatientDao().selectMyself(openid);
}
@ -42,13 +42,23 @@ public class PatientService {
return null;
}
List<Patient> patientList = user.getPatientList();
if (patientList == null || patientList.size() == 0) {
if (patientList == null || patientList.isEmpty()) {
return null;
}
return patientList.stream().filter(Patient::getIsMyself).findFirst().orElse(null);
}
public List<Patient> getPatientList(String openid, String unionId, boolean isEnPid) {
/**
* 根据openId查询患者ids
*
* @param openId openId
* @return ids
*/
public List<Patient> queryPatientIdsByOpenId(String openId) {
return new PatientDao().selectPatientsByOpenId(openId);
}
public List<Patient> queryPatientList(String openid, String unionId, boolean isEnPid) {
List<Patient> patients = new PatientDao().selectListByToken(openid, unionId);
if (isEnPid) {
for (Patient item : patients) {

@ -647,7 +647,7 @@ public class RecipeService {
}
Integer payStatus = recipe.getPayStatus();
if (payStatus == null || payStatus != 0) {
log.info("【医保】退费参数缺失 payOrdId={}, payStatus={}", payOrdId, payStatus);
log.info("[医保]退费参数缺失 payOrdId={}, payStatus={}", payOrdId, payStatus);
return Result.error(ResultEnum.PAY_ORDER_PARAMS_IS_DEFECT);
}

@ -5,6 +5,7 @@ import com.ynxbd.ali.enums.AliMsgEnum;
import com.ynxbd.ali.helper.AliHelper;
import com.ynxbd.ali.helper.AliMessageHelper;
import com.ynxbd.common.action.pay.PEnum;
import com.ynxbd.common.bean.RegSign;
import com.ynxbd.common.bean.enums.HospEnum;
import com.ynxbd.common.bean.enums.MerchantEnum;
import com.ynxbd.common.bean.pay.Order;
@ -394,7 +395,6 @@ public class RegService {
}
Register reg = new RegisterDao().selectRegByHisTransNo(hisTransNo);
if (reg == null) {
log.info("[挂号][取消预约]失败, 未查询到挂号支付信息");
return Result.error(ResultEnum.DATA_NOT_FOUND);
@ -444,7 +444,7 @@ public class RegService {
}
MessagePushConfig.regCancelPush(merchantEnum, reg);
if (result.isSuccess()) {
if (result.isOK()) {
result.setMessage(merchantEnum.NAME + "取消成功,挂号费用将在24小时内退回!"); // 修改返回提示的信息
}
@ -529,7 +529,7 @@ public class RegService {
}
MessagePushConfig.regCancelPush(merchantEnum, reg);
if (result.isSuccess()) {
if (result.isOK()) {
result.setMessage(merchantEnum.NAME + "取消成功,挂号费用将在24小时内退回!"); // 修改返回提示的信息
}
@ -808,17 +808,17 @@ public class RegService {
return new RegisterDao().updateMicroOrderState(outTradeNo, bankTransNo, openid);
}
// 查询挂号预约记录
public List<Register> getHisRegReserveRecords(String patientId, String regDate) {
return new HisRegisterDao().getRegReserveHistory(patientId, regDate);
return new HisRegisterDao().getRegReserveRecords(patientId, regDate);
}
public List<Register> getHisRegRecords(String patientId, String begDate, String endDate) throws ServiceException {
// 查询挂号历史记录
public List<Register> getHisRegRecordsByRegDate(String patientId, String begDate, String endDate) throws ServiceException {
if (begDate == null || endDate == null) {
throw new ServiceException("查询日期异常");
}
List<Register> hisRegList = new HisRegisterDao().getRegTodayHistory(patientId, begDate.equals(endDate) ? begDate : null); // 起止日期相同时,传递挂号日期
List<Register> hisRegList = new HisRegisterDao().getHisRegHistoryRecords(patientId, begDate.equals(endDate) ? begDate : null); // 起止日期相同时,传递挂号日期
List<Register> dataList = new ArrayList<>();
String regDate;
@ -834,22 +834,123 @@ public class RegService {
return dataList;
}
/**
* 根据HIS流水号查询订单
*
* @param hisTransNo HIS流水号
* @return bean
*/
public Register queryRegByHisTransNo(String hisTransNo) {
return new RegisterDao().selectRegByHisTransNo(hisTransNo);
}
/**
* 根据HIS流水号查询订单
*
* @param hisTransNo HIS流水号
* @return bean
*/
public Register queryRegByPatientIdAndHisTransNo(String patientId, String hisTransNo) throws ServiceException {
List<Register> dataList = new RegisterDao().selectListByPatientIdAndHisTransNo(patientId, hisTransNo);
if (dataList.isEmpty()) {
return null;
}
if (dataList.size() > 1) {
throw new ServiceException("错误:查询到多条订单信息");
}
return dataList.get(0);
}
/**
* 查询订单
*
* @param tradeNo HIS订单号
* @return bean
*/
public Register queryRegByTradeNoAndPatientId(String patientId, String tradeNo) {
return new RegisterDao().selectRegByPatientIdAndTradeNo(patientId, tradeNo);
}
/**
* 根据HIS挂号订单信息查询
*
* @param hisTransNo HIS流水号
* @return bean
*/
public Register queryRegByHisInfo(String patientId, String tradeNo, String hisTransNo) throws ServiceException {
Register register;
log.info("[挂号订单]根据信息查询订单 patientId={}, hisTransNo={} tradeNo={}", patientId, hisTransNo, tradeNo);
if (ObjectUtils.isEmpty(patientId)) {
return null;
}
if (ObjectUtils.isEmpty(tradeNo) && ObjectUtils.isEmpty(hisTransNo)) {
return null;
}
if (ObjectUtils.isEmpty(tradeNo)) {
register = queryRegByPatientIdAndHisTransNo(patientId, hisTransNo);
} else {
register = queryRegByTradeNoAndPatientId(patientId, tradeNo);
}
return register;
}
public Register findHisRegRecord(String patientId, String regDate, String hisTransNo) throws ServiceException {
if (ObjectUtils.isEmpty(hisTransNo) || ObjectUtils.isEmpty(regDate)) {
/**
* 查询HIS待就诊记录今日挂号和预约挂号记录
*
* @param patientId 患者id
*/
public List<Register> getHisWaitRegRecords(String patientId) throws ServiceException {
if (ObjectUtils.isEmpty(patientId)) {
throw new ServiceException(ResultEnum.PARAM_IS_BLANK);
}
String curDate = DateHelper.getCurDate();
// 挂号历史记录(今日)
List<Register> hisRegRecords = getHisRegRecordsByRegDate(patientId, curDate, curDate);
if (hisRegRecords == null) {
hisRegRecords = new ArrayList<>();
}
// 预约挂号
List<Register> hisRegReserveRecords = getHisRegReserveRecords(patientId, null);
if (hisRegReserveRecords != null && !hisRegReserveRecords.isEmpty()) {
hisRegRecords.addAll(hisRegReserveRecords);
}
return hisRegRecords;
}
/**
* 根据挂号日期查询挂号记录
*
* @param patientId 患者id
* @param regDate 挂号日期
*/
public List<Register> getHisRegRecordsByRegDate(String patientId, String regDate) throws ServiceException {
if (ObjectUtils.isEmpty(patientId) || ObjectUtils.isEmpty(regDate)) {
throw new ServiceException(ResultEnum.PARAM_IS_BLANK);
}
String curDate = DateHelper.getCurDate();
List<Register> hisRegRecords;
if (curDate.equals(regDate)) { // 今日挂号及以前
hisRegRecords = getHisRegRecords(patientId, regDate, regDate);
if (curDate.equals(regDate)) { // 今日挂号
hisRegRecords = getHisRegRecordsByRegDate(patientId, regDate, regDate);
} else { // 预约挂号
hisRegRecords = getHisRegReserveRecords(patientId, regDate);
}
return hisRegRecords;
}
public Register findHisRegRecordByHisTransNo(String patientId, String regDate, String hisTransNo) throws ServiceException {
if (ObjectUtils.isEmpty(regDate) || ObjectUtils.isEmpty(hisTransNo)) {
throw new ServiceException(ResultEnum.PARAM_IS_BLANK);
}
String tip;
List<Register> hisRegRecords = getHisRegRecordsByRegDate(patientId, regDate);
if (hisRegRecords.isEmpty()) {
throw new ServiceException("错误:HIS中未查询到挂号记录 日期:" + regDate);
tip = "HIS中未查询到挂号记录";
log.info("[挂号]{} patientId={}, regDate={}, hisTransNo={}", tip, patientId, regDate, hisTransNo);
throw new ServiceException("错误:" + tip + " 日期:" + regDate);
}
List<Register> filterList = hisRegRecords.stream().filter(o -> hisTransNo.equals(o.getHisTransNo())).collect(Collectors.toList());
@ -857,26 +958,151 @@ public class RegService {
return filterList.get(0);
}
throw new ServiceException(filterList.isEmpty()
? "错误:HIS中未找到对应的挂号信息"
: "错误:HIS中同一科室查询到多条挂号记录");
tip = filterList.isEmpty() ? "HIS中未匹配到挂号记录" : "HIS中同一科室查询到多条挂号记录";
log.info("[挂号]{} patientId={}, regDate={}, hisTransNo={}", tip, patientId, regDate, hisTransNo);
throw new ServiceException("错误:" + tip + " 日期:" + regDate);
}
public boolean updateRegMedToolMark(String id, String addMedToolMark, String openId) throws ServiceException {
public Register findHisRegRecordByTreatNum(String patientId, String regDate, String treatNum) throws ServiceException {
if (ObjectUtils.isEmpty(regDate) || ObjectUtils.isEmpty(treatNum)) {
throw new ServiceException(ResultEnum.PARAM_IS_BLANK);
}
List<Register> hisRegRecords = getHisRegRecordsByRegDate(patientId, regDate, regDate);
String tip;
if (hisRegRecords.isEmpty()) {
tip = "HIS中未查询到挂号记录";
log.info("[挂号]{} patientId={}, regDate={}, treatNum={}", tip, patientId, regDate, treatNum);
throw new ServiceException("错误:" + tip + " 日期:" + regDate);
}
List<Register> filterList = hisRegRecords.stream().filter(o -> treatNum.equals(o.getTreatNum())).collect(Collectors.toList());
if (filterList.size() == 1) {
return filterList.get(0);
}
tip = filterList.isEmpty() ? "HIS中未匹配到挂号记录" : "HIS中同一科室查询到多条挂号记录";
log.info("[挂号]{} patientId={}, regDate={}, treatNum={}", tip, patientId, regDate, treatNum);
throw new ServiceException("错误:" + tip + " 日期:" + regDate);
}
/**
* 查询数据库挂号记录
*
* @param patientId 患者id
* @param regDate 挂号日期
* @param treatNum 门诊号
* @return bean
*/
public Register findDBRegRecordByTreatNum(String patientId, String regDate, String treatNum) {
try {
Register hisRegRecord = findHisRegRecordByTreatNum(patientId, regDate, treatNum);
if (hisRegRecord == null) {
log.info("[挂号]根据门诊号查询失败,未找到HIS挂号记录 patientId={}, regDate={} treatNum={}", patientId, regDate, treatNum);
return null;
}
String hisTransNo = hisRegRecord.getHisTransNo();
if (ObjectUtils.isEmpty(hisTransNo)) {
log.info("[挂号]根据门诊号查询失败 HisTransNo为空 patientId={}, regDate={} treatNum={}", patientId, regDate, treatNum);
return null;
}
return queryRegByHisTransNo(hisTransNo);
} catch (Exception e) {
return null;
}
}
/**
* 补充挂号门诊号
*
* @param treatNum 门诊号
* @param openId openId
*/
public boolean completeRegTreatNum(String treatNum, String openId, String patientId, String tradeNo, String hisTransNo, String orderFromOwner) throws ServiceException {
if (!ObjectUtils.isEmpty(orderFromOwner) && !"蓝旗".equals(orderFromOwner)) {
return true;
}
RegisterDao regDao = new RegisterDao();
Register findInfo = regDao.selectRegisterById(id);
Register findInfo = queryRegByHisInfo(patientId, tradeNo, hisTransNo);
if (findInfo == null) {
throw new ServiceException("未找到挂号信息");
}
String dbMedToolMark = findInfo.getMedToolMark();
String updateMedToolMark = addMedToolMark;
if (!ObjectUtils.isEmpty(dbMedToolMark)) {
if (dbMedToolMark.contains(addMedToolMark)) { // 已存在
throw new ServiceException("状态已存在");
} else {
updateMedToolMark = dbMedToolMark + "," + addMedToolMark;
}
Long id = findInfo.getId();
String curDate = DateHelper.getCurDate();
if (!curDate.equals(findInfo.getRegDate())) {
throw new ServiceException("不是今日就诊");
}
return regDao.updateRegMedToolMark(id, addMedToolMark, updateMedToolMark) > 0;
if (!ObjectUtils.isEmpty(findInfo.getTreatNum())) { //就诊号不为空=>无需补充门诊号
return true;
}
return regDao.updateTreatNum(id, treatNum) > 0;
}
// public boolean updateRegMedToolMarkByTreatNum(String treatNum, String patientId, String addMedToolMark) throws ServiceException {
// RegisterDao regDao = new RegisterDao();
// String curDate = DateHelper.getCurDate();
//
// Register findInfo = findDBRegRecordByTreatNum(patientId, curDate, treatNum);
// if (findInfo == null) {
// throw new ServiceException("未找到挂号信息");
// }
// if (!curDate.equals(findInfo.getRegDate())) {
// throw new ServiceException("不是今日就诊");
// }
// Long id = findInfo.getId();
// if (!ObjectUtils.isEmpty(findInfo.getTreatNum())) { // 就诊号不为空=>无需补充门诊号
// treatNum = null;
// }
//
// String dbMedToolMark = findInfo.getMedToolMark();
// String updateMedToolMark = addMedToolMark;
// if (!ObjectUtils.isEmpty(dbMedToolMark)) {
// if (dbMedToolMark.contains(addMedToolMark)) { // 已存在
// throw new ServiceException("状态已存在");
// } else {
// updateMedToolMark = dbMedToolMark + "," + addMedToolMark;
// }
// }
// return regDao.updateTreatNum(String.valueOf(id), treatNum) > 0;
// }
public List<RegSign> getRegLineSignInRecords(String begDate, String endDate) {
if (begDate == null || endDate == null) { // 只查询今日
begDate = DateHelper.getCurDate() + " 06:00:00";
endDate = DateHelper.getCurDate() + " 23:59:59";
}
return new HisRegisterDao().getRegLineSignInRecords(begDate, endDate);
}
/**
* 根据患者id,查询预约待签到记录
*
* @param patientId patientId
* @return list
*/
public List<RegSign> getRegLineSignInRecordsByPatientId(String patientId, String begDate, String endDate) {
List<RegSign> records = getRegLineSignInRecords(null, null);
if (records.isEmpty()) {
return new ArrayList<>();
}
return records.stream().filter(o -> patientId.equals(o.getPatientId())).collect(Collectors.toList());
}
/**
* 根据treatNum,查询预约待签到记录
*
* @param treatNum 门诊号
* @return bean
*/
public RegSign getRegLineSignInRecordByTreatNum(String treatNum) {
List<RegSign> records = getRegLineSignInRecords(null, null);
if (records.isEmpty()) {
return null;
}
return records.stream().filter(o -> treatNum.equals(o.getTreatNum())).findFirst().orElse(null);
}
}

@ -17,53 +17,56 @@ public class ReportService {
/**
* 更新lis查看报告单数量
*
* @return 是否更新成功
*/
public boolean updateReportLisCount(){
return updateReportCount(ReportEnum.ReportLis);
public boolean updateReportLisCount() {
return updateReportCount(ReportEnum.ReportLis);
}
/**
* 更新pacs查看报告单数量
*
* @return 是否更新成功
*/
public boolean updateReportPacsCount(){
public boolean updateReportPacsCount() {
return updateReportCount(ReportEnum.ReportPacs);
}
/**
* 更新体检查看报告单数量
*
* @return 是否更新成功
*/
public boolean updateReportPeisCount(){
public boolean updateReportPeisCount() {
return updateReportCount(ReportEnum.ReportPies);
}
/**
* 更新云胶片查看数量
*
* @return 是否更新成功
*/
public boolean updateReportCloudCount(){
public boolean updateReportCloudCount() {
return updateReportCount(ReportEnum.ReportCloud);
}
/**
* 查看报告单数量统计更新
*
* @return 是否更新成功
*/
public boolean updateReportCount(ReportEnum reportEnum){
public boolean updateReportCount(ReportEnum reportEnum) {
try {
if(new ReportDao().existToday(reportEnum.CODE)){
log.info("[报表数量统计] {}-有今日数据,今日数据量+1",reportEnum.TYPE);
if (new ReportDao().existToday(reportEnum.CODE)) {
log.info("[报表数量统计] {}-有今日数据,今日数据量+1", reportEnum.TYPE);
return new ReportDao().updateCount(reportEnum.CODE);
} else {
log.info("[报表数量统计] {}-无今日数据,插入一条新的数据", reportEnum.TYPE);
return new ReportDao().insertToday(1, reportEnum.CODE, "");
}
else {
log.info("[报表数量统计] {}-无今日数据,插入一条新的数据",reportEnum.TYPE);
return new ReportDao().insertToday(1,reportEnum.CODE,"");
}
}
catch (Exception exception){
log.error("[报表数量统计] {}-错误:{}",reportEnum.TYPE,exception.toString());
} catch (Exception exception) {
log.error("[报表数量统计] {}-错误:{}", reportEnum.TYPE, exception.toString());
return false;
}
}

@ -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"));
}
}

@ -4,14 +4,9 @@ import com.ynxbd.wx.wxfactory.WxPayHelper;
import java.math.BigDecimal;
/**
* @author 李进才
* @ClassName RefundTest
* @Description TODO
* @date 2023/12/20 11:51:00
*/
// 退费
public class RefundTest {
public static void main(String[] args) {
WxPayHelper.refund("WX34361d8ce54248773cf9acf4bdf8", "4200002138202312203358207528", new BigDecimal("0.800"), new BigDecimal("0.800"), "手动退费");
}
// public static void main(String[] args) {
// WxPayHelper.refund("WX34361d8ce54248773cf9acf4bdf8", "4200002138202312203358207528", new BigDecimal("0.800"), new BigDecimal("0.800"), "手动退费");
// }
}

@ -1,8 +1,7 @@
package com.ynxbd.wx.wxfactory;
import com.ynxbd.common.helper.common.AesHelper;
import java.math.BigDecimal;
import org.apache.commons.lang3.ObjectUtils;
/**
* 请求参数处理-此处为参数解密
@ -17,11 +16,11 @@ public class ReqParamHelper {
}
public static String decode(String enData) {
if (ObjectUtils.isEmpty(enData)) return null;
return AesHelper.decryptHex(enData, KEY, IV);
}
public static void main(String[] args) {
System.out.println(encode("164649"));
System.out.println(decode("1D9BD9BA3A6DC0A9B40BE40234497596"));
System.out.println(encode("397631"));
}
}

@ -52,7 +52,7 @@ public class WxAuthHelper {
user.setOpenid(openid);
user.setIsSnapShotUser(snsToken.getIsSnapShotUser());
user.setPatientList(new PatientService().getPatientList(openid, unionId, true));
user.setPatientList(new PatientService().queryPatientList(openid, unionId, true));
if (isUserInfo) {
SnsUserInfo snsUser = WxFactory.Base.OAuth().snsUserInfo(snsToken.getAccessToken(), openid, "zh_CN", 3);

@ -55,7 +55,7 @@ public class WxMedicalHelper {
}
tip = String.format("医保卡绑定人是:【%s】,当前支付的订单属于患者:【%s】,该订单不属于医保卡本人,禁止支付", userName, realName);
}
log.info("【医保】不是本人禁止支付");
log.info("[医保]不是本人禁止支付");
throw new ServiceException(ResultEnum.PAY_NO_SELF_NO_PAY, tip);
}
}
@ -74,22 +74,22 @@ public class WxMedicalHelper {
// 转换数据对象
Map<String, Object> paramsMap = WxSignHelper.getReqXmlParamsMap(request);
if (paramsMap == null) {
throw new ServiceException("【医保】回调通知下单信息返回错误");
throw new ServiceException("[医保]回调通知下单信息返回错误");
}
// 签名验证
if (!WxSignHelper.validateSign(paramsMap, MdConfig.PAY_KEY)) { // 验证未通过,通知支付失败
throw new ServiceException("【医保】回调通知签名验证未通过!");
throw new ServiceException("[医保]回调通知签名验证未通过!");
}
String json = JsonHelper.toJsonString(paramsMap);
if ("".equals(json)) {
throw new ServiceException("【医保】回调通知下单信息为空");
throw new ServiceException("[医保]回调通知下单信息为空");
}
MedicalNotify notifyInfo = JsonHelper.parseObject(json, MedicalNotify.class);
if (notifyInfo == null) {
throw new ServiceException("【医保】回调通知下单信息转换失败");
throw new ServiceException("[医保]回调通知下单信息转换失败");
}
String openid = notifyInfo.getOpenid();
@ -101,12 +101,12 @@ public class WxMedicalHelper {
String timeEnd = notifyInfo.getTimeEnd();
if (openid == null || outTradeNo == null || medTransId == null || totalFee == null || cashFee == null || insuranceFee == null || timeEnd == null) {
throw new ServiceException(String.format("【医保】下单信息返回错误 outTradeNo={%s}", outTradeNo));
throw new ServiceException(String.format("[医保]下单信息返回错误 outTradeNo={%s}", outTradeNo));
}
// 已处理 去重
if (KEYS.isContainsKey(medTransId)) {
throw new ServiceException(ResultEnum.PAY_NOTIFY_REPEAT, String.format("【医保】[重复请求]下单信息去重 outTradeNo={%s}", outTradeNo));
throw new ServiceException(ResultEnum.PAY_NOTIFY_REPEAT, String.format("[医保][重复请求]下单信息去重 outTradeNo={%s}", outTradeNo));
}
String info = WxSignHelper.getMapInfo(paramsMap, "response_content");
@ -126,7 +126,7 @@ public class WxMedicalHelper {
throw e;
}
ErrorHelper.println(e);
throw new ServiceException(String.format("【医保】支付通知异常:[%s]", e.getMessage()));
throw new ServiceException(String.format("[医保]支付通知异常:[%s]", e.getMessage()));
}
}
@ -172,9 +172,9 @@ public class WxMedicalHelper {
body,
attach);
log.info("【医保】创建订单 {}", order);
log.info("[医保]创建订单 {}", order);
if (order == null) {
throw new ServiceException("【医保】请求失败");
throw new ServiceException("[医保]请求失败");
}
if (!order.isOk()) {
@ -183,7 +183,7 @@ public class WxMedicalHelper {
String payUrl = order.getPayUrl();
if (payUrl == null) {
throw new ServiceException("【医保】下单链接为空");
throw new ServiceException("[医保]下单链接为空");
}
log.info("[医保]下单url payUrl={}", payUrl);
map.put("payUrl", payUrl);
@ -238,7 +238,7 @@ public class WxMedicalHelper {
/**
* [医保]退费
* [医保]HIS调用退费
*/
public static MedicalOrder refund(String outTradeNo, String outRefundNo, String payOrdId, BigDecimal cashFee, String reason) {
return WxFactory.Medical.Common().refund(

@ -84,7 +84,7 @@ public class Client {
payType = 3; // 医保+现金
}
} catch (Exception e) {
log.error("【医保】金额转换异常: {}", e.getMessage());
log.error("[医保]金额转换异常: {}", e.getMessage());
return null;
}

@ -25,7 +25,7 @@ public class MdRespHelper {
* 成功响应
*/
public static String respOk(String mdPayKey) {
log.info("【医保】回调通知成功");
log.info("[医保]回调通知成功");
try {
Map<String, Object> map = new HashMap<>();
map.put("return_code", "SUCCESS");
@ -45,7 +45,7 @@ public class MdRespHelper {
* 成功响应
*/
public static String respFail(String message, String mdPayKey) {
log.info("【医保】回调通知:{}", message);
log.info("[医保]回调通知:{}", message);
if (message == null) {
message = "FAIL";
}

@ -4,7 +4,7 @@
xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core.xsd">
<!-- 硬盘缓存路径-->
<persistence directory="./app-cache/wx-cache-data"/>
<persistence directory="${catalina.home}/app-cache/wx-cache-data"/>
<cache-template name="cache-template">
<key-type>java.lang.String</key-type>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="logs"/>
<!-- 日志存放路径 home -->
<property name="log.path" value="${catalina.home}/app-logs"/>
<!--日志最大保存天数 100年-->
<property name="log.days" value="36500"/>
<!-- 日志输出格式 -->

@ -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

@ -1,5 +1,5 @@
# \u4E91\u80F6\u7247\u5730\u5740
xbd.200.token_url=http://10.20.10.41:8082
xbd.200.cloud_film_url=http://192.168.0.183:3307/wx3307
# \u75C5\u5386\u590D\u5370
xbd.200.med_record_copy_url=http://192.168.12.66:8081
# \u4F53\u68C0

@ -10,6 +10,11 @@
<listener-class>com.ynxbd.common.config.WebContextLister</listener-class>
</listener>
<context-param>
<param-name>logbackConfigLocation</param-name>
<param-value>classpath:logback.xml</param-value>
</context-param>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>

Loading…
Cancel
Save