|
@ -289,7 +289,8 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
|
String signType = request.getParameter("signType");
|
|
|
String timestamp = request.getParameter("timestamp");
|
|
|
String totalAmount = request.getParameter("totalAmount");//交易总金额
|
|
|
String tradeStatus = request.getParameter("tradeStatus");//交易状态
|
|
|
// String tradeStatus = request.getParameter("tradeStatus");//交易状态
|
|
|
String tradeStatus = request.getParameter("chargeStatus");//交易状态
|
|
|
String userId = request.getParameter("userId");//用户openID
|
|
|
String userName = request.getParameter("userName");//用户名字
|
|
|
|
|
@ -501,7 +502,8 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
|
String userName = requestParam.getString("userName");//用户名字
|
|
|
String idType = requestParam.getString("idType");//证件类型
|
|
|
String idNo = requestParam.getString("idNo");//证件号码
|
|
|
String tradeStatus = requestParam.getString("tradeStatus");//交易状态
|
|
|
// String tradeStatus = requestParam.getString("tradeStatus");//交易状态
|
|
|
String tradeStatus = requestParam.getString("chargeStatus");//交易状态
|
|
|
|
|
|
logger.debug(" ====================================> responseContent");
|
|
|
// org.json.JSONObject responseContents = requestParam.getJSONObject("responseContent");//医保结构体
|
|
@ -953,6 +955,8 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
|
Map<String, String> map = new HashMap<>();//请求结构体
|
|
|
map.put("feeType", "06");//长处方结算
|
|
|
map.put("settleType", "01"); //诊间医保结算
|
|
|
// 易联众新增字段代支付v1.3.7
|
|
|
map.put("principalCardNo",ssc); //实际结算卡号( 默认为绑卡主体卡号)
|
|
|
params.put("requestContent", objectMapper.writeValueAsString(map));// 请求结构体
|
|
|
logger.info("================================>" + "Before msBody");
|
|
|
requestParams.setParam(params);
|
|
@ -967,7 +971,12 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
|
JSONObject json = res.getParam();
|
|
|
String chargeNo = String.valueOf(json.get("chargeNo")); //医保结算业务流水号
|
|
|
result = String.valueOf(json.get("payUrl"));
|
|
|
// 易联众新增字段代支付v1.3.7
|
|
|
String traceTime = String.valueOf(json.get("traceTime"));
|
|
|
String traceNo = String.valueOf(json.get("traceNo"));
|
|
|
prescriptionPay.setChargeNo(chargeNo);//支付后返回的流水号
|
|
|
prescriptionPay.setTraceTime(formatter.parse(traceTime));//交易成功时间
|
|
|
prescriptionPay.setTraceNo(traceNo);//支付平台跟踪号
|
|
|
} else {
|
|
|
isSuccess = false;
|
|
|
flag = 0;
|
|
@ -1071,87 +1080,104 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
|
flag = 1;
|
|
|
result = JSON.toJSONString(res.getParam());
|
|
|
// 新增保存数据
|
|
|
// JSONObject request = JSON.parseObject(result);
|
|
|
JSONObject request = JSON.parseObject(result);
|
|
|
// String tradeStatus = request.getString("tradeStatus");//交易状态
|
|
|
// String chargeNo = request.getString("chargeNo");//支付平台流水号
|
|
|
// String chargeTime = request.getString("chargeTime");//支付平台交易成功时间
|
|
|
// String outChargeNo = request.getString("outChargeNo");//接入应用业务流水号
|
|
|
// String outChargeTime = request.getString("outChargeTime");//接入应用时间
|
|
|
//// String medOrgNo = request.getString("medOrgNo");//医疗机构编号
|
|
|
//// String medOrgName = request.getString("medOrgName");//医疗机构名称
|
|
|
// String billNo = request.getString("billNo");//待结算费用单据号
|
|
|
// String cardNo = request.getString("cardNo");//医保卡号
|
|
|
// String totalAmount = request.getString("totalAmount");//交易总金额
|
|
|
// String insuranceAmount = request.getString("insuranceAmount");//医保支付金额
|
|
|
// String selfPayAmount = request.getString("selfPayAmount");//自付金额
|
|
|
// String userId = request.getString("userId");//用户openID
|
|
|
// String userName = request.getString("userName");//用户名字
|
|
|
// String idNo = request.getString("idNo");//证件号码
|
|
|
// String idType = request.getString("idType");//证件类型
|
|
|
//
|
|
|
//// String appId = request.getString("appId");
|
|
|
//// String channel = request.getString("channel");//支付方式
|
|
|
//// String sign = request.getString("sign");
|
|
|
//// String signType = request.getString("signType");
|
|
|
//// String timestamp = request.getString("timestamp");
|
|
|
//
|
|
|
// JSONObject responseContents = request.getJSONObject("responseContent");//医保结构体
|
|
|
// PrescriptionPay prescriptionPay = payDao.findByCode(outChargeNo);
|
|
|
// if (responseContents != null) {
|
|
|
// String miSettleNo = responseContents.getString("miSettleNo");//医保收费单据号 (医保签约号)
|
|
|
// String miRegisterNo = responseContents.getString("miRegisterNo");//医保挂号
|
|
|
// String miCollectDate = responseContents.getString("miCollectDate");//收费日期
|
|
|
// String miCollectTime = responseContents.getString("miCollectTime");//收费时间
|
|
|
// String miCollectorName = responseContents.getString("miCollectorName");//收费人姓名
|
|
|
// String miTotalFee = responseContents.getString("miTotalFee");//本次报销总额
|
|
|
// String selfPay = responseContents.getString("selfPay");//个人现金支付
|
|
|
// String accountPay = responseContents.getString("accountPay");//个人账户支付
|
|
|
// String heathPay = responseContents.getString("heathPay");//健康账户支付
|
|
|
// String cadresPay = responseContents.getString("cadresPay");//公务员补助
|
|
|
// String fundPay = responseContents.getString("fundPay");//基金支付
|
|
|
// String healthCarePay = responseContents.getString("healthCarePay");//保健基金支付
|
|
|
// String commercePay = responseContents.getString("commercePay");//商业保险支付
|
|
|
// String familyPay = responseContents.getString("familyPay");//共济账户支付
|
|
|
// String civilPay = responseContents.getString("civilPay");//民政补助金额
|
|
|
// String civilZone = responseContents.getString("civilZone");//民政行政区号
|
|
|
// String bdrugPay = responseContents.getString("bdrugPay");//乙类支付金额
|
|
|
// String unlessAmount = responseContents.getString("unlessAmount");//非医保费用
|
|
|
// String exceedAmount = responseContents.getString("exceedAmount");//超封顶线金额
|
|
|
// String accountBalance = responseContents.getString("accountBalance");//个人账户余额
|
|
|
// String healthBalance = responseContents.getString("healthBalance");//健康账户余额
|
|
|
//
|
|
|
// prescriptionPay.setBillNo(billNo);//待结算费用单据号
|
|
|
// prescriptionPay.setChargeNo(chargeNo);//支付流水号
|
|
|
// prescriptionPay.setInsuranceAmount(Integer.parseInt(insuranceAmount));//医保支付金额
|
|
|
// prescriptionPay.setSelfPayAmount(Integer.parseInt(selfPayAmount));//自付金额
|
|
|
// prescriptionPay.setMiSettleNo(miSettleNo);//医保收费单据号
|
|
|
// prescriptionPay.setMiRegisterNo(miRegisterNo);//医保挂号
|
|
|
// SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMdd");
|
|
|
// prescriptionPay.setMiCollectDate(formatDate.parse(miCollectDate));//收费日期
|
|
|
// SimpleDateFormat formatTime = new SimpleDateFormat("HHmm");
|
|
|
// prescriptionPay.setMiCollectTime(formatTime.parse(miCollectTime));//收费时间
|
|
|
// prescriptionPay.setMiCollectorName(miCollectorName);//收费人姓名
|
|
|
// prescriptionPay.setMiTotalFee(Integer.parseInt(miTotalFee));//本次报销总额
|
|
|
// prescriptionPay.setSelfPay(Integer.parseInt(selfPay));//个人现金支付
|
|
|
// prescriptionPay.setAccountPay(Integer.parseInt(accountPay));//个人账户支付
|
|
|
// prescriptionPay.setHeathPay(Integer.parseInt(heathPay));//健康账户支付
|
|
|
// prescriptionPay.setCadresPay(Integer.parseInt(cadresPay));//公务员补助
|
|
|
// prescriptionPay.setFundPay(Integer.parseInt(fundPay));//基金支付
|
|
|
// prescriptionPay.setHealthCarePay(Integer.parseInt(healthCarePay));//保健基金支付
|
|
|
// prescriptionPay.setCommercePay(Integer.parseInt(commercePay));//商业保险支付
|
|
|
// prescriptionPay.setFamilyPay(Integer.parseInt(familyPay));//共济账户支付
|
|
|
// prescriptionPay.setCivilPay(Integer.parseInt(civilPay));//民政补助金额
|
|
|
// prescriptionPay.setCivilZone(civilZone);//民政行政区号
|
|
|
// prescriptionPay.setBdrugPay(Integer.parseInt(bdrugPay));//乙类支付金额
|
|
|
// prescriptionPay.setUnlessAmount(Integer.parseInt(unlessAmount));//非医保费用
|
|
|
// prescriptionPay.setExceedAmount(Integer.parseInt(exceedAmount));//超封顶线金额
|
|
|
// prescriptionPay.setAccountBalance(Integer.parseInt(accountBalance));//个人账户余额
|
|
|
// prescriptionPay.setHealthBalance(Integer.parseInt(healthBalance));//健康账户余额
|
|
|
//
|
|
|
// // 保存数据库更改记录
|
|
|
// payDao.save(prescriptionPay);
|
|
|
// }
|
|
|
String chargeStatus = request.getString("chargeStatus");//交易状态
|
|
|
String chargeNo = request.getString("chargeNo");//支付平台流水号
|
|
|
String chargeTime = request.getString("chargeTime");//支付平台交易成功时间
|
|
|
String outChargeNo = request.getString("outChargeNo");//接入应用业务流水号
|
|
|
String outChargeTime = request.getString("outChargeTime");//接入应用时间
|
|
|
String medOrgNo = request.getString("medOrgNo");//医疗机构编号
|
|
|
String medOrgName = request.getString("medOrgName");//医疗机构名称
|
|
|
String billNo = request.getString("billNo");//待结算费用单据号
|
|
|
String cardNo = request.getString("cardNo");//医保卡号
|
|
|
String totalAmount = request.getString("totalAmount");//交易总金额
|
|
|
String insuranceAmount = request.getString("insuranceAmount");//医保支付金额
|
|
|
String selfPayAmount = request.getString("selfPayAmount");//自付金额
|
|
|
String userId = request.getString("userId");//用户openID
|
|
|
String userName = request.getString("userName");//用户名字
|
|
|
String idNo = request.getString("idNo");//证件号码
|
|
|
String idType = request.getString("idType");//证件类型
|
|
|
|
|
|
// String appId = request.getString("appId");
|
|
|
// String channel = request.getString("channel");//支付方式
|
|
|
// String sign = request.getString("sign");
|
|
|
// String signType = request.getString("signType");
|
|
|
// String timestamp = request.getString("timestamp");
|
|
|
|
|
|
JSONObject responseContents = request.getJSONObject("responseContent");//医保结构体
|
|
|
PrescriptionPay prescriptionPay = payDao.findByCode(outChargeNo);
|
|
|
if (responseContents != null) {
|
|
|
String miSettleNo = responseContents.getString("miSettleNo");//医保收费单据号 (医保签约号)
|
|
|
String miRegisterNo = responseContents.getString("miRegisterNo");//医保挂号
|
|
|
String miCollectDate = responseContents.getString("miCollectDate");//收费日期
|
|
|
String miCollectTime = responseContents.getString("miCollectTime");//收费时间
|
|
|
String miCollectorName = responseContents.getString("miCollectorName");//收费人姓名
|
|
|
String miTotalFee = responseContents.getString("miTotalFee");//本次报销总额
|
|
|
String selfPay = responseContents.getString("selfPay");//个人现金支付
|
|
|
String accountPay = responseContents.getString("accountPay");//个人账户支付
|
|
|
String heathPay = responseContents.getString("heathPay");//健康账户支付
|
|
|
String cadresPay = responseContents.getString("cadresPay");//公务员补助
|
|
|
String fundPay = responseContents.getString("fundPay");//基金支付
|
|
|
String healthCarePay = responseContents.getString("healthCarePay");//保健基金支付
|
|
|
String commercePay = responseContents.getString("commercePay");//商业保险支付
|
|
|
String familyPay = responseContents.getString("familyPay");//共济账户支付
|
|
|
String civilPay = responseContents.getString("civilPay");//民政补助金额
|
|
|
String civilZone = responseContents.getString("civilZone");//民政行政区号
|
|
|
String bdrugPay = responseContents.getString("bdrugPay");//乙类支付金额
|
|
|
String unlessAmount = responseContents.getString("unlessAmount");//非医保费用
|
|
|
String exceedAmount = responseContents.getString("exceedAmount");//超封顶线金额
|
|
|
String accountBalance = responseContents.getString("accountBalance");//个人账户余额
|
|
|
String healthBalance = responseContents.getString("healthBalance");//健康账户余额
|
|
|
|
|
|
prescriptionPay.setMiSettleNo(miSettleNo);//医保收费单据号
|
|
|
prescriptionPay.setMiRegisterNo(miRegisterNo);//医保挂号
|
|
|
SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMdd");
|
|
|
prescriptionPay.setMiCollectDate(formatDate.parse(miCollectDate));//收费日期
|
|
|
SimpleDateFormat formatTime = new SimpleDateFormat("HHmm");
|
|
|
prescriptionPay.setMiCollectTime(formatTime.parse(miCollectTime));//收费时间
|
|
|
prescriptionPay.setMiCollectorName(miCollectorName);//收费人姓名
|
|
|
prescriptionPay.setMiTotalFee(Integer.parseInt(miTotalFee));//本次报销总额
|
|
|
prescriptionPay.setSelfPay(Integer.parseInt(selfPay));//个人现金支付
|
|
|
prescriptionPay.setAccountPay(Integer.parseInt(accountPay));//个人账户支付
|
|
|
prescriptionPay.setHeathPay(Integer.parseInt(heathPay));//健康账户支付
|
|
|
prescriptionPay.setCadresPay(Integer.parseInt(cadresPay));//公务员补助
|
|
|
prescriptionPay.setFundPay(Integer.parseInt(fundPay));//基金支付
|
|
|
prescriptionPay.setHealthCarePay(Integer.parseInt(healthCarePay));//保健基金支付
|
|
|
prescriptionPay.setCommercePay(Integer.parseInt(commercePay));//商业保险支付
|
|
|
prescriptionPay.setFamilyPay(Integer.parseInt(familyPay));//共济账户支付
|
|
|
prescriptionPay.setCivilPay(Integer.parseInt(civilPay));//民政补助金额
|
|
|
prescriptionPay.setCivilZone(civilZone);//民政行政区号
|
|
|
prescriptionPay.setBdrugPay(Integer.parseInt(bdrugPay));//乙类支付金额
|
|
|
prescriptionPay.setUnlessAmount(Integer.parseInt(unlessAmount));//非医保费用
|
|
|
prescriptionPay.setExceedAmount(Integer.parseInt(exceedAmount));//超封顶线金额
|
|
|
prescriptionPay.setAccountBalance(Integer.parseInt(accountBalance));//个人账户余额
|
|
|
prescriptionPay.setHealthBalance(Integer.parseInt(healthBalance));//健康账户余额
|
|
|
|
|
|
}
|
|
|
if ("0".equals(chargeStatus) || "SUCCESS".equals(chargeStatus)) {
|
|
|
prescriptionPay.setTradeStatus("1");//交易状态 成功1 失败0
|
|
|
}else {
|
|
|
prescriptionPay.setTradeStatus("0");//交易状态 成功1 失败0
|
|
|
}
|
|
|
prescriptionPay.setChargeNo(chargeNo);//支付流水号
|
|
|
SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
prescriptionPay.setChargeTime(formatDate.parse(chargeTime));//支付平台交易成功时间
|
|
|
prescriptionPay.setOutChargeTime(formatDate.parse(outChargeTime));//接入应用内业务时间
|
|
|
prescriptionPay.setMedOrgNo(medOrgNo);//医疗机构编号
|
|
|
prescriptionPay.setMedOrgName(medOrgName);//医疗机构名称
|
|
|
prescriptionPay.setBillNo(billNo);//待结算费用单据号
|
|
|
prescriptionPay.setCardNo(cardNo);//医保卡号
|
|
|
prescriptionPay.setTotalAmount(Integer.parseInt(totalAmount));//交易总金额
|
|
|
prescriptionPay.setInsuranceAmount(Integer.parseInt(insuranceAmount));//医保支付金额
|
|
|
prescriptionPay.setSelfPayAmount(Integer.parseInt(selfPayAmount));//自付金额
|
|
|
prescriptionPay.setOpenid(userId);
|
|
|
prescriptionPay.setUserName(userName);
|
|
|
prescriptionPay.setIdType(idType);//证件类型
|
|
|
prescriptionPay.setIdNo(idNo);//证件号码
|
|
|
|
|
|
// 保存数据库更改记录
|
|
|
payDao.save(prescriptionPay);
|
|
|
logger.info("请求成功,返回参数: " + result);
|
|
|
} else {
|
|
|
isSuccess = false;
|