|
@ -1100,12 +1100,24 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
// 易联众新增字段代支付v1.3.7
|
|
// 易联众新增字段代支付v1.3.7
|
|
map.put("principalCardNo", ssc); //实际结算卡号( 默认为绑卡主体卡号)
|
|
map.put("principalCardNo", ssc); //实际结算卡号( 默认为绑卡主体卡号)
|
|
if (!patient.equals(repUid)) {
|
|
if (!patient.equals(repUid)) {
|
|
|
|
String principalCardNo = null;
|
|
Patient person = patientDao.findByCode(repUid);
|
|
Patient person = patientDao.findByCode(repUid);
|
|
String repOpenId = person.getOpenid();
|
|
|
|
BindCard repCard = onePayService.ownerCard(repOpenId);
|
|
|
|
String repSsc = repCard.getAttachCardNo();
|
|
|
|
map.put("principalCardNo", repSsc); //实际签约卡号( 默认为绑卡主体卡号)
|
|
|
|
prescriptionPay.setPrincipalCardNo(repSsc);
|
|
|
|
|
|
String repSsc = person.getSsc();
|
|
|
|
List<BindCard> repCard = onePayService.bindCardList(openid);
|
|
|
|
for (BindCard cards : repCard) {
|
|
|
|
String attachCardNo = cards.getAttachCardNo();
|
|
|
|
if (StringUtil.isNotEmpty(attachCardNo) && StringUtil.isNotEmpty(repSsc) && repSsc.equals(attachCardNo)) {
|
|
|
|
principalCardNo = repSsc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isNotEmpty(principalCardNo)){
|
|
|
|
map.put("principalCardNo", principalCardNo); //实际签约卡号( 默认为绑卡主体卡号)
|
|
|
|
prescriptionPay.setPrincipalCardNo(principalCardNo);
|
|
|
|
}else {
|
|
|
|
resultMap.put("status", "-4");
|
|
|
|
return resultMap;
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
params.put("requestContent", objectMapper.writeValueAsString(map));// 请求结构体
|
|
params.put("requestContent", objectMapper.writeValueAsString(map));// 请求结构体
|
|
logger.info("================================>" + "Before msBody");
|
|
logger.info("================================>" + "Before msBody");
|
|
@ -1411,7 +1423,7 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getSignFamilyPayResult(String outChargeNo, String accessToken, String appId, String appSecret) throws Exception {
|
|
public String getSignFamilyPayResult(String outChargeNo, String accessToken, String appId, String appSecret) throws Exception {
|
|
PayConfigura config = configuraDao.findWorkConfigura();
|
|
PayConfigura config = configuraDao.findWorkConfigura();
|
|
int flag = 0;
|
|
int flag = 0;
|
|
@ -1423,7 +1435,7 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
|
|
|
|
// *************************** 测通流程 ***************************************
|
|
// *************************** 测通流程 ***************************************
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
|
|
OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
|
|
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
RequestParams requestParams = new RequestParams();
|
|
RequestParams requestParams = new RequestParams();
|
|
requestParams.setAppId(appId);
|
|
requestParams.setAppId(appId);
|
|
@ -1431,12 +1443,12 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
requestParams.setSignType(signType);
|
|
requestParams.setSignType(signType);
|
|
requestParams.setEncryptType(encryptType);
|
|
requestParams.setEncryptType(encryptType);
|
|
requestParams.setTransType(config.getChargeQueryType());
|
|
requestParams.setTransType(config.getChargeQueryType());
|
|
|
|
|
|
|
|
|
|
//业务参数
|
|
//业务参数
|
|
JSONObject params = new JSONObject();
|
|
JSONObject params = new JSONObject();
|
|
params.put("outChargeNo", outChargeNo); //接入应用结算业务流水号
|
|
params.put("outChargeNo", outChargeNo); //接入应用结算业务流水号
|
|
params.put("wxToken", accessToken);
|
|
params.put("wxToken", accessToken);
|
|
|
|
|
|
|
|
|
|
requestParams.setParam(params);
|
|
requestParams.setParam(params);
|
|
msgBody = JSON.toJSONString(requestParams);
|
|
msgBody = JSON.toJSONString(requestParams);
|
|
|
|
|
|
@ -1444,13 +1456,13 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
//执行支付 返回原生返回值
|
|
//执行支付 返回原生返回值
|
|
ResponseParams<JSONObject> res = onepayClient.execute(requestParams);
|
|
ResponseParams<JSONObject> res = onepayClient.execute(requestParams);
|
|
response = JSON.toJSONString(res);
|
|
response = JSON.toJSONString(res);
|
|
|
|
|
|
|
|
|
|
if (OnepayDefaultClient.isSuccessful(res)) {
|
|
if (OnepayDefaultClient.isSuccessful(res)) {
|
|
//业务处理*******************
|
|
//业务处理*******************
|
|
// 只返回业务出参
|
|
// 只返回业务出参
|
|
flag = 1;
|
|
flag = 1;
|
|
result = JSON.toJSONString(res.getParam());
|
|
result = JSON.toJSONString(res.getParam());
|
|
|
|
|
|
|
|
|
|
logger.info("请求成功,返回参数: " + result);
|
|
logger.info("请求成功,返回参数: " + result);
|
|
} else {
|
|
} else {
|
|
isSuccess = false;
|
|
isSuccess = false;
|
|
@ -1463,7 +1475,7 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
ex.printStackTrace(pw);
|
|
ex.printStackTrace(pw);
|
|
error = sw.toString();
|
|
error = sw.toString();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
//type = 3易联众接口保存http日志
|
|
//type = 3易联众接口保存http日志
|
|
logger.info("api - " + config.getChargeQueryType());
|
|
logger.info("api - " + config.getChargeQueryType());
|
|
logger.info("request - " + msgBody);
|
|
logger.info("request - " + msgBody);
|
|
@ -1473,7 +1485,7 @@ public class PatientPrescriptionPayService extends BaseService {
|
|
if (!isSuccess) {
|
|
if (!isSuccess) {
|
|
throw new Exception(error);
|
|
throw new Exception(error);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
}
|