|
|
|
@ -1,23 +1,35 @@ |
|
|
|
package com.ynxbd.common.action.xk; |
|
|
|
package com.ynxbd.common.action.xk; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdcardUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.ynxbd.common.action.base.BaseAction; |
|
|
|
import com.ynxbd.common.action.base.BaseAction; |
|
|
|
|
|
|
|
import com.ynxbd.common.action.pay.PEnum; |
|
|
|
|
|
|
|
import com.ynxbd.common.bean.Dept; |
|
|
|
|
|
|
|
import com.ynxbd.common.bean.enums.MerchantEnum; |
|
|
|
import com.ynxbd.common.bean.his.HisTreat; |
|
|
|
import com.ynxbd.common.bean.his.HisTreat; |
|
|
|
|
|
|
|
import com.ynxbd.common.bean.pay.Order; |
|
|
|
import com.ynxbd.common.config.interceptor.AesDecode; |
|
|
|
import com.ynxbd.common.config.interceptor.AesDecode; |
|
|
|
|
|
|
|
import com.ynxbd.common.dao.his.HisSysDictDao; |
|
|
|
import com.ynxbd.common.dao.his.HisTreatDao; |
|
|
|
import com.ynxbd.common.dao.his.HisTreatDao; |
|
|
|
import com.ynxbd.common.dao.his.HisXKDao; |
|
|
|
import com.ynxbd.common.dao.his.HisXKDao; |
|
|
|
|
|
|
|
import com.ynxbd.common.helper.common.AesMicroHelper; |
|
|
|
|
|
|
|
import com.ynxbd.common.helper.common.JsonHelper; |
|
|
|
|
|
|
|
import com.ynxbd.common.helper.common.ParamHelper; |
|
|
|
|
|
|
|
import com.ynxbd.common.his.HisFactory; |
|
|
|
import com.ynxbd.common.result.JsonResult; |
|
|
|
import com.ynxbd.common.result.JsonResult; |
|
|
|
import com.ynxbd.common.result.Result; |
|
|
|
import com.ynxbd.common.result.Result; |
|
|
|
import com.ynxbd.common.result.ResultEnum; |
|
|
|
import com.ynxbd.common.result.ResultEnum; |
|
|
|
|
|
|
|
import com.ynxbd.common.service.PayService; |
|
|
|
import com.ynxbd.common.service.RxService; |
|
|
|
import com.ynxbd.common.service.RxService; |
|
|
|
import com.ynxbd.wx.config.WeChatConfig; |
|
|
|
|
|
|
|
import com.ynxbd.wx.wxfactory.AesWxHelper; |
|
|
|
import com.ynxbd.wx.wxfactory.AesWxHelper; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
|
import org.apache.struts2.convention.annotation.Action; |
|
|
|
import org.apache.struts2.convention.annotation.Action; |
|
|
|
import org.apache.struts2.convention.annotation.Namespace; |
|
|
|
import org.apache.struts2.convention.annotation.Namespace; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
@ -153,6 +165,35 @@ public class XKAction extends BaseAction { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* [问诊]挂号退费 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Action("refundRegOLOrder") |
|
|
|
|
|
|
|
public Result refundRegOLOrder(String payCode, String outTradeNo, String totalFee, String bankTransNo, String openid, String patientId, String refundDesc) { |
|
|
|
|
|
|
|
MerchantEnum merchantEnum = MerchantEnum.findEnumByCode(payCode); |
|
|
|
|
|
|
|
if (merchantEnum == null) { |
|
|
|
|
|
|
|
return Result.error(ResultEnum.PAY_TYPE_NOT_SUPPORT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
bankTransNo = AesMicroHelper.decode(bankTransNo); |
|
|
|
|
|
|
|
outTradeNo = AesMicroHelper.decode(outTradeNo); |
|
|
|
|
|
|
|
totalFee = AesMicroHelper.decode(totalFee); |
|
|
|
|
|
|
|
openid = AesMicroHelper.decode(openid); |
|
|
|
|
|
|
|
log.info("[问诊]挂号退费 outTradeNo={}, bankTransNo={}, totalFee={}, openid={}, patientId={}", outTradeNo, bankTransNo, totalFee, openid, patientId); |
|
|
|
|
|
|
|
if (outTradeNo == null || bankTransNo == null || openid == null || totalFee == null) { |
|
|
|
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_BLANK); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal orderTotalFee = new BigDecimal(totalFee); |
|
|
|
|
|
|
|
String outRefundNo = HisFactory.getOutRefundNo(bankTransNo, PEnum.OL_REG); |
|
|
|
|
|
|
|
Order orderRefund = PayService.refund(merchantEnum, outTradeNo, outRefundNo, orderTotalFee, orderTotalFee, refundDesc, new Date(), openid, patientId, null); |
|
|
|
|
|
|
|
if (orderRefund.isSuccess()) { |
|
|
|
|
|
|
|
return Result.success(AesMicroHelper.encode(outRefundNo)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Result.error(orderRefund.getErrorMsg()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* [问诊]查询问诊挂号-咨询费用[未使用] |
|
|
|
* [问诊]查询问诊挂号-咨询费用[未使用] |
|
|
|
* |
|
|
|
* |
|
|
|
@ -200,4 +241,73 @@ public class XKAction extends BaseAction { |
|
|
|
// return Result.success(response);
|
|
|
|
// return Result.success(response);
|
|
|
|
return Result.success(); |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Action("addDept") |
|
|
|
|
|
|
|
public Result addDept(String callNo, String data) { |
|
|
|
|
|
|
|
log.info("[科室]添加 callNo={}, data={}", callNo, data); |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(callNo) || ObjectUtils.isEmpty(data)) { |
|
|
|
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject dept = JsonHelper.parseObject(data); |
|
|
|
|
|
|
|
if (dept == null) { |
|
|
|
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_INVALID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String deptName = dept.getString("deptName"); |
|
|
|
|
|
|
|
String deptClassCode = dept.getString("deptClassCode"); |
|
|
|
|
|
|
|
String deptClassName = dept.getString("deptClassName"); |
|
|
|
|
|
|
|
log.info("[科室]添加 deptName={}, deptClassCode={}, deptClassName={}", deptName, deptClassCode, deptClassName); |
|
|
|
|
|
|
|
if (StrUtil.hasBlank(deptName, deptClassCode, deptClassName)) { |
|
|
|
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JsonResult jsonResult = new HisSysDictDao().addDept(deptName, deptClassCode, deptClassName); |
|
|
|
|
|
|
|
if (!jsonResult.success()) { |
|
|
|
|
|
|
|
return Result.error(jsonResult.getMessage()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Action("addDoctor") |
|
|
|
|
|
|
|
public Result addDoctor(String callNo, String data) { |
|
|
|
|
|
|
|
log.info("[医生]添加 callNo={}, data={}", callNo, data); |
|
|
|
|
|
|
|
data = AesWxHelper.decode(data); |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(callNo) || ObjectUtils.isEmpty(data)) { |
|
|
|
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject doctor = JsonHelper.parseObject(data); |
|
|
|
|
|
|
|
if (doctor == null) { |
|
|
|
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_INVALID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String deptCode = doctor.getString("deptCode"); |
|
|
|
|
|
|
|
String doctType = doctor.getString("doctType"); |
|
|
|
|
|
|
|
String doctName = doctor.getString("doctName"); |
|
|
|
|
|
|
|
String idCardNo = doctor.getString("idCardNo"); |
|
|
|
|
|
|
|
String birthdate = doctor.getString("birthdate"); |
|
|
|
|
|
|
|
String gender = doctor.getString("gender"); |
|
|
|
|
|
|
|
String certCode = doctor.getString("certCode"); |
|
|
|
|
|
|
|
String titleCode = doctor.getString("titleCode"); |
|
|
|
|
|
|
|
log.info("[医生]添加 deptCode={}, doctType={}, doctName={}, idCardNo={}, gender={}, certCode={}, titleCode={}", |
|
|
|
|
|
|
|
deptCode, doctType, doctName, ParamHelper.hideIdCardNo(idCardNo), gender, certCode, titleCode); |
|
|
|
|
|
|
|
if (StrUtil.hasBlank(deptCode, doctType, doctName, idCardNo, gender, certCode, titleCode)) { |
|
|
|
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(birthdate)) { |
|
|
|
|
|
|
|
birthdate = IdcardUtil.getBirthByIdCard(idCardNo); |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(birthdate)) { |
|
|
|
|
|
|
|
return Result.error(ResultEnum.PARAM_IS_DEFECT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
JsonResult jsonResult = new HisSysDictDao().addDoctor(deptCode, doctType, doctName, idCardNo, birthdate, gender, certCode, titleCode); |
|
|
|
|
|
|
|
if (!jsonResult.success()) { |
|
|
|
|
|
|
|
return Result.error(jsonResult.getMessage()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|